BSP or not or what

Hi. I want to do blending for my rotating 3D scene. Do I have to use depth sorting if I want to see the objects in their z order? If yes, what is the easiest way? If BSP, can anyone give me any example code or tutorial for 3D BSP. Can anyone help in any way please?

Hi, there are some clearly explained Quake BSP tutorial series following this link:
http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg5.htm
Hope this helps. :slight_smile:

Most of the time you can get away with simply drawing all of your opaque objects first, then turning depth writing off (but leaving depth test on) and drawing all of your transparent objects. This should work well most of the time without any kind of depth sorting.

what do you mean by “depth writing off”. Do you mean writing to GL_FRONT only? Can I use glBlend while depth test is on? Is that the other thing you mean. Thank you.

Originally posted by ioquan:
Most of the time you can get away with simply drawing all of your opaque objects first, then turning depth writing off (but leaving depth test on) and drawing all of your transparent objects. This should work well most of the time without any kind of depth sorting.

what do you mean by “depth writing off”.

modest, when depth writing is disabled, that means when you draw something, the gl doesn’t write the depth values into the depth buffer. glDepthMask( boolean ) is the function to use to enable/disable depth writing.

Can I use glBlend while depth test is on?

Yes you can. Depth testing is a separate operations from depth writing.

By the way, BSP trees can be used for many, many other things besides sorting your geometry for drawing: collision detection and path finding to name two biggies, not to mention CSG and visibility.