|
|
|
|
|
|
using UnityEngine.Rendering; |
|
|
|
using UnityEngine.Rendering.PostProcessing; |
|
|
|
|
|
|
|
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|
|
|
{ |
|
|
|
|
|
|
bool m_EnableShadowMask = false; |
|
|
|
bool m_SupportShadowMask = false; |
|
|
|
RenderPipelineMaterial m_DeferredMaterial; |
|
|
|
protected RenderTargetIdentifier[] m_RTIDsNoShadowMask; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_DeferredMaterial = deferredMaterial; |
|
|
|
m_GBufferCount = deferredMaterial.GetMaterialGBufferCount(); |
|
|
|
m_EnableShadowMask = enableBakeShadowMask; |
|
|
|
m_SupportShadowMask = enableBakeShadowMask; |
|
|
|
|
|
|
|
m_RTIDsNoShadowMask = new RenderTargetIdentifier[m_GBufferCount]; |
|
|
|
} |
|
|
|
|
|
|
m_RTIDsNoShadowMask[gbufferIndex] = HDShaderIDs._GBufferTexture[gbufferIndex]; |
|
|
|
} |
|
|
|
|
|
|
|
if (m_EnableShadowMask) |
|
|
|
if (m_SupportShadowMask) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public override void BindBufferAsTextures(CommandBuffer cmd) |
|
|
|
{ |
|
|
|
for (int i = 0; i < m_BufferCount; ++i) |
|
|
|
{ |
|
|
|
cmd.SetGlobalTexture(m_TextureShaderIDs[i], m_RTs[i]); |
|
|
|
} |
|
|
|
|
|
|
|
// When shadow mask are disabled (i.e we haven't created shadow mask texture, bind a white texture).
|
|
|
|
if (!m_SupportShadowMask) |
|
|
|
{ |
|
|
|
cmd.SetGlobalTexture(HDShaderIDs._ShadowMaskTexture, RuntimeUtilities.whiteTexture); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|