DX9 Query

744d06ebf78d82e8667f1f7ad8392daf
0
SYS49152 101 Dec 15, 2004 at 13:16

Hello all…..
So after few days of hardcore-hacking if have made some good progress with my editor and terrain-system. ( i will post soon some pictures…. )

i have droped the idea to use dynamic vertex buffers because of the performance loose. i have now implement a static model by using patches for rendering visibly parts of the terrain. iam happy with the result because i can now draw larger scene with a better FOV. the culling is now easier to handle because of the patches.
i have start to implement a lod system. with the patch system is should now be easier to implement.

ok back to my question.
atm i thinking about to implement occluders for the terrain. since this is a new topic for me i dont have much experience with occluders.
after reading the sdk docs i found the directx9 supports querys.
something like this:

Create the ‘Query-Object’ for occlusion-data


Loop
Render all Objects Bounding Boxes ( Terrain-Patches, Objects….. )
( i knwo that i need an extra render-target for this but this is not a problem )


Loop
For each Object…..

Query.Issue ( Start )
Render Object (bounding box )
Query.Issue ( End )

var = Query.GetData(flush)
if var = 0 then object is not visibly


My first question is,
if this is the way how to use the query-object in Dx9 ?

My second question, would you use this kind of occlusion culling for a terrain ?
if not what kind of occluders you would do for a terrain system ?

thanks for any replys or comments….

  • Andy

2 Replies

Please log in or register to post a reply.

22b3033832c5c699c856814b0cf80cb1
0
bladder 101 Dec 16, 2004 at 04:20

Yeah that’s the general idea behind using it. I dont know the details about its performance though. WHat troubles me is the GetData bit. You have to loop until the data is available, that is until the object has been rendered. This would cause a stall in the graphics pipeline and would break your cpu/gpu synchronization. The way to use it correct as far as I can tell. I’d suggest you give it a shot, render using occlusion culling and the render without occlusion culling. See which is better.

Maybe there is a way you can render the bounding boxes preframe. Before actually rendering your current frame, you could have already rendered your current frames bounding boxes last frame. THat would ofc ourse mean youd be showing the game one frame late. Maybe it wont be that noticable. I dont know, youd have to try it out.

I’ve heard of people do this occlusion queries in software though so that the cpu/gpu parallelism is maintained. You’d need to get into software rasterization though.

744d06ebf78d82e8667f1f7ad8392daf
0
SYS49152 101 Dec 16, 2004 at 10:43

“WHat troubles me is the GetData bit. You have to loop until the data is available, that is until the object has been rendered. This would cause a stall in the graphics pipeline and would break your cpu/gpu synchronization.”


this is the problem i have atm with the query object. when you have alot of objects-bounding boxes this will eat some frames… i have make yesterday a small test and frame-rate droped abit…. without the query object the boxes renders without any performance loose. so i think you are right with this!!!

“I’ve heard of people do this occlusion queries in software though so that the cpu/gpu parallelism is maintained. You’d need to get into software rasterization though.”


this sounds like a nice idea. i think with a small buffer for the occluders it should be get good results. since i will work with simply bounding boxes the buffer dont need to be that large. somthing like 256x256 should be ok !?

i will “TRY” to do the software implemention on weekend.

  • Andy