Predicate Draw

rwolf

Rock Star
Regular
The predicate draw feature of Directx3d 10 clips geometry out of scene if it isn't visible. What happens if a light is shining on the object and a shadow is cast and the shadow is visible, but the geometry is not?
 
The process of rendering an object that casts a shadow normally involves one rendering pass to produce the actual object and another rendering pass to produce its shadow (to oversimplify a bit). As far as DX10 is concerned, these two passes are just two separate heaps of polygons - setting up the polygons and their render state so that the result looks like an object that casts a shadow is the responsibilty of the game developer, not DX10 itself.

As far as predication is concerned, you would presumably just have separate predicates for each of those two passes.
 
rwolf said:
The predicate draw feature of Directx3d 10 clips geometry out of scene if it isn't visible. What happens if a light is shining on the object and a shadow is cast and the shadow is visible, but the geometry is not?
What happens always depends on what the developer wants to happen. And if the developer isn't completely crazy, then the shadow is drawn, the object is not.

The shadow is not part of the object. Depending on the shadow algorithm, the object data is used in different ways to create the shadow. But the predicated draw does not remove the object data, it just prevents drawing of this object.
If you're using shadow maps, an object can be visible from the light point of view and thus get drawn to the shadow map, but hidden from the eye point of view and "clipped away" from the camera view because of a predicated draw.
 
rwolf said:
Is that the same way reflections are done?
It's the same principle - the object that is being reflected and its actual reflection are drawn as two separate objects, which would be culled separately in case culling is enabled.
 
Back
Top