Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 71 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Tutorials

»
SOF2 Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Distance Culling
Versions: You must be logged in to view history.
Limiting the players viewable distance in a map.
distance culling, by Shoot

Thanks to Shoot for the work put into this tutorial.

----------------
Distance Culling
----------------


The distance in units that the game/video engine will draw polys (Map Structure). Used to limit how far away things are drawn, this can greatly reduce the amount of visual complexity in a map, especially for o­ne that is full of polys, objects, effects, and items. This speeds up game play and makes the "BIG" or "Complex" map playable.

Ok so thats the advantage - what about the disadvantage..... Distance Culling o­nly allows you to see so far - items beyond the culling distance are well.....ummmm...culled or not drawn.
If you were to stand in a map looking forward and walk backwards and forward - in a map with distance culling you would see polys (ie roof tops, walls, roads, trees, models, objects, any map object except the sky) blink in and out of view as these objects passed in and out of the viewable distance.

How to hide this....3 ways

1. Build a smaller map!!!!

2. Build your map so players can never see beyond the culling distance - do this with building placement, higher walls, break up long view alleys, keep the height that the player can get to low - if they can get up high they can see farther.
3. Use a fog that is designed to hide the culling point.
4. Use fog and Build your map so players dont see the entire map beyond the culling distance in portions of the map.

*** 1 Unless the map is just simply huge this is out of the questionin my opinion!!!!

*** #2 is a good way but each mapper will have to learn how to do this in his or own way as it depends upon the mapper - it also depends upon the theme of the map - indoors, outdoors, urban, nature.... you get the drift.

*** #3 Fog - Good method - sometimes the o­nly way

*** #4 Fog and #2 - The way I recomend

************ Using Distance Culling *************
Add this to worldspawn:

Key: distancecull
Value: 3100 (this is user defined and map dependent, this value comes from mp_chk_justice)

What value to set - To be honest I can't tell you, it depends upon the map, depends upon how graphically intense the map is. I would recomend using from 2500 to 4500 units - depending upon the size of your map - anything less than that probably isnt worth using distance culling. Build the map and see what your framerates are when you look across long distances before setting this key up, see what happens, use the developers mode and look at tris levels and map speed before deciding.


---------------
Worldspawn Fog
---------------


This is achieved thru setting a worldspawn key to the a fog texture - This can be either a raven stock fog or a custom fog. I will be showing a custom fog for this tutorial. The fog you wish to use is o­ne that masks the culling point in a dense fog - where the objects fade into the fog before they would blink out due to being culled.

This is dependent upon serveral variables and you will have to play with the fog settings or try different fogs to get the right o­ne - it is dependent upon map light sources, the sun settings from the sky, the color of the fog and any ambient light you map may have. These things make it difficult to exactly pick your fog target. All I can say is play around.....

Fog Shader - there are different fogs throughout the raven stock pk3 files - they are in different texture folders as well as in the fog.shader file - open this file and take a peek.

************ Using Worldspawn Fog *************
Add this to worldspawn:

Key: fog
value: textures/chk/chkfog (this is the virtual path to your fog texture)

In order to see the fog in its full functioning form you will need to do a full compile.

---------------
Fog Shaders - how they work
---------------

What makes up a fog shader file - this is the fog that was used in mp_chk_justice, lets break it down a bit and explain what is happening.


textures/chk/chkfog
{
qer_editorimage textures/tools/editor_images/qer_fogblack
surfaceparm nonsolid
surfaceparm fog
fogparms ( 0.07 0.07 0.1 ) 4500
}

textures/chk/chkfog
*This line sets the name and path for the texture - this is the folder it will show up in in radiant and the name it will show up under - in actuality there is no texture called chkfog - the shader file creates the texture virtually because of the settings below.

{
*Opening Bracket - This is absolutely necessary - no bracket - error and crash the game or radiant

qer_editorimage textures/tools/editor_images/qer_fogblack
* This is what image will show up under in radiant when you load the texture folder that your fog is in.

surfaceparm nonsolid
* This is a surfaceparameter for the fog - it tells the game and compile engine that the fog is nonsolid and you can walk thru it

surfaceparm fog
* This is a second surfaceparameter and it tells the game and compile engine that this texture is fog and to apply the fogparms to it from the line below. Tells it its fog - look like the fogparms.

fogparms ( 0.07 0.07 0.1 ) 4500
* The numbers in the fogparms are actually very simple - the 3 sets of numbers in the ( ) is the color of the fog and the final number is how thick the fog is - based o­n the distance units that can be seen. The RGB numbers or color is in a ratio format -where 1 1 1 is pure white and has an rgb of 255 255 255 - gray would be 128 128 128 or (.5 .5 .5)

}
* Closing Bracket - every opening bracket must have a closing bracket - no brackets - error and crash the game or radiant

This is the line format that the fog is made of.
fogparms ( R B G ) Thickness

That makes up the fog shader for the most part -you also need to place your custom shader in the shaders folder in the pk3.

********** Other Fog Settings *******************
These are some of the fogparms settings that are in raven stock maps that you can compare to what you want by going to an actual map with these fog settings.

//
//kam/haze_fog1 fogparms ( 0.35 0.3 0.25 ) 3800.0 // slight hazy fog for kachatka indoor cave sections
//pra1 - fogparms ( 0.16 0.16 0.11 ) 1900.0
//pra2 - fogparms ( 0.16 0.16 0.11 ) 2500.0
//pra3 - fogparms ( 0.1 0.19 0.2 ) 3500.0
//dm_pra1 - fogparms ( 0.015 0.02 0.03 ) 1000.0
//airport light fog - fogparms ( 0.5 0.5 0.53 ) 14000.0
//airport dirt fog - fogparms ( 0.9 0.85 0.8 ) 30000.0
//ar_fog_city fogparms ( 0.7 0.66 0.61 ) 2000.0
//ar_fog_desert_day fogparms ( 0.75 0.65 0.52 ) 5000.0
//ar_fog_desert_night fogparms ( 0.05 0.05 0.07 ) 5000.0
//ar_fog_jungle_morning fogparms ( 0.7 0.7 0.7 ) 4300.0
//ar_fog_jungle_day fogparms ( 0.75 0.75 0.66 ) 4800.0
//ar_fog_jungle_night fogparms ( 0.07 0.07 0.1 ) 4300.0
//ar_fog_grassyhills_day fogparms ( 0.7 0.66 0.61 ) 5000.0
//ar_fog_grassyhills_night fogparms ( 0.07 0.07 0.1 ) 5000.0
//ar_fog_snowy_day fogparms ( 0.5 0.5 0.57 ) 5000.0
//ar_fog_snowy_night fogparms ( 0.05 0.05 0.07 ) 5000.0
//ar_fog_none fogparms ( 0 0 0 ) 0.0
//finca3_fog fogparms ( 0.5 0.35 0.1 ) 6000.0
//finca4_fog fogparms ( 0.5 0.35 0.1 ) 10000.0
//
//fogs shader fogs
//sandstorm fogparms ( 0.7 0.6 0.5 ) 6500.0
//armorynight fogparms ( 0.05 0.05 0.06 ) 2500.0
//col3 fogparms ( 0.28 0.23 0.18 ) 3500.0
//col4 fogparms ( 0.28 0.29 0.26 ) 3500.0
//jor7 fogparms ( 0.7 0.6 0.5 ) 3900.0
//col1 fogparms ( 0.5 0.47 0.4 ) 8500.0
//col6 fogparms ( 0.35 0.36 0.36 ) 2000.0
//col9 fogparms ( 0.5 0.47 0.4 ) 9000.0
//sandstorm2 fogparms ( 0.7 0.6 0.5 ) 4000.0
//jor1 fogparms ( 0.7 0.6 0.5 ) 9000.0
//col8 fogparms ( 0.35 0.36 0.36 ) 1500.0
//col7 fogparms ( 0.35 0.36 0.36 ) 1000.0
//dm_col1 fogparms ( 0.35 0.36 0.36 ) 3072.0
//pra5 fogparms ( 0.05 0.05 0.08 ) 6500.0
//haze_fog1 fogparms ( 0.35 0.3 0.25 ) 3800.0
//hk1_waterfog fogparms ( 0.17 0.2 0.18 ) 2210.0
//hos1_fog fogparms ( 0.1 0.1 0.12 ) 5000.0
//hos3_fog fogparms ( 0.5 0.64 0.6 ) 9000.0
//hos3_brushfog fogparms ( 0.3 0.44 0.4 ) 12000.0
//hos4_fog fogparms ( 0.05 0.05 0.065 ) 9000.0

--------------------------

Have Fun Fogging
Shoot....Out

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»