Environmental fog problem


(Danyboy) #1

Making beach map -

using battery sky and the battery fog values - 8192 fogparm and fogclip and farplanedist

I get this - its the skybox being culled - or similar - not entirely sure what it is and how to cure it

Image is a little dark but you can see the skybox corner easily - though from peripheral vision the corner fades away - am thinking i should increase my farplanedist + fogclip values.


(DeAtHmAsTeR) #2

have you used ambient lighting
?


(Danyboy) #3

nope


(DeAtHmAsTeR) #4

goto the worldspawn entity (click N and then scroll down to worldspawn) and then enter

 
Key - Ambient
Value - 10

if the problem persists then put the number up, but dont do it over about 15.

Ambient lighting is just lighting all around the world, and saves you putting light entities every where. very useful and used in every map :slight_smile:


(sock) #5

Try increasing the size of your map so the fog starts before the edges of the map or decrease the farplane distance so the fog is closer to the player.

Sock
:moo: +grass


(Danyboy) #6

Erm - when u say “fog starts before the edges of your map” - do you mean total opaqueness of fog?

What values did you use for battery’s env fog?


(DeAtHmAsTeR) #7

he means - make your mapcoordsmins and mapcoordsmaxs bigger (make them bigger by about 100,remember to keep them square) and then generate the tracemap, that should do it :slight_smile:


(Danyboy) #8

er - i increased mapcoords in worldspawn made no diff.

tried to make tracemap - went into developer mode and got this printed out a zillion times:

CVAR_Set2: cl_guid 7EC…

erm never hads probs with going into developer mode b4 - what i done wrong now?


(Thej) #9

no, he means make the size of ur map bigger, or change the fogparm to a lesser number, like 2000 instead of 8192


(sock) #10

Battery uses a worldspawn key called “_fog” pointing at a shader in the scripts directory as follows:

textures/skies/sd_batteryfog
{
	qer_editorimage textures/sfx/fog_grey1.tga
	
	surfaceparm nodraw
	surfaceparm nonsolid
	surfaceparm trans
	surfaceparm fog
	
	fogparms ( 0.4 0.4 0.4 ) 8192
}

The shader specifies at what distance the fog will become solid and triangle culling happens. If you load (devmap) the map Battery, turn on r_showtris and look out to sea you will see that the map is so big that you cannot see the edge of the map. The sea extends 8192 map units before the skybox brush starts. This is so the fog can become solid gradually and not be interrupted by the skybox.

The map Railgun uses a slightly different approach to Battery but essentially does the same thing. There is no skybox brushes in the map just a very dense fog which becomes solid before you see the skybox. The map still uses a worldspawn key of “_fog” as follows:

textures/mp_railgun/fog
{
	qer_editorimage textures/sfx/fog_grey1.tga
	fogparms ( 0.6 0.6 0.6 ) 2560
	surfaceparm fog
	surfaceparm nodraw
	surfaceparm nonsolid
	surfaceparm trans
}

The fog is much thicker and reaches a solid state in less map units. So the edges of the map don’t need to extend so far away from the playing areas.

Sock
:moo: +grass


(sock) #11

It is pointless suggesting solutions if you dont understand the question.

Sock
:moo:


(Danyboy) #12

yeah i understand the _fog worldspawn key - my main problem is the skybox conflicting with the fog.

I currently have my sea extending around 6000 units - so ill make it larger -

I’m not sure if this will help with the problem im getting since my map is around 12,000 units long - i get that corner skybox shadow when looking from 1 edge to the farthest.

Im guessing you’ve never had this problem before :frowning:

Also any ideas why me setting /developer 1 prints out the same cvar message over and over again?

cheers for all help


(sock) #13

First create a test map with the skybox you want and check if you can see the corner effect like in your first screenshot. If yes then check your shader is correct, because in a simple test map it should look fine. Also check that the original ET maps look fine on your graphics card.

Second then add just the “_fog” key to your worldspawn ONLY. Check to see if this works fine without all the other fog parameters. When you are testing things try to test them one at a time. (btw, battery only uses _fog shader not all the other parameters you have specified)

The most important question is … Does it produce a tracemap ok?

Sock
:moo: herding


(Thej) #14

yeh i have the same with the developer bit, i also get that string of things.

But for some reason when i do tracemap, it only traces the parts i have above groundcause when i look at the tga it creates in all the channels i only get the parts that are on top of the terrain, dunno if thats supposed to be like that though


(sock) #15

Why would you want it to rain/snow underground ?!? :wink:

Sock
:moo:


(Thej) #16

hehehehe, well i was planning to use the tracemap for all the underground bits for the command map :smiley:


(sock) #17

Yep I know your problem. For some of the maps we created a special underground version of all the buildings/tunnels/caves and then merged the “underground” tracemap in with the top down version to create a more complete command map. Something to do at the end of your project, otherwise you will be forever updating several maps.

Sock
:moo: power


(Thej) #18

Hey thx for the great tip Sock :moo:


(Danyboy) #19

yeah was in middle of testing what it was

default sky works - its the sky shader from battery map - :stuck_out_tongue:

works fine on its own

didnt know u could remove the other distances in worldspawn - thought they were compulsory

EDITED POST - doh - it correct now


(DeAtHmAsTeR) #20

It is pointless suggesting solutions if you dont understand the question.

Sock
:moo:[/quote]

making the map bigger in game - increasing mapcoordsmins and mapcoordsmaxs even though bits cant be seen - i had the problem where the edge of my maps didn’t snow - and i increased the maxs and mins and it worked