|
0 registered members (),
6,962
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Entity color -> from white to normal texture
#199561
03/31/08 11:03
03/31/08 11:03
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
OP
Expert
|
OP
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
I have an entity that needs to light up to bright white, and slowly turns to it's normal texture again (like a pokemon that starts to evolve :D). I have no clue where to start, and I don't want a whole shader doing this relative simple thing. Been busy altering the skin material settings in MED, and applying light and ambient at runtime, but nothing seems to get my model totaly white... Any idea to get me started? Thanx in advance
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: Entity color -> from white to normal texture
[Re: Scorpion]
#199597
03/31/08 14:36
03/31/08 14:36
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
OP
Expert
|
OP
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
Well I'm not too lazy to try a few hours myself, in fact I already started, but I have no proper results yet :P. If you could write me one (and have fun to do so) I would really appreciate it. It would serve as a nice example for making simple effects.
I believe that the fixed pipeline is faster and more basic than the hlsl shader so I have my preference to that one, but if you rather use hlsl then that's fine too :).
Last edited by Joozey; 03/31/08 14:37.
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: Entity color -> from white to normal texture
[Re: Excessus]
#199668
03/31/08 21:03
03/31/08 21:03
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
OP
Expert
|
OP
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
I first had to put diffuse at 0, then ambient and specular at around 50 (cookie for ChrisB). Not only in the material {}, but also in MED! The two wont override eachother, they each take a part in the model's lightning :|. I still haven't entirely figured out what the right combination is (also what to increase or decrease when fading from white to normal texture).
It's quite annoying that MED's skin settings screws it up this way. I can't change skin on an entity either when I have not applied the very first texture to the model.
Last edited by Joozey; 03/31/08 21:04.
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
Re: Entity color -> from white to normal texture
[Re: Joozey]
#199802
04/01/08 12:16
04/01/08 12:16
|
Joined: Jan 2007
Posts: 1,619 Germany
Scorpion
Serious User
|
Serious User
Joined: Jan 2007
Posts: 1,619
Germany
|
I'm sorry but the forum was down yesterday again (at least for me :P ) here is the shader I wrote... float4x4 matWorldViewProj;
float vecSkill41;
float4 fadeColor = {1.0f,1.0f,1.0f,1.0f};
texture entSkin1;
sampler2D colorMap = samplerstate {Texture=<entSkin1>;};
void fadeVS( in float4 pos :TEXCOORD0,
in float2 tex :TEXCOORD1,
out float4 oPos :POSITION,
out float2 oTex :TEXCOORD0)
{
oPos = mul(pos,matWorldViewProj);
oTex = tex;
}
float4 fadePS(in float2 texcrd :TEXCOORD0):COLOR
{
return lerp(tex2D(colorMap,texcrd),fadeColor,vecSkill41);
}
technqie fade
{
pass p0
{
pixelshader = compile ps_1_0 fadeVS();
}
}(did not tested it yet...you have to change sill41 for the ammount of white-ness)
|
|
|
Re: Entity color -> from white to normal texture
[Re: Scorpion]
#199910
04/01/08 17:36
04/01/08 17:36
|
Joined: Oct 2004
Posts: 4,134 Netherlands
Joozey
OP
Expert
|
OP
Expert
Joined: Oct 2004
Posts: 4,134
Netherlands
|
Thanx for your input  float4x4 matWorldViewProj;
float vecSkill41;
float4 fadeColor = {1.0f,1.0f,1.0f,1.0f};
texture entSkin1;
sampler2D colorMap = sampler_state {Texture=<entSkin1>;};
void fadeVS( in float4 pos :TEXCOORD0,
in float2 tex :TEXCOORD1,
out float4 oPos :POSITION,
out float2 oTex :TEXCOORD0)
{
oPos = mul(pos,matWorldViewProj);
oTex = tex;
}
float4 fadePS(in float2 texcrd :TEXCOORD0):COLOR
{
return lerp(tex2D(colorMap,texcrd),fadeColor,vecSkill41);
}
technique fade
{
pass p0
{
vertexshader = compile vs_1_1 fadeVS();
pixelshader = compile ps_1_1 fadePS();
}
}I removed the errors till I had a working script, but the vertex shader is messed up. Pixel shader shows my entities without shadows and anything, which is good. Now it only needs to be white. But this vertex shader only shows one little piece of my entities, very small. Do I need a vertex shader at all? If I multiply a white texture over the current entity and by a dynamic factor, then wouldn't I get proper results?
Last edited by Joozey; 04/01/08 17:39.
Click and join the 3dgs irc community! Room: #3dgs
|
|
|
|