Rend2 Rend2 is an alternate renderer for ioquake3. It aims to implement modern features and technologies into the id tech 3 engine, but without sacrificing compatibility with existing Quake 3 mods. ------------------------------------------------------------------------------- FEATURES ------------------------------------------------------------------------------- - Compatible with most vanilla Quake 3 mods. - HDR Rendering, and support for HDR lightmaps - Tone mapping and auto-exposure. - Cascaded shadow maps. - Multisample anti-aliasing. - Texture upsampling. - Advanced materials support. - Advanced shading and specular methods. - sRGB support. - LATC and BPTC texture compression support. - Screen-space ambient occlusion. ------------------------------------------------------------------------------- COMPILATION ------------------------------------------------------------------------------- For *nix/MinGW: 1. Download an appropriate version of the ioq3 source code. For version 32 of Rend2, r2328 should do, though the latest may work as well. For details on how to do this, see http://ioquake3.org/get-it/source-codes/ . 2. Copy the patch file (for v32, vbos-glsl-31a.diff) into the directory you put the ioq3 source code. There should be a README in that directory. 3. Run 'patch -p0 - 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 - 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 - 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: q3gl2_sun Note the first six parameters are the same as in q3map_sun or q3map_sunExt, and the last two indicate scaling factors for the map brightness and an ambient light of the same color as the sun. There are currently two ways to use this in your own (and other people's) maps. 1. Create your map as normal and add a 'q3gl2_sun' line after your 'q3map_sun' line in your sky material, like so: textures/skies/bluesky { qer_editorimage textures/skies/bluesky.jpg surfaceparm nomarks surfaceparm noimpact surfaceparm nolightmap surfaceparm sky q3map_sunExt 240 238 200 100 195 35 3 16 q3gl2_sun 240 238 200 50 195 35 3 0.5 0.2 q3map_skylight 50 16 q3map_lightimage $whiteimage skyparms env/bluesky - - } The advantages with this method are that your map will continue to work with the old renderer with the sunlight baked into the lightmap, and it can be used with existing maps without recompilation. The downside is artifacts like doubled shadows and uneven shadow edges. 2. Use 'q3gl2_sun' instead of 'q3map_sun' or 'q3map_sunExt', like so: textures/skies/bluesky { qer_editorimage textures/skies/bluesky.jpg surfaceparm nomarks surfaceparm noimpact surfaceparm nolightmap surfaceparm sky q3gl2_sun 240 238 200 50 195 35 3 0.5 0.2 q3map_skylight 50 16 q3map_lightimage $whiteimage skyparms env/bluesky - - } The advantages with this method are that you don't get the artifacts that characterize the other method, and your map compiles a lot faster without the sunlight bouncing calculations. The downsides are that your map will not display properly with the old renderer, and you lose the bounced light that compiling the map with q3map_sun* in it would have. ------------------------------------------------------------------------------- TONE MAPPING AND AUTO EXPOSURE ------------------------------------------------------------------------------- This adds a new keyword to sky materials, q3gl2_tonemap. The syntax is: q3gl2_tonemap Each of these settings corresponds to a matching cvar, so you can view and adjust the effect before settling on fixed settings. ------------------------------------------------------------------------------- THANKS ------------------------------------------------------------------------------- I'd like to take this part of the readme to thank the numerous people who contributed thoughts, ideas, and whole swaths of code to this project. - Id Software, for creating Quake 3 and releasing its source code under a GPL license, without which this project would not be possible. - Zachary 'Zakk' Slater, Thilo Schulz, Tim Angus, and the rest of the ioquake3 team and contributors, for improving massively upon the raw Quake 3 source, and accepting my and gimhael's modular renderer patch. - Robert 'Tr3B' Beckebans and the other contributors to XReaL, for letting me liberally copy code from you. :) - Andrew 'Black Monk' Prosnik, Andrei 'Makro' Drexler, Tomi 'T.T.I.' Isoaho, Richard 'JBravo' Allen, Walter 'Johnny Rocket' Somol, and the rest of the Boomstick Studios, for contributing code, feature requests, and testing. - Yoshiharu Gotanda, Tatsuya Shoji, and the rest of tri-Ace's R&D Department, for creating the tri-Ace shading equations and posting their derivations in simple English. - Matthias 'gimhael' Bentrup, for random ideas and bits of code. - Evan 'megatog615' Goers, for testing, ideas, and bugging me just enough that I'd write documentation. :) - The folks at #ioquake3, who don't seem to mind when I suddenly drop a screenshot and insist on talking about it. :) - And lots of various other random people, who posted on forums, blogs, and Wikipedia, who helped in small but numerous ways. If I missed you in this section, feel free to drop me a line and I'll add you. ------------------------------------------------------------------------------- CONTACT ------------------------------------------------------------------------------- My name is James Canete, and I wrote most of this readme. Also, a renderer. If you wish to get in touch with me, try my GMail at use.less01 (you should be able to solve this), or look for SmileTheory in #ioquake3 on irc.freenode.net.