🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Rendering transparency issue, there is a hole

Started by
1 comment, last by swiftcoder 3 years, 2 months ago

Hi I am having a weird rendering issue.

See screenshot below


I originaly thought that the sequence of the render is the issue but I re-reviewed the code countless times and it is the sequence is OK.

Background
there are 3 2d images sprite in here
1. the background image
2. the book
3. and a transparent panel

Sequence (Including RenderDoc trace)
1. the background image is rendered first to a main render target (FBO#1)


2. the the book is rendered to another FBO#2, since this is a popup window of some sort


3. then the transparent panel is rendered on top of the book image in FBO#2

4. FBO#2 is rendered as a texture to FBO#1, as seen on screen shot bellow, input is the FBO#2.


Result, the transparent panel blends with the background image instead of the book making a hole.
What could possibly wrong with it?

Advertisement

The alpha of your transparent panel appears to be overwriting the (solid) alpha values of the book, which causes those pixels to be blended again.

You can use glColorMask(true, true, true, false) to prevent the transparent alpha values from being written to the framebuffer.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement