[UNSOLVED] Shadow Volume on non animated meshes?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
hach-que
Posts: 33
Joined: Thu Apr 19, 2007 10:11 am
Location: Australia

[UNSOLVED] Shadow Volume on non animated meshes?

Post 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
Last edited by hach-que on Wed Jan 14, 2009 8:13 am, edited 2 times in total.
robertgarand
Posts: 69
Joined: Fri Feb 22, 2008 6:47 pm
Location: montreal
Contact:

Have to modify the render routine

Post 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
If it can't be writen, it can't exist
hach-que
Posts: 33
Joined: Thu Apr 19, 2007 10:11 am
Location: Australia

Post 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....
hach-que
Posts: 33
Joined: Thu Apr 19, 2007 10:11 am
Location: Australia

Post 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.
Post Reply