Quake3World.com Forums
     Level Editing & Modeling
        Levelwide fog and dist culling with _foghull & _farplanedist


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: Levelwide fog and dist culling with _foghull & _farplanedist

Commander
Commander
Joined: 27 Apr 2009
Posts: 102
PostPosted: 09-15-2010 11:38 PM           Profile Send private message  E-mail  Edit post Reply with quote


Does anyone have an example of this in a map?
I've set everything up correctly as far as I can see, but obviously not..

_farplanedist works fine but _foghull doesn't fill the map with fog it only leaves where the skybox brushes are with the solid color of what the fog color should be

I could make my map into a box then add one huge fog brush inside the map to do it but then that would be wasted space. and truely something a noob would do :x



_________________
Image


Top
                 

Insane Quaker
Insane Quaker
Joined: 28 Jan 2010
Posts: 308
PostPosted: 09-16-2010 01:37 AM           Profile Send private message  E-mail  Edit post Reply with quote


Yes I flirted with this idea, but it doesn't work. Because - originally intended idea, that nothing farest than eg. 512 units will not be drawn doesnt work and also I didn't realize how to use the right fog shader... Maybe I' too stupid, but I really do not know how to make this technology working.




Top
                 

Mercenary
Mercenary
Joined: 24 Mar 2008
Posts: 223
PostPosted: 09-16-2010 06:39 AM           Profile Send private message  E-mail  Edit post Reply with quote


I have one test map using it. This is the setup (the map is just a skybox with a terrain model inside, so there's no use in uploading it).

At worldspawn:

_foghull skybox/skyfogged1
farplanedist 8000

Skybox brushes shader: textures/skybox/skyfogged1

A fog brush containing all the map, with shader: textures/skybox/skyfogged1_fog

shaders:

textures/skybox/skyfogged1
{
qer_editorimage env/skyfogged1/hull_pz.tga
surfaceparm nomarks
surfaceparm noimpact
surfaceparm nolightmap
surfaceparm sky
q3map_sun .9 .9 .9 275 130 35
q3map_lightimage textures/colors/white.tga
q3map_surfacelight 50

skyParms env/skyfogged1/hull 256 -
}

textures/skybox/skyfogged1_fog
{
qer_editorimage textures/colors/white.tga

surfaceparm fog
surfaceparm nodraw
surfaceparm nonsolid
surfaceparm trans
surfaceparm nolightmap
qer_nocarve

fogparms ( 0.5 0.5 0.5 ) 7000
}

Notice1: The _fogull command at worldspawn asumes the root is "textures", so you don't have to write the "textures/" bit in the path. This was the hardest part of making it work for me ;)

Notice2: The _foghull shader has to be of the fog color. It's the background. A flat color one is the easiest for getting it working, although you can add some details at the top of the skybox if you do it carefully.

Notice3: The _foghull and map's skybox shaders are the same. In q3 this condition is not a must and it will just use the _foghull shader. In Warsow they need to be the same.

Notice4: Enemy Territory sets this up completely different. In case you found ET tutorials at google, ignore them, they won't work (happened to me).

Notice5: These are Warsow shaders, but they *should* be working just fine at Q3.




Last edited by jal_ on 09-16-2010 07:42 AM, edited 4 times in total.

Top
                 

Insane Quaker
Insane Quaker
Joined: 08 Jan 2008
Posts: 270
PostPosted: 09-16-2010 06:44 AM           Profile Send private message  E-mail  Edit post Reply with quote


Why to use at all _foghul at worldspawn if you have brush fog there? Is'n it useless then? Or rather, isn't it suppose to be that you don't need the fog-brush when using the _foghul?



_________________
http://shadowsdomain.wordpress.com/


Top
                 

Mercenary
Mercenary
Joined: 24 Mar 2008
Posts: 223
PostPosted: 09-16-2010 06:47 AM           Profile Send private message  E-mail  Edit post Reply with quote


Shadow, because farplanedist cuts the view (skybox included) and the fog isn't there if no polygon is drawn. The foghull is just a skybox that is put there when farplanedist acts. It's a bit confusing (ET does it simpler), but this is the way it works here.




Last edited by jal_ on 09-17-2010 02:01 AM, edited 1 time in total.

Top
                 

I'm the dude!
I'm the dude!
Joined: 04 Feb 2002
Posts: 12498
PostPosted: 09-16-2010 07:18 AM           Profile Send private message  E-mail  Edit post Reply with quote


The worldspawn _farplanedist key acts like a giant box boundary that follows the player around, cropping any map geometry from rendering beyond its dimensions. Simply cropping stuff off from the renderer results in HoM ("hall of mirrors") effect since nothing is being drawn in the frame buffer. You also have a problem with geometry appearing and disappearing as the player moves around. We need to hide these two artifacts.

To hide HoM, we need to create a skybox to render in lieu of the empty pixels. To blend in perfectly this needs to be the same colour as the fog. You point the _foghull key to the skybox shader so that it renders the skybox shader to the frame buffer.

To hide geometry cropping, we use a normal dense fog to hide the boundaries. The fog needs to be opaque enough that you don't actually see the foghull box.

http://robotrenegade.com/q3map2/docs/sh ... ghull.html



_________________
GtkRadiant | Q3Map2 | Shader Manual


Top
                 

Commander
Commander
Joined: 27 Apr 2009
Posts: 102
PostPosted: 09-16-2010 03:12 PM           Profile Send private message  E-mail  Edit post Reply with quote


works like a charm now, I was pointing _foghull to my fog shader



_________________
Image


Top
                 
Quake3World.com | Forum Index | Level Editing & Modeling


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.