Thank you for the suggests.
I tried to simplify my problem.
Code: Select all
scnMgr->setShadowTechnique(ShadowTechnique::SHADOWTYPE_TEXTURE_ADDITIVE);
Entity* ogreEntity3 = scnMgr->createEntity("ogrehead.mesh");
SceneNode* ogreNode3 = scnMgr->getRootSceneNode()->createChildSceneNode();
ogreNode3->setPosition(0, 104, 0);
ogreNode3->attachObject(ogreEntity3);
Plane plane(Vector3::UNIT_Y, 0);
MeshManager::getSingleton().createPlane(
"ground", RGN_DEFAULT,
plane,
1500, 1500, 20, 20,
true,
1, 5, 5,
Vector3::UNIT_Z);
Entity* groundEntity = scnMgr->createEntity("ground");
scnMgr->getRootSceneNode()->createChildSceneNode()->attachObject(groundEntity);
groundEntity->setCastShadows(true);
Light* dirLight = scnMgr->createLight(Light::LT_DIRECTIONAL);
SceneNode* dirLightNode = scnMgr->getRootSceneNode()->createChildSceneNode();
dirLightNode->attachObject(dirLight);
dirLightNode->setDirection(-1, -1, 0);
dirLightNode->setPosition(Vector3(200, 200, 0)):
with shadow Techique "SHADOWTYPE_TEXTURE_ADDITIVE" or SHADOWTYPE_TEXTURE_MODULATIVE shadows aren't displayed
if I set groundEntity->setCastShadows(false) shadows are displayed correctly
Edit 1
if I set
Code: Select all
scnMgr->setShadowTextureSelfShadow(true);
shadow texture appear but entity (head ogre) go in shadow.What am I missing?
TEXTURE_MODULATIVE:
STENCIL_MODULATIVE: