浏览代码

HDRenderPipeline: Fix misc issue introduce during the clean of debug mode clean

/Branch_batcher
sebastienlagarde 8 年前
当前提交
67b47dd9
共有 6 个文件被更改,包括 36 次插入10 次删除
  1. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Resources/Deferred.shader
  2. 26
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  3. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  4. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  5. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
  6. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Resources/Deferred.shader


float4 value;
// f we haven't touch result, we don't blend it. This allow to have the GBuffer debug pass working with the regular forward debug pass.
// If we haven't touch result, we don't blend it. This allow to have the GBuffer debug pass working with the regular forward debug pass.
// The forward debug pass will write its value and then the deferred will overwrite only touched texels.
if (result.x == -666.0)
{

// Note: When DEBUG_DISPLAY is on for DEBUGDISPLAYMODE_VIEW_MATERIAL there is no OUTPUT_SPLIT_LIGHTING
#ifdef OUTPUT_SPLIT_LIGHTING
outputs.specularLighting = value;
outputs.diffuseLighting = float4(0.0, 0.0, 0.0, 0.0); // Not used
outputs.diffuseLighting = float4(0.0, 0.0, 0.0, 0.0);
#else
outputs.combinedLighting = value;
#endif

26
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs


Material m_DeferredIndirectMaterialSRT = null;
Material m_DeferredIndirectMaterialMRT = null;
Material m_DeferredAllMaterialSRT = null;
Material m_DeferredViewMaterial = null; // Only use for DisplayDebug view material
Material m_DeferredAllMaterialMRT = null;
Material m_DebugViewTilesMaterial = null;

m_DeferredAllMaterialSRT.SetInt("_SrcBlend", (int)BlendMode.One);
m_DeferredAllMaterialSRT.SetInt("_DstBlend", (int)BlendMode.Zero);
m_DeferredViewMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
Utilities.SelectKeyword(m_DeferredViewMaterial, tileKeywords, 2);
m_DeferredViewMaterial.EnableKeyword("LIGHTLOOP_TILE_PASS");
m_DeferredViewMaterial.DisableKeyword("OUTPUT_SPLIT_LIGHTING");
m_DeferredViewMaterial.EnableKeyword("DEBUG_DISPLAY");
m_DeferredViewMaterial.SetInt("_StencilRef", 0);
m_DeferredViewMaterial.SetInt("_StencilCmp", 4 /* LEqual */);
m_DeferredViewMaterial.SetInt("_SrcBlend", (int)BlendMode.SrcAlpha);
m_DeferredViewMaterial.SetInt("_DstBlend", (int)BlendMode.OneMinusSrcAlpha);
m_DeferredAllMaterialMRT = Utilities.CreateEngineMaterial("Hidden/HDRenderPipeline/Deferred");
Utilities.SelectKeyword(m_DeferredAllMaterialMRT, tileKeywords, 2);
m_DeferredAllMaterialMRT.EnableKeyword("LIGHTLOOP_TILE_PASS");

Utilities.Destroy(m_DeferredIndirectMaterialSRT);
Utilities.Destroy(m_DeferredIndirectMaterialMRT);
Utilities.Destroy(m_DeferredAllMaterialSRT);
Utilities.Destroy(m_DeferredViewMaterial);
Utilities.Destroy(m_DeferredAllMaterialMRT);
Utilities.Destroy(m_DebugViewTilesMaterial);

var camera = hdCamera.camera;
SetupDebugDisplayMode(debugDisplaySettings.IsDebugDisplayEnable());
// If we visualize material properties we do only one pass with a specific blend mode
if (debugDisplaySettings.debugDisplayMode == DebugDisplayMode.ViewMaterial)
{
Utilities.SelectKeyword(m_DeferredViewMaterial, "USE_CLUSTERED_LIGHTLIST", "USE_FPTL_LIGHTLIST", bUseClusteredForDeferred); // Not used, but setup it to avoid corruption just in case
Utilities.DrawFullScreen(cmd, m_DeferredViewMaterial, hdCamera, colorBuffers, depthStencilBuffer);
SetGlobalPropertyRedirect(null, 0, null);
renderContext.ExecuteCommandBuffer(cmd);
cmd.Dispose();
return;
}
if (!m_PassSettings.enableTileAndCluster)
{

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader


Pass
{
Name "GBufferDisplayDebug" // Name is not used
Tags{ "LightMode" = "GBufferDisplayDebug" } // This will be only for opaque object based on the RenderQueue index
Name "GBufferDebugDisplay" // Name is not used
Tags{ "LightMode" = "GBufferDebugDisplay" } // This will be only for opaque object based on the RenderQueue index
Cull [_CullMode]

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader


Pass
{
Name "GBufferDisplayDebug" // Name is not used
Tags{ "LightMode" = "GBufferDisplayDebug" } // This will be only for opaque object based on the RenderQueue index
Name "GBufferDebugDisplay" // Name is not used
Tags{ "LightMode" = "GBufferDebugDisplay" } // This will be only for opaque object based on the RenderQueue index
Cull [_CullMode]

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader


Pass
{
Name "GBufferDisplayDebug" // Name is not used
Tags{ "LightMode" = "GBufferDisplayDebug" } // This will be only for opaque object based on the RenderQueue index
Name "GBufferDebugDisplay" // Name is not used
Tags{ "LightMode" = "GBufferDebugDisplay" } // This will be only for opaque object based on the RenderQueue index
Cull [_CullMode]

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader


Pass
{
Name "GBufferDisplayDebug" // Name is not used
Tags{ "LightMode" = "GBufferDisplayDebug" } // This will be only for opaque object based on the RenderQueue index
Name "GBufferDebugDisplay" // Name is not used
Tags{ "LightMode" = "GBufferDebugDisplay" } // This will be only for opaque object based on the RenderQueue index
Cull [_CullMode]

正在加载...
取消
保存