Jump to content
  • Advertisement
Sign in to follow this  
BloodLust666

GLSL: previous fragment check

This topic is 3885 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!