Leveraging shadow maps in Qt, without using QOpenGLFrameBufferObject

A few years ago I was attempting to use shadow maps in Qt/OpenGL but was simply unable to use QOpenGLFrameBufferObject as a shadow-buffer. I had even posted a question about it on stack-overflow here. It turns out, you cannot use QOpenGLFrameBufferObject for creating shadow buffers. So, I had to resort to native OpenGL calls. Recently someone reached to me on LinkedIn asking me if I could share the code.

So here it is: https://github.com/pnudupa/codesamples/tree/master/bike_shadows

When the code at this repository is compiled and executed, we can see a window with two bikes, with their shadows on the ground and on each other.

You can press any key to rotate the whole scene and watch the shadows move.

Leave a Reply

Your email address will not be published. Required fields are marked *