升级6.4.升级水,升级天气
This commit is contained in:
@@ -20,6 +20,9 @@ namespace WaveHarmonic.Crest
|
||||
readonly System.Action<CommandBuffer> _CopyColorTexture;
|
||||
readonly System.Action<CommandBuffer> _SetRenderTargetToBackBuffers;
|
||||
|
||||
bool _AllocatedColor;
|
||||
GraphicsFormat _GraphicsFormat;
|
||||
|
||||
public UnderwaterEffectPass(UnderwaterRenderer renderer)
|
||||
{
|
||||
_Renderer = renderer;
|
||||
@@ -40,7 +43,9 @@ namespace WaveHarmonic.Crest
|
||||
|
||||
public void Allocate(GraphicsFormat format)
|
||||
{
|
||||
if (_Renderer.RenderBeforeTransparency && !_Renderer._NeedsColorTexture)
|
||||
_GraphicsFormat = format;
|
||||
|
||||
if (_Renderer.RenderBeforeTransparency && !_Renderer.NeedsColorTexture)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -57,11 +62,13 @@ namespace WaveHarmonic.Crest
|
||||
wrapMode: TextureWrapMode.Clamp,
|
||||
name: "_Crest_UnderwaterCameraColorTexture"
|
||||
);
|
||||
|
||||
_AllocatedColor = true;
|
||||
}
|
||||
|
||||
public void ReAllocate(RenderTextureDescriptor descriptor)
|
||||
{
|
||||
if (_Renderer.RenderBeforeTransparency && !_Renderer._NeedsColorTexture)
|
||||
if (_Renderer.RenderBeforeTransparency && !_Renderer.NeedsColorTexture)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -83,8 +90,13 @@ namespace WaveHarmonic.Crest
|
||||
_ColorTarget = color;
|
||||
_DepthTarget = depth;
|
||||
|
||||
if (!_Renderer.RenderBeforeTransparency || _Renderer._NeedsColorTexture)
|
||||
if (!_Renderer.RenderBeforeTransparency || _Renderer.NeedsColorTexture)
|
||||
{
|
||||
if (!_AllocatedColor)
|
||||
{
|
||||
Allocate(_GraphicsFormat);
|
||||
}
|
||||
|
||||
buffer.SetGlobalTexture(UnderwaterRenderer.ShaderIDs.s_CameraColorTexture, _ColorTexture);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user