Difference between revisions of "Css"

From Custom Map Makers Wiki
Jump to: navigation, search
(Created page with "== CSS == CSS is an experimental modification of q3map2 2.5.17 map compiler. It allows to selectively strip drawSurfaces from the bsp generated by q3map2. ...")
 
(Success Stories)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== CSS ==
 
== CSS ==
CSS is an experimental modification of [[Compiling:q3map2 | q3map2]] 2.5.17 map compiler. It allows to selectively strip drawSurfaces from the bsp generated by q3map2. CSS introduces a new shader surfaceparm directive called "strip". This directive instructs the q3map2 modified compiler to remove any surface textured with "strip" shaders from the bsp after the light stage.
+
CSS is an experimental modification of [[Compiling:q3map2 | q3map2]] 2.5.16 map compiler. It allows to selectively strip drawSurfaces from the bsp generated by q3map2. CSS introduces a new shader surfaceparm directive called "strip". This directive instructs the q3map2 modified compiler to remove any surface textured with "strip" shaders from the bsp after the light stage.
  
 
{{Warning|Don't blame the tool if you waste hours of compilation for a broken bsp}}
 
{{Warning|Don't blame the tool if you waste hours of compilation for a broken bsp}}
Line 22: Line 22:
 
     }
 
     }
  
Considering lights in Urbanterror are computed at compile time, surface painted with this shader have no effect ingame. With the addition of the surfaceparm strip, CSS can remove surface using this shader from the bsp generated by q3map in order to improve ingame performance (see test case below)
+
Considering lights in Urbanterror are computed at compile time, surface painted with this shader have no effect ingame. With the addition of the '''surfaceparm strip''' directive, CSS can remove surface using this shader from the bsp generated by q3map in order to improve ingame performance (see test case below)
  
 
=== Internals ===
 
=== Internals ===
Line 28: Line 28:
  
 
=== Installation ===
 
=== Installation ===
Download CSS. CSS is provided as a single patch file.
+
Download CSS. CSS is provided as a single patch file for q3map2 2.5.16 source (CSS modifies 2 files, eg, game_quake3.h and light.c).
  
 
Place the downloaded file in your q3map2 source directory "tools/quake3/q3map2/"
 
Place the downloaded file in your q3map2 source directory "tools/quake3/q3map2/"
Line 42: Line 42:
 
=== Usage ===
 
=== Usage ===
  
Add the surfaceparm strip directive to shader to strip out of the bsp.
+
Add the '''surfaceparm strip''' directive to shader to strip out of the bsp. Beware, stripping structural or visible surfaces may hold unexpected results.
  
Compile the bsp and vis stage as usual. Add the "-strip" options for the light stage of your compilation:
+
Compile the bsp and vis stage as usual. Add the '''-strip''' options for the light stage of your compilation:
  
 
     q3map2 -threads X ... -light ... -strip path/to/map.bsp
 
     q3map2 -threads X ... -light ... -strip path/to/map.bsp
  
== Success Stories ==
+
== Maps compiled with CSS ==
  
The CSS modification has been used for the creation of various maps:
+
* '''Azurea'''. ut4_azurea_a1 is a jump map and the main motivation for CSS.
  
=== ut4_azurea_a1 ===
+
[[Category:Compiling]]
 
 
This project is the main motivation for the creation of CSS.
 
 
 
screenshots etc
 

Latest revision as of 14:45, 6 January 2012

CSS

CSS is an experimental modification of q3map2 2.5.16 map compiler. It allows to selectively strip drawSurfaces from the bsp generated by q3map2. CSS introduces a new shader surfaceparm directive called "strip". This directive instructs the q3map2 modified compiler to remove any surface textured with "strip" shaders from the bsp after the light stage.

Error.png Don't blame the tool if you waste hours of compilation for a broken bsp


Use Case

An interesting application of CSS is for maps that use invisible, non solid, light emitting shaders like the one below (the stage defines a fully transparent surface):

   textures/mytextures/light_white_1k
   {
     q3map_lightRGB 1.0 1.0 1.0
     q3map_surfacelight 1000
     
     surfaceparm nolightmap
     surfaceparm nonsolid
     surfaceparm trans
     {
       map $whiteimage
       alphaFunc GE128
       alphaGen const 0
     }
   }

Considering lights in Urbanterror are computed at compile time, surface painted with this shader have no effect ingame. With the addition of the surfaceparm strip directive, CSS can remove surface using this shader from the bsp generated by q3map in order to improve ingame performance (see test case below)

Internals

As of today, CSS does not remove the surface definitions from bsp files, It only invalidates references to stripped surfaces from the leaf nodes of the bsp trees.

Installation

Download CSS. CSS is provided as a single patch file for q3map2 2.5.16 source (CSS modifies 2 files, eg, game_quake3.h and light.c).

Place the downloaded file in your q3map2 source directory "tools/quake3/q3map2/"

Apply the patch to your q3map2 source using the patch command line tool (screw you windows' users)

   patch -p0 css.patch

Recompile q3map2 (from the root directory of the source tree):

   scons target=q3map2

Usage

Add the surfaceparm strip directive to shader to strip out of the bsp. Beware, stripping structural or visible surfaces may hold unexpected results.

Compile the bsp and vis stage as usual. Add the -strip options for the light stage of your compilation:

   q3map2 -threads X ... -light ... -strip path/to/map.bsp

Maps compiled with CSS

  • Azurea. ut4_azurea_a1 is a jump map and the main motivation for CSS.