Hulls Instead of Simplification

In a previous post I described the problems associated with mesh simplification with a multi-textured mesh and how this wasn’t proving to be a good solution to simplifying distant objects.

I came across this excellent library today MIConvexHull which has some excellent and fast c# routines for finding the convex hull of a 3D shape, also with useful libraries for triangulation of point clouds.

Hulls as Shadow Casters

My intention initially was to use a Hull of any mesh during the shadow drawing phase of my scene. To recap – when you draw a shadow casting object you actually have to render your entire scene twice, once to store the distance from the light source of each pixel in the scene, then again with the actual objects, but calculating the difference in distance from the camera by using the previously stored bitmap. Its complex, but for the purposes of this post its enough to re-iterate that this means each shadow casting object needs to be rendered twice for each scene.

Without being able to simplify my meshes I wanted to use the Hull of my objects (typically trees and houses) during the shadow casting draw phase to cut down on the cost of drawing their shadows. If I could draw just a solid Hull shape, this would be good enough for tree and building shadows.

image

This picture shows the hulls artificially rendered over the top of the meshes to show the effect I was after. The shadows are a bit vague in this shot, but they are there,

Here again, but for houses.

image

Above; expensive shadows generated from full meshes

image

Above; cheap shadows generated from hull meshes, showing the hulls as well.

A nice speed boost to my shadow rendering code.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s