PDA

View Full Version : BSP or not or what



modest
04-22-2004, 10:30 AM
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?

lgc_ustc
04-22-2004, 12:24 PM
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. :)

ioquan
04-22-2004, 10:46 PM
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.

modest
04-23-2004, 06:14 PM
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.

plasmonster
04-23-2004, 07:05 PM
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.