Multiple fragment shader outputs #2427
-
As part of a project I'm working on it'd be very useful for one of my shader programs to be able to output more data than just color/alpha (in this case, I want to output the depth information, but I can foresee myself also wanting to output other data such as whether a fragment is in shade etc.). From searching around, it seems that the way to do this with OpenGL is either to use So, what I'm wondering is whether this functionality exists, and if not, why not? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You need to add multiple attachments to a framebuffer, not use multiple framebuffers. Check out the deferred example: bgfx/examples/21-deferred/deferred.cpp Line 522 in ed037a7 https://github.com/bkaradzic/bgfx/blob/master/examples/21-deferred/fs_deferred_geom.sc#L29 |
Beta Was this translation helpful? Give feedback.
You need to add multiple attachments to a framebuffer, not use multiple framebuffers. Check out the deferred example:
bgfx/examples/21-deferred/deferred.cpp
Line 522 in ed037a7
https://github.com/bkaradzic/bgfx/blob/master/examples/21-deferred/fs_deferred_geom.sc#L29