Not only is this a deprecated feature - it also does not work right when complex lighting is at play, it must be done in the shader to get proper results.
For Duke Nukem and its direct offspring (Nam, WW2GI and Redneck Rampage) the ramp is not a linear fade from 0 to 1, it needs to be a little darker than that.
Unfortunately the proper factor needed here must be set manually, this cannot really be calculated from the lookup tables.
Something about their data preparation is not right, their depth looks totally off and causes fog to become to dense.
One more reason to reconstruct the renderer in a sane fashion.
Although this initially helped, it was only because it partially covered up the issues from the real problem which was using the sampler properties of the texture offsets.
With that one fixed this cache became pointless.
This needs to be moved into the backend, and partially into the shader. So far this only removes the code from the main rendering logic, the final implementation is not done yet.
It had to go because it required the main rendering code to look deep into the texture data which would be a major blocker for refactoring.
- also removed the legacy fog modes because their implementation did not mix well with the texture system - they are also not really useful to begin with.
The last fog mode will most likely also be removed once true color shading is working but that one is less of an issue.
The only compatibility mode feature left is the main drawer function using glBegin/glEnd but changing that is not as urgent as the rest.
This also cleans up the fog application and adds the exponential fog mode again that somehow got lost over time.
The builtin matrices are no longer available in modern GLSL, preventing an upgrade of the shader.
Also perform better reporting of shader compilation errors.
Currently this only contains the main Polymost shaders and the resources from nblood.pk3.
The latter cannot be used yet because the Build resource management system is too stubborn to add the newly added file without some changes.
It's better to refactor the entire system instead.