Mantis - Croquet
Viewing Issue Advanced Details
975 Jasmine feature always 03-14-05 23:01 03-14-05 23:01
dbfaken All  
Mostly Linux  
normal RH 7.3+  
new  
open  
none    
none  
0000975: [ENH] Tweaked TPrimitive to render transparent primitives correctly
From the Changeset:
    This allows TPrimitives to do more appropriate rendering when their material is transparent. It calls a new method (renderAlphaPrimitive:) when it knows the material has transparency<1.0, and calls the normal method (renderPrimitive:) otherwise.
    Subclasses that know how to render their polygons in back-to-front order should do so in #renderAlphaPrimitive:.
    The default alpha rendering method, TPrimitive->#renderAlphaPrimitive achieves correct ordering by calling #renderPrimitive: twice - once for the 'rear' polygons with glCullFace: GLFront, and once for the front polygons with glCullFace: GLBack (all with GLCullFace glEnable:'d).
    This default method will only work correctly for convex objects, however..

    This code only caches one version of the display list at a time - with or without alpha. If you are switching between transparent and opaque objects frequently, you should either use two separate objects, or implement a display list for each within TPrimitive (fairly simple).
Try rendering a transparent TSphere that intersects with the floor. The intersection should show less (1/2) of the TSphere material and be a circle. Also, you should not see bands of different colors on the sphere.
Using Croquet for Virtual Reality.
 Alpha-TPrimitive.1.cs [^] (3,935 bytes) 03-14-05 23:01

There are no notes attached to this issue.