I´m trying to do some shadows but the shader only outputs values if I use:
layout (location = 0) out vec4 outColor;
It doesnt work with vec3 or less. You can check my texture properties here:
shadowTextureProperties.setHasMipMap(false);
shadowTextureProperties.setMagFilter(EnumTextureFilter.NEAREST);
shadowTextureProperties.setMinFilter(EnumTextureFilter.NEAREST);
shadowTextureProperties.setWrapS(EnumTextureWrap.CLAMP_TO_EDGE);
shadowTextureProperties.setWrapT(EnumTextureWrap.CLAMP_TO_EDGE);
shadowTextureProperties.setInternalColorFormat(EnumTextureColorFormat.RGB_32F); // 1st format value
shadowTextureProperties.setSrcColorFormat(EnumTextureColorFormat.RGB); // 2nd format value
shadowTextureProperties.setValueFormat(EnumValueFormat.FLOAT);
This is my shader fragment source with vec3 output and the format above, I'm getting a completely white screen. With vec4 I'm getting true depth values.
#version 400
precision highp float;
layout (location = 0) out vec3 outColor;
void main()
{
outColor = vec3(gl_FragCoord.z);
}
Results