OpenGL palette rendering and related things
-
Review changes -
-
Download -
Patches
-
Plain diff
This patch adds a palette rendering mode into the OpenGL renderer. It matches the look of software rendering very closely.
A new option are added to the OpenGL settings menu: "Palette rendering" (gr_paletterendering
) switches the new mode on/off. (Shaders must also be enabled)
gr_palettedepth
switches the look of the colors between what software mode displays on the screen (16 bits) and what software mode displays in screenshots saved by the game (24 bits). (Tip: Using an external screenshot tool (like the Print Screen key) instead of pressing F8 will capture what software mode is actually outputting to your screen.)
If you want everything else to look like software too, make sure you have these settings:
- Texture filtering: Nearest
- Anisotropic filtering: 1 (=disabled)
- Lack of perspective: On
-
gl_fakecontrast on
(I think?) - OpenGL bit depth: 32 bits (Lower settings have slightly worse color accuracy)
Features:
- Lighting is done using software's light tables / colormaps
- Light level calculation is upgraded to be more accurate (truecolor rendering also affected) (fixes or at least greatly improves #518)
- Postprocess shader palettizes the translucent parts and the rest of the image
- Composite textures are blended the same way as in software
- Texture filtering still works. You can have software colors without software moire!
- This is achieved by converting the RGB color sampled from the texture in the shader into a palette index using a lookup table
- Full flash palette support
- Fixes a minor inconsistency between hardware and software about the use of fake contrast in colormapped walls
- Fades are more accurate to how they look in software
Other notes:
- Continues (and includes) the work in !1507 (closed). The defines used by the preprocessor have a "SRB2_" prefix added to them. Shaders will have
#define SRB2_PALETTE_RENDERING
added to them when palette rendering is enabled. - The light levels are close to software but not perfect. Also translucencies don't always look the same.
- Some color issues seem to be because of some bugs in the hardware renderer that are not directly related to palette rendering. Like incorrect appearance of the bottom side of the water surfaces in many maps, including GFZ and DSZ.
This should be tested on a diverse set of hardware (from AMD, Intel and NVIDIA) to make sure there aren't any GPU vendor-specific issues. Drivers on different operating systems can also behave differently.
Testing build (Updated 2023-09-23):
srb2win_ogl-palette-rendering-5.exe
(Note: it's disabled by default, go to the OpenGL settings to enable it!)
This build is netgame compatible with 2.2.13!
When reporting issues, please also report OS version and GPU model.
Merge request reports
- version 26d895ff88
- version 2510b3c58a
- version 2410b3c58a
- version 234523364a
- version 2219a1e4f6
- version 2119a1e4f6
- version 2019a1e4f6
- version 1919a1e4f6
- version 1819a1e4f6
- version 1719a1e4f6
- version 1653e7fb96
- version 1580089816
- version 14a47e1fb2
- version 13a1265728
- version 12d310729b
- version 11978006bc
- version 101fd9d389
- version 9f74433cc
- version 8b3c970d6
- version 72b4cf272
- version 61ebc8096
- version 589af6b10
- version 4386c4a95
- version 3f7a8bede
- version 2cf16fd29
- version 1ac1b5ae5
- next (base)
- latest version9198090734 commits,
- version 26d895ff8833 commits,
- version 2510b3c58a29 commits,
- version 2410b3c58a39 commits,
- version 234523364a38 commits,
- version 2219a1e4f626 commits,
- version 2119a1e4f626 commits,
- version 2019a1e4f626 commits,
- version 1919a1e4f628 commits,
- version 1819a1e4f626 commits,
- version 1719a1e4f628 commits,
- version 1653e7fb9626 commits,
- version 158008981625 commits,
- version 14a47e1fb224 commits,
- version 13a126572823 commits,
- version 12d310729b22 commits,
- version 11978006bc21 commits,
- version 101fd9d38920 commits,
- version 9f74433cc19 commits,
- version 8b3c970d618 commits,
- version 72b4cf27217 commits,
- version 61ebc809615 commits,
- version 589af6b1014 commits,
- version 4386c4a9513 commits,
- version 3f7a8bede8 commits,
- version 2cf16fd295 commits,
- version 1ac1b5ae53 commits,
- Side-by-side
- Inline
Some changes are not shown
For a faster browsing experience, some files are collapsed by default.
Files
29Files with large changes are collapsed by default.