For some reason I just cannot get depth values from my texture rectangle depth buffers. I desperately need help as I’ve tried just about everything I can think of.
My color attachment for the texture rectangle also works fine, so I’m sending in the correct arb_texture_rectangle expected texel based UVs
My depth texture_2d stuff works fine, and it uses exactly the same setup for my depth texture rect.
After I bind the texture, I do this…
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE); GLint UniformLoc = -1; GLuint Program = GetShaderProgramHandle(SHADOWRECT_SHADER); UniformLoc = glGetUniformLocationARB(Program, "tex"); if (UniformLoc < 0) glUniformError(__LINE__, __FILE__); glUniform1iARB(UniformLoc, 0);
In the texture2d shader I do this
uniform sampler2D tex; ... color = texture2D(tex, gl_TexCoord.st); gl_FragColor = color;
In the texture rectangle shader I do this.
uniform sampler2DRect tex; ... color = texture2DRect(tex, gl_TexCoord.st); gl_FragColor = color;
When sending texture2d quads I use UVs from 0.0-1.0, when sending texturerect quads UVs are 0.0-tex_size.xy
So I’m REALLY at a loss here, any help?