Description
I noticed multiple bugs, some being regressions, on Nvidia Geforce 6000 and Geforce 7000 series. Those cards do not work with nouveau (ARB_framebuffer_object
is missing and that's a requirement to run the game) but those card work with Nvidia 204 driver.
Nvida 304 driver is in really bad shape for Geforce 6000 series (most of them will just crash while the kernel complains they have fallen off the buse
) but I haven't experienced such issue with a Geforce 7000 one.
Both Geforce 6000 and Geforce 7000 experience the bugs I've noticed.
While looking for the cause of the bug, I noticed this in daemon.log
:
...GL_ARB_texture_compression_rgtc not found
Over the 40+ cards that were tested, no other one reproduces the bug, but also no one misses that extension. In fact the only other GPUs known to miss that extensions are the ones from the R300 series by ATI and they are experiencing another bug that prevent maps to load at all (see #345) so that other bug is likely to hide on ATI side the one I disscuss in this thread.
What I noticed is while the engine tells this extension is missing, the engine also prints wrong things in logs:
Debug: found heightmap embedded in normalmap 'textures/shared_pk02_src/floor12_n'
Debug: found heightmap embedded in normalmap 'textures/shared_pk02_src/floor12_n'
Debug: found heightmap embedded in normalmap 'textures/shared_pk02_src/floor09_n'
Debug: found heightmap embedded in normalmap 'textures/shared_pk02_src/floor06_n'
Debug: found heightmap embedded in normalmap 'textures/shared_pk02_src/floor05_n'
Debug: found heightmap embedded in normalmap 'textures/shared_pk02_src/floor04_n'
Debug: found heightmap embedded in normalmap 'textures/shared_pk02_src/floor03_n'
Debug: found heightmap embedded in normalmap 'textures/shared_pk02_src/floor01_n'
The wrong thing in those logs is that those textures do not ship height map in normal map file.
When an height map is shipped in a normal map file, the height map is stored in alpha channel, this is not the case here.
We have to detect if the height map is stored in alpha channel for two reasons:
- to use the height map
- to properly read the normal map
So if either height mapping or normal mapping is enabled, we have to detect if the normal map ships an height map.
We need to properly read the normal map when height mapping is disabled because we use a well know technique that is able to reconstruct the normal map from weird formats and in this case, some of the values is stored in alpha channel for optimization purpose (see this snippet in glsl code. See also that comment by @cmf028 who explains things well. The code is written in a way that when a normal map does not ship height map in alpha channel, either storing XYZ in RGB or XYZ in RGA will produce the same result thanks to the compute producing the same result if A is default value for no alpha channel (fully opaque, one). But the engine must not attempt to reconstruct Z from alpha channel value when the normal map ships an height map or the compute would be wrong.
While the internal format (here CRN) stores the data in alpha channel for optimization purpose, the engine usually don't consider the file to be an RGBA file but an RGB one (only the GLSL code will know how to pick properly the required channels), then it's possible for the engine to know if the file embeds an height map or not. If there is three components, there is no height map even if there is some data hidden in alpha channel, if there is four components, there is an height map in alpha channel.
It looks like the two same logs occurs on the same cards. From all the cards tested at this point, only the Nvidia Geforce 6150LE, 6600 Silencer, 7500LE (both Curie hardware running on 304 drivers), ATI X300, X550HM and X1050 (both R300 hardware running on Mesa r300 driver) both report a missing texture_compression_rgtc
and a wrong detection of an height map in normal map alpha channel while it's another RGA format instead.