Jump to content
  • Advertisement
Sign in to follow this  
Mihumihu

How to separately discard in multiple rendering targets fragment?

This topic is 637 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

Hi. There is a problem. I make billboard picking, and i render it in one pass with two gl_FragData. First - is a billboard image and second is a quad color mask. Billboards are transparent, and pixel with zero alpha discarded in fragment shader. I dont want to sort them)) And discard works fine, but it's also discard zero pxels in second FragData, but I needn't that. Could is it possible to make discard in first FragData, but not in a second?

 

P.S.

Sorting solves this but I dont want to sort. 

 

Thanks.

Share this post


Link to post
Share on other sites
Advertisement

In MRT (multiple render target) discard in pixel function will prevent entire pixel function from altering output (depth buffer, everything), whether it is implemented with some separating options- might be in some super high OpenGl but I'm sceptical, since you can trivialy solve this problem by enabling Alpha Mask state and alter the fourth component of color you are outputing accorindgly (zero or masked value in first one, 1.0 in second opaque one).

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!