Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (tomaslolo), 1,542 guests, and 12 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 2 of 3 1 2 3
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 Offline OP
Senior Expert
ello  Offline 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.de
quoted: 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 Offline
Expert
frazzle  Offline
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: frazzle] #157767
09/30/07 21:44
09/30/07 21:44
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Thanks ello, much appreciated as its another much needed function.

Re: heightFog [Re: Orange Brat] #157768
09/30/07 21:48
09/30/07 21:48
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
great contribution! Thank you!


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: heightFog [Re: frazzle] #157769
10/01/07 06:15
10/01/07 06:15
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
glad you like it

frazzle, you are right, but in that case you'd need a shader for every object in your world.


www.earthcontrol.de
quoted: 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] #157770
10/01/07 18:33
10/01/07 18:33
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Quote:


frazzle, you are right, but in that case you'd need a shader for every object in your world.





Why would you need a shader for every object ??
Replacing x through y would only change the look like you already indicated but not the effect you wanted to created.
Btw, which shader would you apply to every object in world space ??

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: frazzle] #157771
10/01/07 18:48
10/01/07 18:48
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline OP
Senior Expert
ello  Offline OP
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
dunno, maybe i'm just misunderstanding you, but from how i understand you are talking about a fog which has more density for example on the right side? if thats what you are talking about than you would need to calculate that fog for every object.

if you just replace y by x in the shader you will not have the nice transition between the sky and the rest of the world


www.earthcontrol.de
quoted: 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] #157772
10/02/07 00:00
10/02/07 00:00
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Nice contribution, quite helpful.

Since it's about more or less the same effect, does anyone know how to achieve a nice 'underwater' look? I mean "demo scene"-style actually, loads of those demos have these particles and sort of blurs and fog that really make it feel as if in some sort of underwater/dreamy/spacey place. I haven't achieved anything quite like it with 3dgs yet, if someone has ideas... please tell hehehe,


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: heightFog [Re: Orange Brat] #157773
10/02/07 13:49
10/02/07 13:49
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
that is the best looking fog ive seen so far great job!

Re: heightFog [Re: ello] #157774
10/02/07 19:02
10/02/07 19:02
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
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
Page 2 of 3 1 2 3

Moderated by  adoado, checkbutton, mk_1, Perro 

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