Sign in to follow this  
Trandafira

Problem: Rotating objects with Shadow Volumes

Recommended Posts

I have implemented shadow volumes, however, whenever an object rotates, the shadow does not rotate with it. At the moment i calculate the contour edges by placing the light in object space... This is the only thing that i can see as the problem, but to fix this the only way i can think of is transforming each vertex of the mesh into world space... Is there any other way anyone can think of that would be more efficient?

Share this post


Link to post
Share on other sites
I had this problem when I first implemented SV's a few years back. I seem to remember it was a case of transforming the light into model space before doing the extrusion on the CPU.

As you pointed out, you really don't want to be transforming *every* vertex on the CPU before doing extrusion calculations. Instead, just transform the light vector(s) by the inverse world matrix (or whatever is appropriate) and you should be sorted [grin]

hth
Jack

Share this post


Link to post
Share on other sites
That makes sense... However, I've just reached a bigger, scarier problem that i should have noticed sooner.

I'm calculating the contour edges of an entity that has more than one mesh... so thinking about it, the contour edges of each seperate part of this entity will have different contour edges than what the whole would have if it was joined together... I'm not sure how i can fix this. The only thing i could think of would be cloning the first mesh and make the vertex buffer big enough to hold every other meshes vertices and check for contour edges with that.. However this (like my last solution) doesn't sound very efficient and I'm not sure how well it would work.

Anyway, thanks for the help jollyjeffers.


-Jono

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this