Dark Bit Factory & Gravity
PROGRAMMING => General coding questions => Topic started by: Raizor on October 26, 2011
-
I'm currently using two FBOs, each with an attached texture to render out normals and lighting. At present, I do two passes, one with the FBO/texure for the normals and another pass with the FBO/texture for the lighting.
I'm just wondering if there's any way to write/render to multiple textures in a single fragment shader pass?
Thanks
-
use gl_FragData[texture_index] = ... instead of gl_FragColor. If you have all of the fbo bindings correct, it's as simple as that :)
-
Thanks Ferris :)
That's for a single FBO with multiple attached textures?
EDIT: No worries, found some info. Thanks again.
If anyone else is interested in this. Here (http://zach.in.tu-clausthal.de/teaching/cg_literatur/frame_buffer_objects.html) is some good info on the subject.