浏览代码

Fix color picker mode in forward only shaders.

/StackLit2
Stephane Laroche 6 年前
当前提交
b915d855
共有 1 个文件被更改,包括 14 次插入7 次删除
  1. 21
      com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDRenderPipeline.cs

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


public void ApplyDebugDisplaySettings(HDCamera hdCamera, CommandBuffer cmd)
{
if (m_CurrentDebugDisplaySettings.IsDebugDisplayEnabled() ||
m_CurrentDebugDisplaySettings.colorPickerDebugSettings.colorPickerMode != ColorPickerDebugMode.None)
// See ShaderPassForward.hlsl: for forward shaders, if DEBUG_DISPLAY is enabled and no DebugLightingMode or DebugMipMapMod
// modes have been set, lighting is automatically escaped. This isn't so for shaders supporting deferred. Since the
// colorPickerModes and false color don't need DEBUG_DISPLAY anyway, make those behave like for deferred materials
// by disabling DEBUG_DISPLAY independently of those:
if (m_CurrentDebugDisplaySettings.IsDebugDisplayEnabled())
}
else
{
// TODO: Be sure that if there is no change in the state of this keyword, it doesn't imply any work on CPU side! else we will need to save the sate somewher
cmd.DisableShaderKeyword("DEBUG_DISPLAY");
}
if (m_CurrentDebugDisplaySettings.IsDebugDisplayEnabled() ||
m_CurrentDebugDisplaySettings.colorPickerDebugSettings.colorPickerMode != ColorPickerDebugMode.None)
{
// This is for texture streaming
m_CurrentDebugDisplaySettings.UpdateMaterials();

// The DebugNeedsExposure test allows us to set a neutral value if exposure is not needed. This way we don't need to make various tests inside shaders but only in this function.
cmd.SetGlobalFloat(HDShaderIDs._DebugExposure, m_CurrentDebugDisplaySettings.DebugNeedsExposure() ? lightingDebugSettings.debugExposure : 0.0f);
}
else
{
// TODO: Be sure that if there is no change in the state of this keyword, it doesn't imply any work on CPU side! else we will need to save the sate somewher
cmd.DisableShaderKeyword("DEBUG_DISPLAY");
}
}

正在加载...
取消
保存