Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: shader to(single)textures (mulititex model) in [Re: broozar] #84107
08/08/06 21:47
08/08/06 21:47
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
Not good news in your post, DaBro0zar

Re: shader to(single)textures (mulititex model) in [Re: Lion_Ts] #84108
08/09/06 13:46
08/09/06 13:46
Joined: Jun 2005
Posts: 4,875
broozar Offline OP
Expert
broozar  Offline OP
Expert

Joined: Jun 2005
Posts: 4,875
jcl said there isn't a difference in handling the FFEs and shaders. so maybe i am just blind and forgot sth., so i gonna test things again and again. i will keep you updated.

Re: shader to(single)textures (mulititex model) in [Re: broozar] #84109
08/09/06 18:48
08/09/06 18:48
Joined: Jun 2005
Posts: 4,875
broozar Offline OP
Expert
broozar  Offline OP
Expert

Joined: Jun 2005
Posts: 4,875
k what's wrong with it?

fx:
Code:

// -------------------------------------------------------------
// Diffuse and specular shader for models
// -------------------------------------------------------------
//Only does sun light, no dynamic lights..

float4x4 matWorldViewProj;
float4x4 matWorld;
float4 vecViewPos;
float4 vecFog;
float4 vecSkill1;

float4 vecLight;
float4 suncolor={0.8,0.8,0.7,0.0}; //define the suncolor here, couls al so pass it fomr the script in a mtl skill

texture mtlSkin1;//this is the color map with specular map in alpha ..32 bit
texture mtlSkin2; //this is the normal map .. 24 bit

sampler ColorMapSampler = sampler_state
{
Texture = <mtlSkin1>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = wrap;
AddressV = wrap;
};
sampler BumpMapSampler = sampler_state
{
Texture = <mtlSkin2>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = wrap;
AddressV = wrap;
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
//sunlight
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// -------------------------------------------------------------
// Output channels
// -------------------------------------------------------------
struct VS_OUTPUT1
{
float4 Pos : POSITION;
float2 Tex : TEXCOORD0;

float3 View4 : TEXCOORD3;

float3 Sun : TEXCOORD1;
float Fog : FOG;

};
// -------------------------------------------------------------
// vertex shader function (input channels)
// -------------------------------------------------------------
VS_OUTPUT1 VS_PASS1(float4 Pos : POSITION, float2 texcoord0 : TEXCOORD0, float3 Normal : NORMAL, float3 Tangent : TEXCOORD2 )
{
VS_OUTPUT1 Out = (VS_OUTPUT1)0;
Out.Pos = mul(Pos, matWorldViewProj); // transform Position

// compute the 3x3 tranform matrix
// to transform from world space to tangent space
float3x3 worldToTangentSpace;
worldToTangentSpace[0] = mul(Tangent, matWorld);
worldToTangentSpace[1] = mul(cross(Tangent, Normal), matWorld);
worldToTangentSpace[2] = mul(Normal, matWorld);

Out.Tex = texcoord0.xy;

float3 PosWorld = mul(Pos, matWorld);

// float ofog = 1 - (distance(PosWorld, vecViewPos) - vecFog.x) * (vecFog.z);
// Out.Fog = ofog;
Out.Fog = 10000;


float3 Viewer4 = PosWorld - vecViewPos;
Out.View4 = mul(worldToTangentSpace, -Viewer4); // V

//sunlight
Out.Sun.xyz = mul(worldToTangentSpace, vecSkill1); // L

return Out;
}
struct PS_INPUT1
{
float2 Tex : TEXCOORD0;
float3 View4 : TEXCOORD3;
float3 Sun : TEXCOORD1;
float Fog : FOG;
};
// -------------------------------------------------------------
// Pixel Shader (input channels):output channel
// -------------------------------------------------------------
float4 PS_PASS1( PS_INPUT1 psInStruct ):COLOR
{

float4 color = tex2D(ColorMapSampler, psInStruct.Tex); // fetch color map
float3 bumpNormal = 2 * (tex2D(BumpMapSampler, psInStruct.Tex) - 0.5); // fetch bump map
bumpNormal=normalize(bumpNormal);

float3 ViewDir4 = normalize(psInStruct.View4);

//sunlight
float3 Sun = normalize(psInStruct.Sun);
float4 diff7 = saturate(dot(bumpNormal, Sun)); // diffuse component
float3 Reflect7 = normalize(2 * diff7 * bumpNormal - Sun); // R
float4 spec7 = pow(saturate(dot(Reflect7, ViewDir4)), 15);
float shadow7 = saturate(4 * diff7);

return
(
(vecLight * color) + //ambient

((shadow7* (color * diff7 + (spec7*color.w))) * suncolor)
);
}
// -------------------------------------------------------------
// techniques//
// -------------------------------------------------------------
technique two_pass
{
pass P0
{
alphablendenable=false;
zenable=true;
zwriteenable=true;
//compile shaders
VertexShader = compile vs_1_1 VS_PASS1();
PixelShader = compile ps_2_0 PS_PASS1();
}
}



wdl:
Code:

material wire{
effect="mtlly.fx";
skin1=front;
skin2=front3d;
flags=tangent;
}

starter mtls{
wait(10);
ent_mtlset (podL, wire, 5);
wire.skill1=float(sun_pos.x);
wire.skill2=float(sun_pos.z);
wire.skill3=float(sun_pos.y);
}



effect_load doesn't change anything.

Re: shader to(single)textures (mulititex model) in [Re: broozar] #84110
08/09/06 22:26
08/09/06 22:26
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
I don't see any mistake...
DaBro0zar, I haven't any success too for now.
When FFE (I've tested simple DOT3BM) applied in the MED for material - all works ok, when asm or hlsl - not. I'm disappointed...

Re: shader to(single)textures (mulititex model) in [Re: Lion_Ts] #84111
08/10/06 08:32
08/10/06 08:32
Joined: Jun 2005
Posts: 4,875
broozar Offline OP
Expert
broozar  Offline OP
Expert

Joined: Jun 2005
Posts: 4,875
as i thought. i am dropping a line for jcl and waiting for answer..

Re: shader to(single)textures (mulititex model) in [Re: broozar] #84112
08/12/06 20:51
08/12/06 20:51
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
Two days lost...
JCL!!!
Can You show any simple working HLSL shader, applied in MED (Please, read whole topic)?

Re: shader to(single)textures (mulititex model) in [Re: Lion_Ts] #84113
08/14/06 10:49
08/14/06 10:49
Joined: Jun 2005
Posts: 4,875
broozar Offline OP
Expert
broozar  Offline OP
Expert

Joined: Jun 2005
Posts: 4,875
here's jcl's proposal:
http://www.coniserver.net/ubbthreads/sho...e=0&fpart=3

it doesn't work for me either, but check it out, maybe it's just me...

Re: shader to(single)textures (mulititex model) in [Re: broozar] #84114
08/14/06 19:54
08/14/06 19:54
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
ok, have to try

Re: shader to(single)textures (mulititex model) in [Re: Lion_Ts] #84115
08/14/06 21:30
08/14/06 21:30
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
No success . I have NVidia's video, win2000prof on intel P4. Waiting for a news from JCL...

Re: shader to(single)textures (mulititex model) in [Re: broozar] #321523
04/29/10 22:05
04/29/10 22:05
Joined: Apr 2010
Posts: 1
Germany
R
Render_Elf Offline
Guest
Render_Elf  Offline
Guest
R

Joined: Apr 2010
Posts: 1
Germany
Hi,
I'm quite new to Gamestudio & Lite-C, and I have the same problem:
A Med- Model with multiple textures. When I apply e.g. a chrome-effect, it messes up the entire model like in your case.
So, have you already tested a solution?

Thanks in advance!

BTW: I cannot imagine that it might be possible to create a realistic model having everywhere the same material applied (skin, clothes, weapons, armor...).

Page 2 of 3 1 2 3

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1