|
|
@@ -1360,7 +1360,7 @@ void Renderer::SetupLightBatch(Batch& batch)
|
|
|
if (light->GetNearSplit() <= batch.camera_->GetNearClip())
|
|
|
{
|
|
|
graphics_->SetCullMode(CULL_NONE);
|
|
|
- graphics_->SetDepthTest(CMP_GREATEREQUAL);
|
|
|
+ graphics_->SetDepthTest(CMP_GREATER);
|
|
|
graphics_->SetStencilTest(false);
|
|
|
}
|
|
|
else
|
|
|
@@ -1382,7 +1382,7 @@ void Renderer::SetupLightBatch(Batch& batch)
|
|
|
|
|
|
// Re-enable color write, set test for rendering the actual light
|
|
|
graphics_->SetColorWrite(true);
|
|
|
- graphics_->SetDepthTest(CMP_GREATEREQUAL);
|
|
|
+ graphics_->SetDepthTest(CMP_GREATER);
|
|
|
graphics_->SetStencilTest(true, CMP_EQUAL, OP_ZERO, OP_KEEP, OP_ZERO, 1);
|
|
|
}
|
|
|
}
|
|
|
@@ -1398,7 +1398,7 @@ void Renderer::SetupLightBatch(Batch& batch)
|
|
|
bool drawBackFaces = lightViewDist < (lightExtent + batch.camera_->GetNearClip());
|
|
|
graphics_->SetColorWrite(false);
|
|
|
graphics_->SetCullMode(drawBackFaces ? CULL_CCW : CULL_CW);
|
|
|
- graphics_->SetDepthTest(drawBackFaces ? CMP_GREATEREQUAL : CMP_LESSEQUAL);
|
|
|
+ graphics_->SetDepthTest(drawBackFaces ? CMP_GREATER : CMP_LESS);
|
|
|
graphics_->SetStencilTest(true, CMP_EQUAL, OP_INCR, OP_KEEP, OP_KEEP, 0);
|
|
|
graphics_->SetShaders(stencilVS_, stencilPS_);
|
|
|
graphics_->SetShaderParameter(VSP_VIEWPROJ, projection * view);
|
|
|
@@ -1418,7 +1418,7 @@ void Renderer::SetupLightBatch(Batch& batch)
|
|
|
{
|
|
|
// In this case reverse cull mode & depth test and render back faces
|
|
|
graphics_->SetCullMode(CULL_CW);
|
|
|
- graphics_->SetDepthTest(CMP_GREATEREQUAL);
|
|
|
+ graphics_->SetDepthTest(CMP_GREATER);
|
|
|
graphics_->SetStencilTest(false);
|
|
|
}
|
|
|
else
|
|
|
@@ -1430,7 +1430,7 @@ void Renderer::SetupLightBatch(Batch& batch)
|
|
|
// Set state for stencil rendering
|
|
|
graphics_->SetColorWrite(false);
|
|
|
graphics_->SetCullMode(CULL_CW);
|
|
|
- graphics_->SetDepthTest(CMP_GREATEREQUAL);
|
|
|
+ graphics_->SetDepthTest(CMP_GREATER);
|
|
|
graphics_->SetStencilTest(true, CMP_ALWAYS, OP_INCR, OP_KEEP, OP_KEEP, 1);
|
|
|
graphics_->SetShaders(stencilVS_, stencilPS_);
|
|
|
graphics_->SetShaderParameter(VSP_VIEWPROJ, projection * view);
|