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:
Does not work for normal meshes:
These are the modifications I've made to CCubeSceneNode.h and CCubeSceneNode.cpp, but shadows are still not cast by these objects.
Code Paste
[UNSOLVED] Shadow Volume on non animated meshes?
[UNSOLVED] Shadow Volume on non animated meshes?
Last edited by hach-que on Wed Jan 14, 2009 8:13 am, edited 2 times in total.
-
- Posts: 69
- Joined: Fri Feb 22, 2008 6:47 pm
- Location: montreal
- Contact:
Have to modify the render routine
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.
regards,
robert
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);
robert
If it can't be writen, it can't exist
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.
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.