浏览代码

intermediate commit

/main
Paul Melamed 7 年前
当前提交
34a0dcbf
共有 3 个文件被更改,包括 18 次插入4 次删除
  1. 2
      com.unity.render-pipelines.high-definition/HDRP/Decal/DecalSystem.cs
  2. 18
      com.unity.render-pipelines.high-definition/HDRP/HDRenderPipeline.cs
  3. 2
      com.unity.render-pipelines.high-definition/HDRP/HDStringConstants.cs

2
com.unity.render-pipelines.high-definition/HDRP/Decal/DecalSystem.cs


foreach (var pair in m_DecalSets)
{
pair.Value.RenderIntoDBuffer(cmd);
}
}
}
public void SetAtlas(CommandBuffer cmd)

18
com.unity.render-pipelines.high-definition/HDRP/HDRenderPipeline.cs


RenderDepthPrepass(m_CullResults, hdCamera, renderContext, cmd, forcePrepassForDecals);
// This will bind the depth buffer if needed for DBuffer)
RenderDBuffer(hdCamera, cmd);
RenderDBuffer(hdCamera, cmd, renderContext, m_CullResults);
RenderGBuffer(m_CullResults, hdCamera, enableBakeShadowMask, renderContext, cmd);

}
}
void RenderDBuffer(HDCamera hdCamera, CommandBuffer cmd)
void RenderDBuffer(HDCamera hdCamera, CommandBuffer cmd, ScriptableRenderContext renderContext, CullResults cullResults)
{
if (!hdCamera.frameSettings.enableDBuffer)
return;

m_DbufferManager.ClearTargets(cmd, hdCamera);
HDUtils.SetRenderTarget(cmd, hdCamera, m_DbufferManager.GetBuffersRTI(), m_CameraDepthStencilBuffer); // do not clear anymore
m_DbufferManager.SetHTile(m_DbufferManager.bufferCount, cmd);
DecalSystem.instance.RenderIntoDBuffer(cmd);
DrawRendererSettings drawSettings = new DrawRendererSettings(hdCamera.camera, HDShaderPassNames.s_EmptyName)
{
rendererConfiguration = 0,
sorting = { flags = SortFlags.CommonOpaque }
};
drawSettings.SetShaderPassName(0, HDShaderPassNames.s_MeshDecalsName);
FilterRenderersSettings filterRenderersSettings = new FilterRenderersSettings(true)
{
renderQueueRange = HDRenderQueue.k_RenderQueue_AllOpaque
};
renderContext.DrawRenderers(cullResults.visibleRenderers, ref drawSettings, filterRenderersSettings);
// DecalSystem.instance.RenderIntoDBuffer(cmd);
m_DbufferManager.UnSetHTile(cmd);
m_DbufferManager.SetHTileTexture(cmd); // mask per 8x8 tile used for optimization when looking up dbuffer values
}

2
com.unity.render-pipelines.high-definition/HDRP/HDStringConstants.cs


public static readonly string s_TransparentDepthPostpassStr = "TransparentDepthPostpass";
public static readonly string s_MetaStr = "Meta";
public static readonly string s_ShadowCasterStr = "ShadowCaster";
public static readonly string s_MeshDecalsStr = "DBuffer";
// ShaderPass name
public static readonly ShaderPassName s_EmptyName = new ShaderPassName(s_EmptyStr);

public static readonly ShaderPassName s_TransparentDepthPrepassName = new ShaderPassName(s_TransparentDepthPrepassStr);
public static readonly ShaderPassName s_TransparentBackfaceName = new ShaderPassName(s_TransparentBackfaceStr);
public static readonly ShaderPassName s_TransparentDepthPostpassName = new ShaderPassName(s_TransparentDepthPostpassStr);
public static readonly ShaderPassName s_MeshDecalsName = new ShaderPassName(s_MeshDecalsStr);
// Legacy name
public static readonly ShaderPassName s_AlwaysName = new ShaderPassName("Always");

正在加载...
取消
保存