Simple OpenGL FBO Textures

I was playing around with FBOs and rendering to textures the other week and came up with this. A spinning yellow torus is rendered to a texture, then a second spinning torus is textured using the texture we just created of the first spinning torus… Yeah, I need to stop using donuts as my test objects.

Full source code & shaders after the jump…

Main C++ File

Point light diffuse vertex shader (first yellow torus)

Point light diffuse fragment shader (first yellow torus)

Texture / Diffuse Shader vertex shader (final pass)

Texture / Diffuse Shader fragment shader (final pass)

Leave a Reply

Your email address will not be published.