Hello,
I have an FBO with only a depth texture attached, which of course is not uncommon.
After setting draw buffers to NONE I was writing depth values to this FBO with a
minimalistic fragment shader like this:
#version 150 core
out vec4 Color;
void main(void)
{
Color = vec4(1.0);
}
However, now I have another use case and I want to manually set the depth value by writing to gl_FragDepth.
Can I do it just like this?
#version 150 core
out float gl_FragDepth;
void main(void)
{
gl_FragDepth = some float value;
}
Or do I still need to declare and write a color (although as before only a depth texture and no color buffer is attached)?
#version 150 core
out float gl_FragDepth;
out vec4 Color;
void main(void)
{
Color = vec4(1.0);
gl_FragDepth = some float value;
}
Thanks!