Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

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

Page: 1 of 1
 Lil Killa
11-11-2003, 1:21 AM
#1
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, 1:35 AM
#2
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, 1:40 AM
#3
Thanks Eskimo :D
 Lil Killa
11-11-2003, 2:59 AM
#4
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, 7:04 AM
#5
You're missing a "}" at the end?
 Lil Killa
11-11-2003, 4:43 PM
#6
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, 5:13 PM
#7
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, 5:20 PM
#8
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, 6:52 PM
#9
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, 1:54 AM
#10
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?
Page: 1 of 1