Fix depth function
This commit is contained in:
@@ -98,7 +98,11 @@ bool LightPass::setupResources()
|
||||
psDesc.CullMode = CullMode::Normal;
|
||||
if (_psLightPoint.Create(psDesc, shader, "PS_Point"))
|
||||
return true;
|
||||
#if FLAX_REVERSE_Z
|
||||
psDesc.DepthFunc = ComparisonFunc::Less;
|
||||
#else
|
||||
psDesc.DepthFunc = ComparisonFunc::Greater;
|
||||
#endif
|
||||
psDesc.CullMode = CullMode::Inverted;
|
||||
if (_psLightPointInside.Create(psDesc, shader, "PS_Point"))
|
||||
return true;
|
||||
@@ -113,7 +117,11 @@ bool LightPass::setupResources()
|
||||
psDesc.CullMode = CullMode::Normal;
|
||||
if (_psLightSpot.Create(psDesc, shader, "PS_Spot"))
|
||||
return true;
|
||||
#if FLAX_REVERSE_Z
|
||||
psDesc.DepthFunc = ComparisonFunc::Less;
|
||||
#else
|
||||
psDesc.DepthFunc = ComparisonFunc::Greater;
|
||||
#endif
|
||||
psDesc.CullMode = CullMode::Inverted;
|
||||
if (_psLightSpotInside.Create(psDesc, shader, "PS_Spot"))
|
||||
return true;
|
||||
@@ -129,7 +137,11 @@ bool LightPass::setupResources()
|
||||
psDesc.CullMode = CullMode::Normal;
|
||||
if (_psLightSky->Init(psDesc))
|
||||
return true;
|
||||
#if FLAX_REVERSE_Z
|
||||
psDesc.DepthFunc = ComparisonFunc::Less;
|
||||
#else
|
||||
psDesc.DepthFunc = ComparisonFunc::Greater;
|
||||
#endif
|
||||
psDesc.CullMode = CullMode::Inverted;
|
||||
if (_psLightSkyInside->Init(psDesc))
|
||||
return true;
|
||||
|
||||
@@ -301,7 +301,11 @@ bool ReflectionsPass::setupResources()
|
||||
psDesc.DepthEnable = true;
|
||||
if (_psProbe->Init(psDesc))
|
||||
return true;
|
||||
#if FLAX_REVERSE_Z
|
||||
psDesc.DepthFunc = ComparisonFunc::Less;
|
||||
#else
|
||||
psDesc.DepthFunc = ComparisonFunc::Greater;
|
||||
#endif
|
||||
psDesc.CullMode = CullMode::Inverted;
|
||||
if (_psProbeInside->Init(psDesc))
|
||||
return true;
|
||||
|
||||
@@ -532,7 +532,11 @@ bool ShadowsPass::setupResources()
|
||||
psDesc.CullMode = CullMode::Normal;
|
||||
if (_psShadowPoint.Create(psDesc, shader, "PS_PointLight"))
|
||||
return true;
|
||||
#if FLAX_REVERSE_Z
|
||||
psDesc.DepthFunc = ComparisonFunc::Less;
|
||||
#else
|
||||
psDesc.DepthFunc = ComparisonFunc::Greater;
|
||||
#endif
|
||||
psDesc.CullMode = CullMode::Inverted;
|
||||
if (_psShadowPointInside.Create(psDesc, shader, "PS_PointLight"))
|
||||
return true;
|
||||
@@ -546,7 +550,11 @@ bool ShadowsPass::setupResources()
|
||||
psDesc.CullMode = CullMode::Normal;
|
||||
if (_psShadowSpot.Create(psDesc, shader, "PS_SpotLight"))
|
||||
return true;
|
||||
#if FLAX_REVERSE_Z
|
||||
psDesc.DepthFunc = ComparisonFunc::Less;
|
||||
#else
|
||||
psDesc.DepthFunc = ComparisonFunc::Greater;
|
||||
#endif
|
||||
psDesc.CullMode = CullMode::Inverted;
|
||||
if (_psShadowSpotInside.Create(psDesc, shader, "PS_SpotLight"))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user