1 registered members (tomaslolo),
1,542
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: heightFog
[Re: Orange Brat]
#157765
09/30/07 18:55
09/30/07 18:55
|
Joined: Oct 2002
Posts: 8,939 planet.earth
ello
OP
Senior Expert
|
OP
Senior Expert
Joined: Oct 2002
Posts: 8,939
planet.earth
|
thanks for your comments! ok,here you go with the scalable version: Code:
material mtl_himmel { effect = "himmel.fx"; }
somewhere else you set or change the variables (or fade those values in functions and create various fog): Code:
mtl_himmel.skill1 = float(50); //vertical offset mtl_himmel.skill2 = float(1500); //fading scale mtl_himmel.skill3 = float(0.25); //density
and here is the new fx-file: Code:
float4x4 matWorldViewProj;
float4 vecFog; float4 vecSkill1;
struct VS_IN { float4 position : POSITION; float2 texCoord : TEXCOORD0; };
struct VS_OUT { float4 position : POSITION; float2 texCoord : TEXCOORD0; float Fog : FOG; };
VS_OUT mainVS (VS_IN In) { VS_OUT Out; Out.position = mul(In.position,matWorldViewProj); Out.Fog = ((In.position.y-vecSkill1.x)/vecSkill1.y)-vecSkill1.z; Out.texCoord = In.texCoord; return Out; }
texture entSkin1;
sampler basemap = sampler_state { Texture = <entSkin1>; MipFilter = LINEAR; MinFilter = LINEAR; MagFilter = LINEAR; AddressU = Wrap; Addressv = Wrap; };
float4 mainPS (VS_OUT In) : COLOR0 { return tex2D(basemap,In.texCoord); }
technique heightFog { pass p0 { VertexShader = compile vs_1_1 mainVS(); PixelShader = compile ps_1_1 mainPS(); } }
www.earthcontrol.dequoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
|
|
|
Re: heightFog
[Re: ello]
#157766
09/30/07 20:17
09/30/07 20:17
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
Great, I'll play around with it About the horizontical question, fog can fade in that direction, I guess it depends from situation to situation Thanks again for the effort !! Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: heightFog
[Re: ello]
#157774
10/02/07 19:02
10/02/07 19:02
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
@ ello: True but I already tried replacing y through x and the result is indeed a different look but it still looks quite normal compared to the average fog look but the transition would look indeed abit weird. About the density, I guess you don't need to create it that realistic, most of time you won't notice it anyway Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
|