还原水插件
This commit is contained in:
@@ -30,6 +30,12 @@ namespace WaveHarmonic.Crest
|
||||
CopyShadowMapBuffer?.Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!WaterRenderer.IsWithinEditorUpdate)
|
||||
{
|
||||
CopyShadowMapBuffer?.Clear();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
var water = _Water;
|
||||
@@ -44,12 +50,7 @@ namespace WaveHarmonic.Crest
|
||||
return;
|
||||
}
|
||||
|
||||
if (_Water.Reflections.ReflectionCamera == camera)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (CopyShadowMapBuffer != null)
|
||||
if (camera == water.Viewer && CopyShadowMapBuffer != null)
|
||||
{
|
||||
if (_Light != null)
|
||||
{
|
||||
@@ -82,15 +83,36 @@ namespace WaveHarmonic.Crest
|
||||
CopyShadowMapBuffer?.Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!WaterRenderer.IsWithinEditorUpdate)
|
||||
{
|
||||
CopyShadowMapBuffer?.Clear();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// CBs added to a light are executed for every camera, but the LOD data is only
|
||||
// supports a single camera. Removing the CB after the camera renders restricts the
|
||||
// CB to one camera. Careful of recursive rendering for planar reflections, as it
|
||||
// executes a camera within this camera's frame.
|
||||
if (_Light != null && CopyShadowMapBuffer != null)
|
||||
var water = _Water;
|
||||
|
||||
if (water == null)
|
||||
{
|
||||
_Light.RemoveCommandBuffer(LightEvent.BeforeScreenspaceMask, CopyShadowMapBuffer);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!WaterRenderer.ShouldRender(camera, water.Surface.Layer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (camera == water.Viewer)
|
||||
{
|
||||
// CBs added to a light are executed for every camera, but the LOD data is only
|
||||
// supports a single camera. Removing the CB after the camera renders restricts the
|
||||
// CB to one camera. Careful of recursive rendering for planar reflections, as it
|
||||
// executes a camera within this camera's frame.
|
||||
if (_Light != null && CopyShadowMapBuffer != null)
|
||||
{
|
||||
_Light.RemoveCommandBuffer(LightEvent.BeforeScreenspaceMask, CopyShadowMapBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user