... problem with fog


(Cambodunum) #1

… when i add fog into my map - fps are going down immediatly
… so im wondering if there is any solution to keep steady fps
… ive used the entity _fog (including the radar-shader/texture)

… any help is welcome, cuz without fog my map doesnt get the right ambient

thx in advance
greetz Cambo


(Yatta) #2

I dont know much about fog, except thats theres two kind :

  • The regular “far-clip” fog, seen in most map,
  • The volumetric fog, almost never seen because it kills framerate.

I assume you’re using the wrong kind of fog.

To use a “normal” fog, i think you have to set it in your sky shader - im not so sure about it tough.

heres the info I found :

fogparms <red value> <green value> <blue value> <distance to Opaque>
Note: you must also specify “surfaceparm fog” to cause q3map to identify the surfaces inside the volume. Fogparms only describes how to render the fog on the surfaces.

<red value> <green value> <blue value> These are normalized values. A good computer art program should give you the RGB values for a color. To obtain the values that define fog color for Quake III Arena , divide the desired color’s Red, Green and Blue values by 255 to obtain three normalized numbers within the 0.0 to 1.0 range.

<distance to opaque> This is the distance, in game units, until the fog becomes totally opaque, as measured from the point of view of the observer. By making the height of the fog brush shorter than the distance to opaque , the apparent density of the fog can be reduced (because it never reaches the depth at which full opacity occurs)…

The fog volume can only have one surface visible (from outside the fog).
Fog must be made of one brush. It cannot be made of adjacent brushes.
Fog brushes must be axial. This means that only square or rectangular brushes may contain fog, and those must have their edges drawn along the axes of the map grid (all 90 degree angles).


(CyburK) #3

you have to set the _fog key in your worldspawn to the fog texture you wanna use.
for example

this is the shader



textures/meinetex/ind_fog
{
	qer_editorimage textures/sfx/fog_grey1.tga
	
	surfaceparm nodraw
	surfaceparm nonsolid
	surfaceparm trans
	surfaceparm fog
	
	fogparms ( 0.4 0.4 0.4 ) 4100
}

 

and this is how it looks in your worldspawn



key: _fog
value: textures/meinetex/ind_fog

 

first 3 numbers define the fog color the last one the distance you can see.
i noticed the fog clipping is only helpful when set not too far.

greetings
cyburk


(Cambodunum) #4

To use a “normal” fog, i think you have to set it in your sky shader - im not so sure about it tough.

Damn … its currently not working for me. It seems i have to study some tutorials. I’ve added surfaceparm fog and fogparms ( 0.x 0.x 0.x ) xxxx to my skyshader. But there is no fog shown yet.

you have to set the _fog key in your worldspawn to the fog texture you wanna use.
for example

I’ve done it like this … but i think distance is killing my fps, cuz i need “dust” in every single room without the “opaque”.


(Avoc) #5

I am sorry to ‘steal’ this topic, but it is somewhat related. Is it possible to exclude certain elements from the fog? For example, I have a sky that I would like to keep visible, but I also want to add fog. Is it possible to exclude the sky from the fog?


(Avoc) #6

Nevermind, just needs a ‘nofog’ in the shader!