Given a mesh, I want to generate another mesh that is effectively a shadow volume of this mesh.
I am looking for an algorithm/solution/implementation/reference that can do this under the following constraints:
- I have a single, point light source. Thus:
- Not a polygon;
- I want hard edges/faces (not soft shadows)
- The light source is at infinity, in fact can be assumed to by directly above the mesh. Thus:
- The projection is actually orthographic and depends only on a single direction.
- I want an exact solution.
- The result mesh is not used for display so cannot be based on resolution dependent rasterization as many algorithms are.
A naive algorithm is to extrude all mesh triangles in the direction away from the light, e.g. downward, and do a CSG union of all these extruded "prisms".
The drawback here is that:
- It does this for all triangles and not just the visible ones (how to do exact visibility?);
- it requires a massive amount of CSG operations which are expensive.
I'm looking for a more efficient algorithm.