How to use Blend to make a polygon transparent?

后端 未结 1 1963
我寻月下人不归
我寻月下人不归 2020-12-22 07:22

I have a app that shows two polygons. I need to make progressively invisible one of the polygons, but the other must be visible. Im working with OpenGL ES 1.1. I\'m developi

相关标签:
1条回答
  • 2020-12-22 07:42

    Looks like the right blend functions there, call them before drawing your translucent polygon. The alpha value is typically supplied with the color or texturemap (Red, Green, Blue, Alpha), and the range for alpha is 0.0 (transparent) to 1.0 (opaque) given the blending function above.

    Also note that translucent objects are sensitive to render order: Typically you must draw all your opaque objects first, using the depth buffer as normal. Then, turn on blending and set the depth buffer to read-only, and draw your translucent objects back-to-front (draw the farthest from the camera first). This way the fragment blending happens farthest-to-nearest.

    0 讨论(0)
提交回复
热议问题