GLSL: previous fragment check

Started by
5 comments, last by BloodLust666 16 years, 2 months ago
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?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
Advertisement
No, you can't; the fragment/pixel program can't read from the frame buffer.
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
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
Quote:Original post by Yann L
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.
I 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.
As a side note, I hate blending as it works now.

Previously "Krohm"

I agree about a programmable blending stage, but can't the original poster do what he wants using the stencil buffer?
how could I do that in the stencil buffer? could you give an example please? (i'm not too familiar with the stencil buffer at this point)
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML

This topic is closed to new replies.

Advertisement