Potential OpenGL error with shadow debug HUD
The shadow debug HUD renders the values in the shadow maps as colours, making it easier to see what's going on. However, technically, the current implementation is illegal OpenGL.
The shadow map texture has shadow sampling enabled (with
osg::Texture::setShadowComparison(true)), which is what we need when actually rendering shadows and use it with a
sampler2dshadow, but for the debug HUD, it's used as a regular
sampler2d as we need to read the value it contains instead of comparing it against a reference value. This isn't allowed.
Ideally, we'd want to bind the same texture to two different texture units with two different sets of settings for the two passes.
Fixing this should also fix the debug HUD being missing on some systems.