DarkRadiant: master 36de921e

Author Committer Branch Timestamp Parent
orbweaver orbweaver master 04.08.2021 19:33 master 2f95d38f
Changeset Use GL_RG8 format for uncompressed normal maps

Now that we are unconditionally reconstructing the Z coordinate in the shader,
there is no need to store it in the texture (and there was never any need for
an alpha channel).

The BindableTexture interface now defines a new Role enum which can be used as
a hint for the implementing image class to choose an appropriate GL internal
format based on usage. In RGBAImage, the role is now used to choose between
GL_RGBA8 for general images (as per the previous behaviour) and GL_RG8 for
normal maps. This appears to save around 500 MB of GPU memory in the St Lucia
map.

Further optimisations would be possible, for example skipping the alpha channel
in diffuse maps if the material does not use any alpha-related commands.
mod - include/iimage.h Diff File
mod - libs/RGBAImage.h Diff File
mod - radiantcore/imagefile/dds.cpp Diff File
mod - radiantcore/shaders/CameraCubeMapDecl.cpp Diff File
mod - radiantcore/shaders/CameraCubeMapDecl.h Diff File
mod - radiantcore/shaders/Doom3ShaderLayer.cpp Diff File
mod - radiantcore/shaders/MapExpression.h Diff File
mod - radiantcore/shaders/SoundMapExpression.h Diff File
mod - radiantcore/shaders/VideoMapExpression.h Diff File
mod - radiantcore/shaders/textures/GLTextureManager.cpp Diff File
mod - radiantcore/shaders/textures/GLTextureManager.h Diff File