Commit 0942a6d3 authored by Nadro's avatar Nadro

- Fixed some minor problems with zfail shadow volumes (problem with an...

- Fixed some minor problems with zfail shadow volumes (problem with an infinite matrix still exist).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4316 dfc29bdd-3216-0410-991c-e03cc46cb475
parent ff51e313
......@@ -2485,6 +2485,9 @@ void CD3D9Driver::setRenderStatesStencilShadowMode(bool zfail, u32 debugDataVisi
pID3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ZERO );
pID3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE );
pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESS);
//if (!(debugDataVisible & (scene::EDS_SKELETON|scene::EDS_MESH_WIRE_OVERLAY)))
// pID3DDevice->SetRenderState(D3DRS_COLORWRITEENABLE, 0);
if ((debugDataVisible & scene::EDS_MESH_WIRE_OVERLAY))
......
......@@ -3584,7 +3584,7 @@ void COpenGLDriver::drawStencilShadowVolume(const core::array<core::vector3df>&
glDisable(GL_LIGHTING);
glDisable(GL_FOG);
glDepthFunc(GL_LEQUAL);
glDepthFunc(GL_LESS);
glDepthMask(GL_FALSE); // no depth buffer writing
if (debugDataVisible & scene::EDS_MESH_WIRE_OVERLAY)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
......@@ -3598,8 +3598,6 @@ void COpenGLDriver::drawStencilShadowVolume(const core::array<core::vector3df>&
glVertexPointer(3,GL_FLOAT,sizeof(core::vector3df),triangles.const_pointer());
glStencilMask(~0);
glStencilFunc(GL_ALWAYS, 0, ~0);
glPolygonOffset(-1.f,-1.f);
glEnable(GL_POLYGON_OFFSET_FILL);
GLenum incr = GL_INCR;
GLenum decr = GL_DECR;
......
......@@ -112,9 +112,9 @@ u32 CShadowVolumeSceneNode::createEdgesAndCaps(const core::vector3df& light,
os::Printer::log("Allocation too small.", ELL_DEBUG);
#endif
// add front cap from light-facing faces
svp->push_back(v0);
svp->push_back(v1);
svp->push_back(v2);
svp->push_back(v1);
svp->push_back(v0);
// add back cap
svp->push_back(v0+(v0-light).normalize()*Infinity);
......@@ -276,7 +276,6 @@ void CShadowVolumeSceneNode::OnRegisterSceneNode()
}
}
//! renders the node.
void CShadowVolumeSceneNode::render()
{
......@@ -294,7 +293,7 @@ void CShadowVolumeSceneNode::render()
SceneManager->getActiveCamera()->getAspectRatio(),
SceneManager->getActiveCamera()->getNearValue(),
core::ROUNDING_ERROR_f32);
driver->setTransform(video::ETS_PROJECTION, mat);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment