GLSL: previous fragment check
Is there a way to check the previous value in the gl_FragColor? Basically I only want to set a new value for gl_FragColor if there is a previous pixel in that screen coordinate. How do I check for that?
Quote:Original post by phantom
No, you can't; the fragment/pixel program can't read from the frame buffer.
Which is becoming more and more of a problem, actually. Not being able to read from the framebuffer (or the currently bound FBO) without relying on undefined behaviour is a major annoyance. A fully programmable blending stage is long overdue, if you ask me.
AGREED! hah eventhough I'm just getting into programmable pipelines, i'm seeing a drawback with that in a particular effect I'm going for: X-Ray vision
Quote:Original post by Yann LI agree. It was originally proposed by 3DLabs years ago and left out because "of complexity". Now that uberbuffers are there, there's no reason to not allow reading.
Which is becoming more and more of a problem, actually. Not being able to read from the framebuffer (or the currently bound FBO) without relying on undefined behaviour is a major annoyance. A fully programmable blending stage is long overdue, if you ask me.
As a side note, I hate blending as it works now.
I agree about a programmable blending stage, but can't the original poster do what he wants using the stencil buffer?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement