Page 1 of 1

[UNSOLVED] Shadow Volume on non animated meshes?

Posted: Fri Jan 09, 2009 1:08 am
by hach-que
I've tried to modify Irrlicht so I can apply shadow volume nodes to other scene nodes (not just animated meshes). While I've got it compiling, it doesn't work.

Works for animated meshes:
Image

Does not work for normal meshes:
Image

These are the modifications I've made to CCubeSceneNode.h and CCubeSceneNode.cpp, but shadows are still not cast by these objects.

Code Paste

Have to modify the render routine

Posted: Sat Jan 10, 2009 10:00 pm
by robertgarand
Hi,
I think you have to modify the render routine of every node type you want to cast shadow from, in the animatedscenenode source the render routine tests for the shadow scene node so it gets render.

Code: Select all

	if (Shadow && PassCount==1)
		Shadow->setMeshToRenderFrom(m);
regards,
robert

Posted: Sun Jan 11, 2009 5:47 am
by hach-que
I've added that to the nodes, however it's still not working. I'm going to continue looking through the source code to see if I've missed something....

Posted: Wed Jan 14, 2009 6:35 am
by hach-que
I've added PassCount = 0; to the OnRegisterSceneNode function like is done in the animated mesh class, however my application just freezes when I add this function. I presume that this is used to mark the shadow volume node for updating, since when I add it, there are alot of calls to update the shadow volume node, and when it's off, there are no shadows.

Does anyone know why the OnRegisterSceneNode would be called more often for the sphere scene node than the animated mesh scene node?

UPDATE: It doesn't freeze the application, there is just a lag of about 5 minutes while it starts up. The lag at the start is directly proportional to what I set the polycount to (currently 50 * 20 spheres). Once the game starts, it only runs at 12-13FPS on a NVIDIA GeForce 8600 GT. Any idea what I'm doing wrong?

UPDATE: The first time it goes through the scene, it takes 14 seconds to update the shadow volume node for each sphere at a polycount of 50. I have no idea what I'm doing wrong! Animated meshes are fast as anything.