I struggled a bit when I first did my shadow maps in OpenGL. someone on here was kind enough to link me to their tutorial on how to do it, and I had to strip his source down to the basics and see where I was making mistakes.
Since then I had always planned on doing a Very Simple Shadows tutorial on GLSL shadow-mapping in GLUT, but it seems you have beaten me to it
Thanks for the great tutorial Nicolas! One question though… how can you pull off this same thing without the extra GL_TEXTURE matrix translation? I can’t seem to get it to work with that.
Also, in the code, you’re polling for a xPixelOffset and a yPixelOffset uniform that don’t appear to exist in the shaders.
The default is LUMINANCE, so you were probably getting “1” before when you were using .w.
Post-GLSL 1.3, DEPTH_TEXTURE_MODE is deprecated and GLSL behaves as if its always set to LUMINANCE (so you get a rrr1 return, where r is the depth comparison value).
I’m trying to implement the PCF Soft Shadows in my own project. The idea is to adapt the code from the example.
Unfortunately, I’m getting an incorrect lighting, very bright and without shadows. I need some help diagnosing the issue.
I’m using a QGLWidget (from Qt) to render. Before this implementation, I was just doing rendering on the widget; however, I’ve seen that the tutorial uses two FBO objects. I copied that part, but I don’t know if I have to change also my code.