Jump to content
  • Advertisement
nen777w

C++ Front 2 Back peeling, blending, problem

This topic is 454 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!
I implemented front 2 back peeling algorithm same as in NVIDIA demo in my engine.
For the one transparent object it work fine, but if camera show two transparent objects simultaneously the second object become brighter on the area of cross of this objects.

1b9c6222115490232c506043f61b35bf-full.pn


It's happens when blending peeling result.
Probably I need to draw each transparent object separately and then blending?

p.s.
GL state on peeling blending:
GL_DEPTH_TEST = OFF 
GL_BLEND = ON 
glBlendEquation(GL_FUNC_ADD); 
glBlendFuncSeparate(GL_DST_ALPHA, GL_ONE, GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);

Thank you for the help.

Edited by nen777w

Share this post


Link to post
Share on other sites
Advertisement

It looks like it appears brighter because of GL_ONE_MINUS_SRC_ALPHA, is 1.0f - the gray model's alpha.The green model appears brighter on the darker parts of the gray model. See if changing

On 9/8/2017 at 6:22 AM, nen777w said:

glBlendFuncSeparate(GL_DST_ALPHA

to GL_SRC_ALPHA gives you the desired effect. Or if GL_ONE_MINUS_DST_ALPHA does.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!