1

Topic: OpenGL, Deep, Alpha and planes

Something straight off could not find. There are two textures with alpha channel how them correctly to draw on two planes with different height? I.e. two planes, a side view are drawn at me: ____    ____ the first is drawn the left, second right. So, on a picture I see right over left. With glEnable (GL_DEPTH_TEST) it turned out to cut left (left) a plane, i.e. the alpha is not considered. The order , well, as though and logically is considered. But here an alpha... glEnable (GL_BLEND) it is included, glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) I can am, of course, simple sort planes on z and draw them in such order but if they are not parallel planes XY? And to be intersected? It is all manually somehow becomes, cutting off by planes?

2

Re: OpenGL, Deep, Alpha and planes

Hello, CEMb, you wrote: CEM> I.e. two planes, a side view are drawn at me: CEM> ____ CEM> ____ CEM> the first is drawn the left, second right. So, on a picture I see right over left. Simply to draw with an alpha the channel it is necessary to draw as it should be back-to-front cutting nothing. If planes somehow are artfully intersected, you need to implement order-independent transparency.

3

Re: OpenGL, Deep, Alpha and planes

Hello, VTT, you wrote: CEM>> I.e. two planes, a side view are drawn at me: CEM>> ____ CEM>>    ____ CEM>> the first is drawn the left, second right. So, on a picture I see right over left. VTT> <img> corrected "picture". Simply  throws out gaps VTT> simply to draw with an alpha the channel it is necessary to draw as it should be back-to-front cutting nothing. VTT> if planes somehow are artfully intersected, you need to implement order-independent transparency. And as usual any graphic-game engines do it?

4

Re: OpenGL, Deep, Alpha and planes

Hello, CEMb, you wrote: CEM> And as usual any graphic-game engines do it? Is mandatory sort. It is necessary as all the same to sort not only translucent objects, but also completely the opaque. The second often appears even more important for reduces fillrate and a miscellaneous cost with it connected. Certainly the depth buffer allows to deduce opaque geometry in any order, but sorted it is possible  much faster. That is the general approach such: to sort all opaque objects and to deduce them as it should be front-to-back, then to sort and deduce all translucent objects as it should be back-to-front. Well and about order-independent transparency truly already mentioned: if something somehow is artfully intersected and in advance to break it into some fragments it is impossible, the modern iron allows to implement one of these algorithms.