|
|
DirectX (version 8 at least) may not have to let you have access to the depth buffer data at all depending on the hardware/drivers.
I haven't tried it in my engine yet, but my idea is to write a script for the renderer (max, lightwave, etc) to render individual objects (columns, tables, plants, ...)with a bright background, like green/blue screens in movies. These objects would then be overlaid on the background like sprites, but with a more representative depth. Large objects would be split into tiles for a better representation. I'm hoping this will give an acceptable result.
Another option would be to render the room in slices along the z-axis (by setting the near/far range), also with the bright background. Any geometry drawn would be extracted to rectangle sprites and the depth of the slice stored. This would give more quads to draw for the background though, but may give a better result. Any animated parts, like the flames in the IOTD can be put in as seperate sprites and done with little extra cost, except the memory required for them.
The technique I use now is to render a low-res version of the room geometry, and keep thing you can walk in front of to flat edged objects like boxes/tables. This works fine for now, but won't help when I get around to putting in a plant or something round near the front of the scene. The bonus though is that I use the low-res version for collision detection/response anyway, so it isn't any extra to create.
Dan
|