Change addShadowVolumeSceneNode to replace the current shadow completely. This allows to change the shadow parameters, such that a call to addShadowVolumeSceneNode will always result in the correct shadow. Note that redundant calls to this method will be quite expensive now, so avoid them.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3477 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
ac1d878aac
commit
8b5ed2bc5f
@ -559,18 +559,18 @@ u32 CAnimatedMeshSceneNode::getMaterialCount() const
|
||||
|
||||
//! Creates shadow volume scene node as child of this node
|
||||
//! and returns a pointer to it.
|
||||
IShadowVolumeSceneNode* CAnimatedMeshSceneNode::addShadowVolumeSceneNode(const IMesh* shadowMesh,
|
||||
s32 id, bool zfailmethod, f32 infinity)
|
||||
IShadowVolumeSceneNode* CAnimatedMeshSceneNode::addShadowVolumeSceneNode(
|
||||
const IMesh* shadowMesh, s32 id, bool zfailmethod, f32 infinity)
|
||||
{
|
||||
if (!SceneManager->getVideoDriver()->queryFeature(video::EVDF_STENCIL_BUFFER))
|
||||
return 0;
|
||||
|
||||
if (Shadow)
|
||||
return Shadow;
|
||||
|
||||
if (!shadowMesh)
|
||||
shadowMesh = Mesh; // if null is given, use the mesh of node
|
||||
|
||||
if (Shadow)
|
||||
Shadow->drop();
|
||||
|
||||
Shadow = new CShadowVolumeSceneNode(shadowMesh, this, SceneManager, id, zfailmethod, infinity);
|
||||
return Shadow;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user