PDA

View Full Version : Don't you love the smell of musty fog in the morning?


Lil Killa
11-11-2003, 01:21 AM
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?

Business_Eskimo
11-11-2003, 01:35 AM
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 (http://www.shaderlab.com/q3map2/manual/foghull_guide.htm). [/B]

Lil Killa
11-11-2003, 01:40 AM
Thanks Eskimo :D

Lil Killa
11-11-2003, 02:59 AM
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?

GothiX
11-11-2003, 07:04 AM
You're missing a "}" at the end?

Lil Killa
11-11-2003, 04:43 PM
Amazing how something so simple can be overlooked :D

Thanks It doesn't screw everything else up anymore.. Now to test the fog itself..

RalKon
11-11-2003, 05:13 PM
a little extra resource for understanding shaders that I found a while back

http://qeradiant.com/manual/Q3AShader_Manual/

it reads like stereo instructions, but it does help a little

Lil Killa
11-11-2003, 05:20 PM
Thanks but I've known about that for Aa long time. The only thing is I don't understand 90% of it...

wedge2211
11-11-2003, 06:52 PM
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).

idontlikegeorge
11-12-2003, 01:54 AM
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?