This way the view matrix will remain constant per scene and an update of the model matrix is only needed for rendering a model or voxel, reducing the total amount of generated matrices to the point where they can be written to a buffer instead of constantly uploading them as uniforms.
The code needs to be refactored anyway to allow better crosshair control but this also seemed to affect global render state, considering how poorly it was all implemented.
Not tested and probably still not working correctly, the entire feature was a nearly impenetrable mess of convoluted code. This definitely needs verification with multiple mods using it.
This should complete the transition and allow storing the render state in an array so that Polymost can be rewritten to create draw lists instead of actually doing the rendering itself.
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.
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.