Closed inguin closed 6 years ago
These effects use a different shade table palette than the default lighting palette. Easiest path for this in OpenGL seems to be to use a special shader to emulate this effect.
Thinking more about this, it could probably be done as a post processing effect. We could have a shader param that controls whether things should draw at full brightness in the normal texture / color shaders, and then when drawing the framebuffer texture use a special black and white shader.
Reproducing the effect in the shaders is very simple (it works, but I'm getting GL errors; no idea why):
float gray = 0.30 * t.r + 0.59 * t.g + 0.11 * t.b;
gl_FragColor = vec4(gray, gray, gray, alpha);
All we need to do is switch this on or off by setting a uniform parameter.
(it works, but I'm getting GL errors; no idea why)
One mystery solved: I was no longer referencing the light
value, so the shader compiler/linker optimized everything up to and including the light
attribute out.
The Night Sight hardware does not work with the OpenGL renderer. It's supposed to render everything in black and white at full brightness.