fog??


(gentix) #1

I have searched the forum about 3 hours and still dunno @#$@#$ what’s been said. Maybe people know the staligrad map. It’s pretty popular. I would like to have simular fog for a map wich I’m making right now. Please understand that I’m new to level design! What people say here can be jigberish. Maybe even hebrew or even worse… dutch


(Shaderman) #2

Search with the keyword “fog” and author “]UBC[ McNite” - I think he spent his half life on working fog things out :stuck_out_tongue:


(]UBC[ McNite) #3

LOL @ shaderman

Yea i messed around with fog a lot, but the result in TheRiver II Redux was worth it :smiley:

gentix, I just sent u a pm. Anyways i ll post the content in here cuz maybe other mappers like to read a bit about fog too:

Well I don’t have the stalingrad map on my comp anymore, but i can give you an idea of where to search for the clues: check the custom shader that comes with the map. If you find a fog shader in there, paste that one to your own shaderfile (and give a credit to the stalingrad mapper in your map-readme). If you don’t find a fog shader, then they probably used the one of Railgun, and you ll find that one in the shaders of ET somewhere (don’t know where it is cuz i wrote my own fog shader).

I m pretty sure its a worldspawn fog, so you will need to set the keys/values of farplanedist and fogclip in your worldspawn. (There is multivolume fog too, but looking at the level of mapping technique in stalingrad makes me doubt the mapper would use multivolume fog as its pretty difficult to handle.)
To find out which distance is the right one for your map, start with a value of about 2500 and then at first go in steps of 500 to see the difference. Finetuning can be done in steps of 100 units. You will need compiles with a VIS stage and a simple LIGHT stage for every change to make it work.

Be aware that fog will inevitable drop the FPS in your map by 10 to 15. So you need pretty good FPS to start with to afford fog.


(kamikazee) #4

[quote=]UBC[ McNite]Be aware that fog will inevitable drop the FPS in your map by 10 to 15. So you need pretty good FPS to start with to afford fog.[/quote]Don’t you get some FPS back when using farplanedist when there is no sufficient VIS blocking? (Terrain based maps for example)


(]UBC[ McNite) #5

Yes you get some back… but only when you have a close farplanedist and a real far view into your terrain without fog. Only I d say in that rare occasion the maplayout is already so bad your FPS are screwed up anyways. There should be proper VIS blocking first. Using fog hoping to actually improve FPS is definitely the wrong approach.
And you can’t say terrain based maps generally benefit from it because you can design terrain based maps with pretty efficient VIS blocking too (check TheRiver II Redux with r_showtris 2 for that). Its not the terrain that gives you the lot of tris (unless you REALLY screwed it up), its the tris that come with detailed buildings etc.

In RtCW there was a sort of fog (skyfog) that actually improved your FPS a whole lot. Only it doesn’t work with the blend stages used in ET eg. for the marks of artillery impacts, and thus its out of question.


(Jaquboss) #6

rewrite shaders for them! can you give some examples, that kind of fog sounds interesting…


(=PoW= Kernel 2.6.5) #7

So if I’m reading this all right…

There’s no way to just throw in some fog as an atmospheric effect like rain or snow?
There’s no worldspawn key/value pair?


(DAbell) #8

Kernel you can just add fog using a value in the worldspawn but it also needs a fog texture to use.

key for worldspawn is “_fog”

then the path to a fog shader like the radar one for example

textures/radar/fog 
{ 
   qer_editorimage textures/sfx/fog_grey1.tga 
    
   surfaceparm nodraw 
   surfaceparm nonsolid 
   surfaceparm trans 
   surfaceparm fog 
    
   fogparms ( 0.09411 0.09803 0.12549 ) 3192 
} 

Then you can also specify values for

“fogclip” - the distance at wihich the items are clipped from view (correct me if i’m wrong cause i think i might be)

and

“farplanedist” - the distance at which the fog is visible.

Battery only uses the _fog value to create its fog effect.

The following is a good thread about fog also.

http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=2844&highlight=battery+fog+fogclip

Hope this helps out a bit.

<DJ>


(=PoW= Kernel 2.6.5) #9

Thanks for the tip. It works.

If fact, it works too good.
There is fog everywhere including inside buildings and underground.
If I just want fog outside, do I have to use a brush and shader only?


(]UBC[ McNite) #10

If you add fog in the worldspawn, you get it everywhere. If you just want it outside, you need to do multivolume fog. Means: use large brushes in the outdoors area and make them fog with the needed shaders. Its tricky to make it look well though.


(=PoW= Kernel 2.6.5) #11

Thanks.

I also noticed a big difference in the results if you make a square brush, select it all (SHIFT+LMB) and click the fog texture
and if you select each face on the square (SHIFT+ALT+CTRL+LMB) and apply the fog texture that way.

Is one a “better” way that the other?


(DAbell) #12

Kernel

Yeah your right you do get fog absolutely everywhere, you can control it in some degree by increasing the farplanedist to such a point that you never have a long enough line of sight internally for the fog to have an effect.

If you imagine on Railgun the fog is well thick but inside the bunkers you don’t notice it because you never have a long enough distance internally that the fog could appear. What you could do is play with the values and try and get a compromise that works inside and out, or tweak your buildings slightly so you don’t have long lines of sight internally.

Good Luck.

<DJ>


(]UBC[ McNite) #13

Dabell, what Kernel is going for is multivolume fog, which is the only way to really get the fog out of the buildings i think, and it doesn’t need to bother with the distance settings for getting fog out of the buildings, because there is no fog in the buildings to begin with.

Kernel, I only messed with multivolume shortly, and I didnt notice any difference by the way the brushes are textured. The way you describe it, it doesnt make sense to me anyways… or don’t you texture all 6 sides of the brush then?
In the tutorial I had for multivolume fog it said, you have to re-write your fog shader between VIS and LIGHT stage. I found that that wasn’t true (anymore?) for q3map2 2.5.16 and the fogshaders I used. I also didn’t notice any mentionable difference between multivolume fog and worldspawn fog with regard to FPS. As i wasn’t bothered by the fog in my buildings (its barely noticeable and if so, adds atmosphere), I went for worldspawn fog which is much easier to handle (no brushes to adjust, obviously).

Maybe describe the difference you notice in detail?


(Diego) #14

I am using a volume fog in my map so I can have 2 different densities and colors of fog - one for the atmosphere, and a cooler thicker one for the water. Quite a pain. But I also didn’t want the fog shader to block out my sky so this was the only way I could think of to do that.

I did have lots of problems trying to use multiple brushes. So in the end, I just used 1 large brush for the atmosphere, and 1 large brush for the water. I also had to make the tops and bottoms of my atmosphere fog a nodraw texture because It was blocking out my lighting for some reason.

But everything is working and looking good for me.

Here’s a screen of the atmosphere. And Yes, it does make a big hit on FPS.

http://webpages.charter.net/dt3d/screenshots/et/07-praetoria.jpg


(Jaquboss) #15

omfg it looks awesome!


(]UBC[ McNite) #16

Looks nice. Where are the FPS by now?


(CooperHawkes) #17

indeed, it does!


(Shaderman) #18

Woaaaaaaaaaaaaaaaaaah great!

Would you mind posting a small box map with this fog?


(Diego) #19

This is a map that I’m building for my friends and I to play at work. Our systems are pretty high end, but the frame rate seems comparable to my home computer. The lowest frame rate I’ve seen with the current fog is 45 fps up to 300 fps, depending on where you are. But the lowest rate is more of the exception than the rule.

This is running at 1280x1024 resolution with all the settings maxxed out. Without the fog, my minimum is more like 60-85. Also, a portion of the FPS hit is all the custom textures. 99% of my textures are either custom made, or are modified textures from other sources and almost all are 512x512 or even higher in special cases - like the sky.

I haven’t really put a lot of work into the Vis and Hint brushes yet. But the map is so open in this section, I probably won’t be able to get much back with it. I wasn’t going to really worry too much about it. I haven’t decided yet if I will make a public release when it’s done. It will probably be around 50 mb and I know how much you guys hate large files and maps that are not playable on older systems.

Regarding a skybox with my shaders. I can probably do that this weekend. I don’t really have a lot of webspace, but I can leave it up for a little while. I’ll leave the water and fog shaders in there, too so you guys can see how I got the 2 different one’s working together. This is my first map for ET so tat took me a couple of weeks to figure out – along with just about everything else I’ve done.

:rocker2: