Jump to content



Transparency problem

  • You cannot reply to this topic
1 reply to this topic

#1 Marrshal   Members   -  Reputation: 108

Like
0Likes
Like

Posted 22 February 2012 - 03:08 AM

I'm implementing a simple particle system. I draw a textured polygon where the particle is suposed to be. This texture has a transparent regions (in the edges). Here is the problem:

scr.JPG

As you can see the in the transparent regions is draw the backround, not the part of the particle behind. During the rendering of the fountain I didn't disable depth testing or something similar.

Thanks in advance!
MarrShal

Ad:

#2 Brother Bob   Moderators   -  Reputation: 1767

Like
0Likes
Like

Posted 22 February 2012 - 05:18 AM

Transparency is draw order dependent; you need to sort your particles and draw them from back to front. But depending on the visual results you get by not sorting, you may get away with no sorting even though you technically do need it. In that case, you need to disable depth writes to ensure that particles closer don't block particles further away. Look into glDepthMask.






We are working on generating results for this topic
PARTNERS