Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, juanex, Grant), 1,018 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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 Offline OP
Expert
Joozey  Offline 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: Joozey] #199571
03/31/08 12:26
03/31/08 12:26
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
whats wrong with a shader? You could do that also ffp...
and btw I don't another good method wich would work

Re: Entity color -> from white to normal texture [Re: Scorpion] #199573
03/31/08 12:31
03/31/08 12:31
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline OP
Expert
Joozey  Offline OP
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Because a shader sounds fps-hungry and a workaround to me :P. In fact, I don't know what would be better; a script solution or shader solution, but if you recommend a shader (and maybe point me to one) then I would gladly accept it.

Thanx!


Click and join the 3dgs irc community!
Room: #3dgs
Re: Entity color -> from white to normal texture [Re: Joozey] #199593
03/31/08 14:23
03/31/08 14:23
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
every entity and also the levegeometry has a shader applied to it. It's not some spec-env-glow-combination-ultra shader, but a shader with texturelookup and not much more...

If you would be happy with a hlsl shader i can write you one in maybe 15 minutes...if you want it to be ffp, it can take a bit longer, because i never played around with it before

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 Offline OP
Expert
Joozey  Offline 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: Joozey] #199634
03/31/08 17:06
03/31/08 17:06
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
Every entity indeed has a shader or ffp effect applied, always. FFP effects are not necessarily slower than shaders. It depends on what's in the shader. Shaders do allow for more complex (and thus fps hungry) effects.

I don't think you even need a shader or ffp effect for this. The default materials already use the entity and material ambient/diffuse parameters, so you can just change those. Try incrementing the entity.ambient untill 100. If that doesn't make the entity entirely white, you should also increase the material ambient and maybe the diffuse too, but I don't think that's necessary.

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 Offline OP
Expert
Joozey  Offline 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 Offline
Serious User
Scorpion  Offline
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...
 Code:
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 Offline OP
Expert
Joozey  Offline OP
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Thanx for your input \:\)

 Code:
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
Re: Entity color -> from white to normal texture [Re: Joozey] #199919
04/01/08 18:26
04/01/08 18:26
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
could you post a screen what you mean?
the vertexshader is nothing special..yeah i think you can also remove it completly.
and the pixelshader just does a texturelookup and lerps it with white by the factor passed in vecSkill41. (so no shadows..just the normal texture...if you want shadows tell me)

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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