Not getting any shadows on terrain

ta2025

08-10-2006 16:30:59

Im trying to add shadows to my project and Im following the examples right out of the Second Beginner Tutorial.

As soon as I pick the shadowtype, my framerates fall from 200+ fps down to 15fps, but the trees are not casting shadows on my terrain.

Is there a way to not have such a speed degradation and do I need to do anything in the terrain.cfg to enable shadows?


sceneManager.AmbientLight = (0.0, 0.0, 0.0)
sceneManager.shadowTechnique = ogre.SHADOWTYPE_STENCIL_ADDITIVE

...


light = sceneManager.createLight("light1")
light.type = ogre.Light.LT_DIRECTIONAL
light.diffuseColour = (1,1,1)
light.specularColour = (1,1,1)
light.direction = (0,-1,1)

...

tree = sceneManager.createEntity('palm' + str(t), 'palm' + str(mesh[treeN-1]) + '.mesh')
tree.setMaterialName('palm' + str(mesh[treeN-1]) + '.material')
tree.castShadows = True

treeNode = sceneManager.rootSceneNode.createChildSceneNode('treeN'+str(t))
treeNode.attachObject(tree)

...



I get 500 trees on my island, just no shadows.

dermont

08-10-2006 18:53:28

Try searching the main Ogre forum, you'll probably find the answer there in posts such as:
http://www.ogre3d.org/phpBB2/viewtopic. ... st+shadows
http://www.ogre3d.org/phpBB2/viewtopic. ... st+shadows