|
|
Paul,
Lots of things to reply to. :)
About the lower resolution c-buffer: Jaap and I talked about this problem. Jaap mentioned the theoretical case of a 2x2 c-buffer: In that case, it is extremely easy to see that the visibility information is 'not accurate'. There are two ways to handle this problem.
1- Jaap suggested to use a c-buffer with a 'reasonable' vertical resolution, eg. half the horizontal resolution of the final image. This would still cause some 'popping', but your eyes wouldn't have much problems believing that it is actually correct. Of course, this is not 'conservative'. Currently, this is the situation, however.
2- While reading your post, I thought of something else: I never check individual polygons against the c-buffer; I always check bounding boxes. That means that I can simply enlarge the bounding box to compensate for the inaccuracy of the c-buffer.
About the perfect sorting order: This is not needed. When an octree node is 'processed', it automatically means that all detail meshes in the node are set to 'visible', even if they are behind an occluder polygon in the same node (that should have been prevented by a better subdivision, of course, but let's assume it happens). That means that a detail mesh can only be occluded by a different node. The occlusion caused by the occluder polygons in a node is always the same, no matter in what order you draw the occluder polygons in that node. Therefore, I need no perfect sorting. In fact, I would gain speed if I would first insert the largest polygons, and then the smaller ones.
I DO need splitting of occluder polygons against octree node boundaries, of course, because I need perfect sorting of occluder polygons on the octree node level. This makes moving 'static' geometry more expensive. This could be solved by using an s-buffer. Right now, I consider the s-buffer a good solution for scenes that require that all objects must be moveable. For all other scenes, I believe the c-buffer is faster.
About the search for the visible pixel: That's a very good idea. I'm not sure how much time checking actually takes (it's a cheap process, code wise, but still), so I'm installing VTune right now, but it might indeed be a good idea to do it the way you described. After all, visibility testing is done for every octree node that has a (partially) visibile parent node, plus every detail mesh bounding box (or sphere, elipsoids are easy to check against the c-buffer too:).
Thanks for your post,
- Jacco.
|