浏览代码

Hook up DBuffer manager with RenderTextureDescriptor

/feature-ReflectionProbeFit
Robert Srinivasiah 7 年前
当前提交
37789fec
共有 1 个文件被更改,包括 9 次插入5 次删除
  1. 14
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs

14
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


RenderTargetIdentifier[] m_ColorMRTs;
RenderTargetIdentifier[] m_RTIDs = new RenderTargetIdentifier[k_MaxGbuffer];
//public void InitGBuffers(int width, int height, RenderPipelineMaterial deferredMaterial, bool enableBakeShadowMask, CommandBuffer cmd)
public void InitGBuffers(RenderTextureDescriptor rtDesc, RenderPipelineMaterial deferredMaterial, bool enableBakeShadowMask, CommandBuffer cmd)
{
// Init Gbuffer description

RenderTargetIdentifier[] m_ColorMRTs;
RenderTargetIdentifier[] m_RTIDs = new RenderTargetIdentifier[k_MaxDbuffer];
public void InitDBuffers(int width, int height, CommandBuffer cmd)
public void InitDBuffers(RenderTextureDescriptor rtDesc, CommandBuffer cmd)
{
dbufferCount = Decal.GetMaterialDBufferCount();
RenderTextureFormat[] rtFormat;

rtDesc.depthBufferBits = 0;
cmd.GetTemporaryRT(HDShaderIDs._DBufferTexture[dbufferIndex], width, height, 0, FilterMode.Point, rtFormat[dbufferIndex], rtReadWrite[dbufferIndex]);
rtDesc.colorFormat = rtFormat[dbufferIndex];
rtDesc.sRGB = (rtReadWrite[dbufferIndex] != RenderTextureReadWrite.Linear);
cmd.GetTemporaryRT(HDShaderIDs._DBufferTexture[dbufferIndex], rtDesc, FilterMode.Point);
m_RTIDs[dbufferIndex] = new RenderTargetIdentifier(HDShaderIDs._DBufferTexture[dbufferIndex]);
}
}

if (!camera.useForwardOnly)
{
//m_GbufferManager.InitGBuffers(w, h, m_DeferredMaterial, enableBakeShadowMask, cmd);
m_GbufferManager.InitGBuffers(camera.renderTextureDesc, m_DeferredMaterial, enableBakeShadowMask, cmd);
m_SSSBufferManager.InitGBuffers(w, h, m_GbufferManager, cmd);
}

m_SSSBufferManager.InitGBuffers(w, h, cmd);
}
m_DbufferManager.InitDBuffers(w, h, cmd);
m_DbufferManager.InitDBuffers(camera.renderTextureDesc, cmd);
CoreUtils.SetRenderTarget(cmd, m_CameraColorBufferRT, m_CameraDepthStencilBufferRT, ClearFlag.Depth);
}

正在加载...
取消
保存