CNQ3 1.52 Renderer Improvements
Content
New Back-ends
The renderer now has 3 back-ends:- D3D11 (Direct3D 11)
- Requirements: feature level 10.1 minimum, 11.0 for better image quality
- Pros: most reliable and well-tested drivers, great image quality
- Cons: Windows only, no adaptive V-Sync support
- GL3 (OpenGL 3)
- Requirements: OpenGL 3.2 minimum, 4.3 for better image quality and 4.4 for better performance
- Pros: great image quality, can be the fastest back-end, adaptive V-Sync support
- Cons: bad drivers (old AMD, Intel) can mean bad performance and rendering issues
- GL2 (OpenGL 2)
- Requirements: OpenGL 2.0 minimum, 3.0 for MSAA
- Pros: runs on ancient hardware and most VM software, adaptive V-Sync support
- Cons: everything else
- This is the code from CNQ3 1.51
- CVars: r_backend, r_khr_debug, r_gl3_geoStream, r_d3d11_presentMode, r_d3d11_syncOffsets
V-Sync
V-Sync handling has been improved in 2 ways:- Reduced stuttering
- Support for adaptive V-Sync for the GL2 and GL3 back-ends
- CVars: r_swapInterval, r_backend
Color Banding
Color banding can be reduced in 2 ways:- Increased bit depth in the color render target(s)
- CVars: r_rtColorFormat
- Dithering (i.e. adding noise) during 3D render passes
- CVars: r_dither, r_ditherScale
8 bits - noise OFF
Depth Fade
Depth fade rendering helps hide the "hard edges" created by the intersection of transparent surfaces with other geometry. In the new renderer, surfaces drawn with specific shaders (e.g. explosions, blood, impact marks, water bubbles, smoke, ...) are treated as depth-faded. Depth fade for billboarded quads are sometimes called "soft sprites" or "depth particles".- CVar: r_depthFade
OFF
Alpha to Coverage
Alpha to coverage enables multi-sampling inside surfaces when MSAA is enabled, which is of use to fight aliasing in alpha tested surfaces.- CVars: r_alphaToCoverage, r_msaa
OFF
Centroid Sampling
Centroid sampling is always enabled with GL3 and D3D11 and always off with GL2. It prevents incorrect colors showing up at geometric edges when MSAA is enabled. It prevents vertex attributes from being extrapolated when the pixel center isn't covered, which can generate incorrect colors and invalid texture coordinates, forcing texel fetches from unrelated tiles in texture atlases.- CVar: r_msaa
OFF (GL2 back-end)
GPU Mip-maps Generation
The new renderer can use compute shaders to generate mip levels on the GPU directly instead of using the CPU. The current implementations offers the following benefits to the users:- Improved control over the aesthetics by letting the user pick which filter and gamma correction factor to use.
- Improved map load times by uploading only mip 0 and having less work on the CPU side.
- CVars: r_gpuMipGen, r_mipGenFilter, r_mipGenGamma
Old: Tent filter on the CPU
Lanczos 4
Dynamic Lights
Dynamic lights rendering has been improved in 2 ways:- New normals are generated for faces with broken normals.
- Dynamic lights can apply to transparent surfaces.
Broken
Broken
Lightmap-only Rendering
r_lightmap 1 rendering has been improved in 2 ways:- All opaque surfaces with a lightmap will now always display the lightmap.
- Dynamic lights no longer incorrectly "reveal" the diffuse texture.
Broken
Transparency Sorting
Transparent surfaces such as sprites used to always be drawn in the order in which they were added. Drawing back-to-front based on a single midpoint was selected solution.- CVar: r_transpSort
Broken
Fog
Please note that the fix is for an old CNQ3 bug that was introduced before the 1.46 release. It prevented surfaces outside a fog volume to be affected by the fog when being inside the volume and looking out at them.Broken