Jump to content

Home

Don't you love the smell of musty fog in the morning?


Lil Killa

Recommended Posts

OK enought with the title biz...

 

I took a quick look at the big fog shader in a text documnet and have a few questions...

 

textures/fogs/yavin2

{

qer_editorimage textures/fogs/fog.tga

surfaceparm nonsolid

surfaceparm nonopaque

surfaceparm fog

fogparms ( 0.7 0.6 0.5 ) 3900.0

 

I want to know what the bold part does. I am guessing the numbers in ()'s are RGB values but what does the second number (3900.0) do?

Link to comment
Share on other sites

Originally posted by wedge2211

The line surfaceparm fog is what tells the game explicitly that this is a fog.

 

The line fogparms ( 0.4 0.4 0.4 ) 8192 is what does the real work in the fog shader. The numbers in parentheses are the RGB color values of the fog. The last number is the maximum distance (in game units) that players can see before the fog totally obscures their vision.

 

You can also map textures onto the surface of the fog to achieve an effect like the surface of water shaders. Look at one of the bespin fogs to see this done.

 

If you have this fog in your entire level, you can add the key/value distancecull 8192 to your worldspawn and nothing beyond the cutoff distance will be drawn in-game, saving your processor a little. For more on this, see the q3map2 foghull guide. [/b]

Link to comment
Share on other sites

OK I have a problem....

 

 

I made the following fog shader and It it messing up everything else when I out it in my shaders folder.

 

textures/cath/cathfog1

{

qer_editorimage textures/fogs/fog.tga

surfaceparm nonsolid

surfaceparm nonopaque

surfaceparm fog

fogparms ( 135.0 158.0 167.0 ) 1536.0

 

 

What am I doing wrong?

Link to comment
Share on other sites

It's much more readable if you're actually looking for something specific...like figuring out what tcmod turb does or the fogparms line you mentioned. But for most practical instruction in shader coding...it's better to look at codes that work and figure out how they do what they do (or just cannibalize their codes).

Link to comment
Share on other sites

Originally posted by Lil Killa

OK I have a problem....

 

 

I made the following fog shader and It it messing up everything else when I out it in my shaders folder.

 

textures/cath/cathfog1

{

qer_editorimage textures/fogs/fog.tga

surfaceparm nonsolid

surfaceparm nonopaque

surfaceparm fog

fogparms ( 135.0 158.0 167.0 ) 1536.0

 

 

What am I doing wrong?

 

 

I dunno if you fixed it or not, but most examples had the RGB settings "normalized" at 0.0 to 1.0. Perhaps that's giving yours trouble?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...