BlendModes and Depth-Sorting
              in 
             Programming Questions 
              •  
              3 years ago    
            
 
           
             Hello there, 
            
I still have problems when I try to blend something in Processing.
I built this simple scene to illustrate my problem: http://www.abload.de/img/tdjge.png
It's basically a semitransparent cube with a black/white sphere half inside. The part of the sphere that is outside of the cube is displayed correctly but the part that should be seen inside the cube is just gone..
            
When I change the scene in the way that the sphere is drawn first everything is cool: http://www.abload.de/img/tjkci.png
            
So, in this scene it's obviously no problem but in complex scenes it's impossible to change the drawing order dynamically.
When I enable depth-sorting via hint(ENABLE_DEPTH_SORT); it kind of works. But it seems to work only on the faces level and some vertices are still off. Besides it's way too slow for more complex scenes.
            
I hope there's someone here who can help me out on this!
 
           
 
            
           I still have problems when I try to blend something in Processing.
I built this simple scene to illustrate my problem: http://www.abload.de/img/tdjge.png
It's basically a semitransparent cube with a black/white sphere half inside. The part of the sphere that is outside of the cube is displayed correctly but the part that should be seen inside the cube is just gone..
When I change the scene in the way that the sphere is drawn first everything is cool: http://www.abload.de/img/tjkci.png
So, in this scene it's obviously no problem but in complex scenes it's impossible to change the drawing order dynamically.
When I enable depth-sorting via hint(ENABLE_DEPTH_SORT); it kind of works. But it seems to work only on the faces level and some vertices are still off. Besides it's way too slow for more complex scenes.
I hope there's someone here who can help me out on this!
 
              
              1  
            
 
            
 
 
           
 
             Thank you so much! I didn't even know that depth writing existed!
 Thank you so much! I didn't even know that depth writing existed! 
             