Here it is : I’m currently rendering transparent objects with alpha testing, meaning it’s fully transparent (invisible) or fully opaque. I’d like to smooth a bit the edges by enabling alpha blending, and for other evident purposes too.
But to render correctly I have to Z sort all the polys. So, as I have to consider geometry as a polygon soup (mostly outdoors), what technique should I use (octree, bsp, …) ?
I thought about object Z-Sorting rather than polys, but my method is not worth it as it will not render correctly big flat objects (as multiple transparents ceilings for example) unless I split them into tiny parts. (and convex)
Any help, suggestions, and/or links would be greatly appreciated !
A BSP tree will solve these issues.
Most BSP algorithms you’ll see sort to the polygon level, but once you understand them you’ll see you can use them to sort objects which are separated by planes too.
Hummm, I thought I would get a more explanative (is this english ?) answer …
I asked this because I’ve always heard that bsp was for indoors environment (easy to use axis aligned separating planes), and I intended to use outdoor. Could you argument a bit more, why not using octrees ? Could you explain a bit more for object sorting using bsp ?
I assumed you knew what a BSP was.
BSP’s are not just for interiors. They are a general sorting mechanism.
You can place objects in the leaves and sort them at runtime during a full traversal of the tree, testing against the eyepoint.
Many paople are confused about BSPs because they have read about Quake style useage and think that’s it.
Yes, now that you tell me to consider the general algorithm, I can understand how I’ll do this. But all my problems with this BSP will be when I’ll have to split objects into 2 meshes among a separating plane … I hate tesselation.
This technique will work for convex objects, but I’ll have to use a secondary bsp for non convexes meshes, won’t I ?
And you did not answer abot octrees, maybe you didn’t experienced by yourself ? I have to know which one will be the faster at runtime before implementing
An octree will speed a ray caster or maybe fast collision. It’s suited to quickly finding objects in a complex scene which are close to a specific region. I don’t think it is as much use for a general 3D sort. IMO BSP is better.
For a convex object you just split the leaf it occupies with a well chosen plane, then throw the split halves into their respective leaves generated by the new plane equation. It’s really simple. You can try and pick planes which don’t split primitives, or just approximately bin at the triangle, my feeling is you might get away with a rough split.
Repeat until concave (or thereabouts).
[This message has been edited by dorbie (edited 01-16-2002).]