Rendering For RTCW
Rendering For RTCW
------------------------------------------------------------------------------INSTALLATION
------------------------------------------------------------------------------For *nix:
1. This should be identical to installing ioq3. Check their README for more
details.
For Win32:
1. Have a Quake 3 install, fully patched.
2. Copy the following files into Quake 3's install directory:
ioquake3.x86.exe
renderer_opengl1_x86.dll
renderer_opengl2_x86.dll
These can be found in build/release-mingw32-x86 after compiling, or bug
someone to release binaries.
------------------------------------------------------------------------------RUNNING
------------------------------------------------------------------------------1. Start ioquake3. (ioquake3.x86.exe on Win32)
2. Open the console (default key ~) and type '/cl_renderer opengl2; vid_restart'
3. Enjoy.
------------------------------------------------------------------------------CVARS
------------------------------------------------------------------------------Cvars for simple rendering features:
r_ext_compressed_textures
- Automatically compress textures.
0 - No texture compression. (default)
1 - DXT/LATC texture compression if
supported.
2 - BPTC texture compression if supported.
r_ext_framebuffer_multisample - Multisample Anti-aliasing.
0
- None. (default)
1-16 - Some.
17+ - Too much!
r_ssao
r_softOverbright
r_cameraExposure
- Cheat.
-2 0 0.5 2 -
r_postProcess
- Enable post-processing.
0 - No.
1 - Yes. (default)
r_toneMap
r_forceToneMap
r_forceToneMapAvg
r_forceToneMapMin
r_autoExposure
r_forceAutoExposure
r_forceAutoExposureMin
r_forceAutoExposureMax
r_srgb
r_deluxeMapping
r_parallaxMapping
r_imageUpsampleType
r_genNormalMaps
r_forceSunMapLightScale
r_forceSunLightScale
r_forceSunAmbientScale
r_sunShadows
r_sunlightMode
g
maps.
r_shadowFilter
r_shadowMapSize
Cvars that you probably don't care about or shouldn't mess with:
r_mergeMultidraws
- Optimize number of calls to
glMultiDrawElements().
0 - Don't.
1 - Do some. (default)
2 - Do more than necessary (eats CPU).
r_mergeLeafSurfaces
- Merge
and a
0 1 -
r_recalcMD3Normals
r_depthPrepass
r_normalAmbient
r_mergeLightmaps
r_shadowCascadeZNear
r_shadowCascadeZFar
r_shadowCascadeZBias
r_pshadowDist
cg_shadows
------------------------------------------------------------------------------MATERIALS
------------------------------------------------------------------------------Rend2 supports .mtr files, which are basically the same as .shader files, and
are located in the same place, but override existing .shader files if they
exist. This is to allow maps and mods to use the new material features without
breaking the map when using the old renderer.
Here's an example of a material stored in one, showing off some new features:
textures/abandon/grass
{
qer_editorimage textures/abandon/grass.jpg
{
map textures/abandon/grass3_256_d.jpg
rgbgen identity
}
{
stage normalparallaxmap
map textures/abandon/grass3_1024_n.png
}
{
stage specularmap
map textures/abandon/grass3_256_s.png
specularReflectance 0.12
specularExponent 16
}
{
map $lightmap
blendfunc GL_DST_COLOR GL_ZERO
}
}
The first thing to notice is that this is basically the same as old Quake 3
shader files. The next thing to notice are the new keywords. Here is what
they mean:
stage <type>
- State how this imagemap will be used by Rend2:
diffuseMap
- Standard, same as no stage entry
normalMap
- Image will be used as a normal map
normalParallaxMap - Image will be used as a normal map with
alpha treated as height for parallax mapping
specularMap
- Image will be used as a specular map with
alpha treated as shininess.
specularReflectance <value>
- State how metallic this material is. Metals typically have a high
specular and a low diffuse, so this is typically high for them, and low
for other materials, such as plastic. For typical values for various
materials, see http://refractiveindex.info , pick a material, then scroll
down to the reflection calculator and look up its reflectance. Default
is 0.04, since most materials aren't metallic.
specularExponent <value>
- State how shiny this material is. Note that this is modulated by the
alpha channel of the specular map, so if it were set to 16, and the alpha
channel of the specular map was set to 0.5, then the shininess would be
set to 8. Default 256.
An important note is that normal and specular maps influence the diffuse map
declared before them, so materials like this are possible:
textures/terrain/grass
{
qer_editorimage textures/terrain/grass.jpg
{
map textures/terrain/rock.jpg
}
{
stage normalparallaxmap
map textures/terrain/rock_n.png
}
{
stage specularmap
map textures/terrain/rock_s.jpg
}
{
map textures/terrain/grass.jpg
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
}
{
stage normalparallaxmap
map textures/terrain/grass_n.png
}
{
stage specularmap
map textures/terrain/grass_s.png
specularReflectance 0.12
}
{
map $lightmap
blendfunc GL_DST_COLOR GL_ZERO
}
}
Though note due to the complexity of lighting, dynamic light (including
sunlight with cascaded shadow maps) currently only works 100% on materials like
this, where the second diffuse map doesn't have its own alpha, and only
uses vertex alpha. YMMV.
Another addition to materials is working normal/specular maps on vertex lit
surfaces. To enable this, make your material look like this:
textures/vehicles/car
{
qer_editorimage textures/vehicles/car.jpg
{
map textures/vehicles/car.jpg
rgbGen vertexLit
}
{
stage normalparallaxmap
map textures/vehicles/car_n.jpg
}
{
stage specularmap
map textures/vehicles/car_s.jpg
}
}
Note the new keyword, 'vertexLit' after rgbGen. This is analogous to
'rgbGen vertex', except a light direction will be determined from the lightgrid
and used with the normal and specular maps. 'exactVertexLit' exists as well,
and is the equivalent for 'exactVertex'.
------------------------------------------------------------------------------DYNAMIC SUNLIGHT AND CASCADED SHADOW MAPS
------------------------------------------------------------------------------This adds a new keyword to sky materials, q3gl2_sun. The syntax is: