i once more have a question i hope you guys can help me with.
Please have a look at the following Screenshots of a simple AnimatedMeshSceneNode in a scene with one light source:
After adding an IShadowVolumeSceneNode the SceneNode looks like this:
Please note the hard transition from bright to dark parts of the SceneNode. Additionally, the shadow doesn't seem to be correct (it should be a UV Sphere, but looks more like an
Icosphere in Blender terms) The system is Windows 7 with mingw and OpenGL, i exported the mesh from Blender 2.6 with Gandalfs B3D exporter (exporting normals enabled).
Here is the code i used to create the scene:
Code: Select all
camera = sceneManager->addCameraSceneNode(0, vector3df(30, 20, 0), vector3df(0, 10, -10), 0);
sceneManager->setAmbientLight(SColor(200, 120, 120, 120));
sceneManager->addLightSceneNode(0, vector3df(0, 20, -10), SColor(0, 120, 120, 120), 40, 0);
scene::IAnimatedMesh* mesh = sceneManager->getMesh("models/sphere.b3d");
IAnimatedMeshSceneNode *node = 0;
if (mesh) {
node = sceneManager->addAnimatedMeshSceneNode(mesh);
node->setScale(vector3df(4, 4, 4));
node->setPosition(vector3df(0, 10, 0));
node->setMaterialFlag(EMF_LIGHTING, true);
node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
// This line is the only difference between the two screenshots.
node->addShadowVolumeSceneNode();
}
Thanks
Andreas