|
|
|
|
|
|
|
|
|
|
Resize(hdCamera); |
|
|
|
|
|
|
|
if (m_CurrentDebugDisplaySettings.IsDebugDisplayEnabled() || m_CurrentDebugDisplaySettings.fullScreenDebugMode != FullScreenDebugMode.None) |
|
|
|
{ |
|
|
|
ApplyDebugDisplaySettings(hdCamera, cmd); |
|
|
|
} |
|
|
|
|
|
|
|
ApplyDebugDisplaySettings(hdCamera, cmd); |
|
|
|
UpdateShadowSettings(); |
|
|
|
|
|
|
|
// TODO: Float HDCamera setup higher in order to pass stereo into GetCullingParameters
|
|
|
|
|
|
|
|
|
|
|
public void ApplyDebugDisplaySettings(HDCamera hdCamera, CommandBuffer cmd) |
|
|
|
{ |
|
|
|
m_ShadowSettings.enabled = m_FrameSettings.enableShadow; |
|
|
|
if (m_CurrentDebugDisplaySettings.IsDebugDisplayEnabled() || |
|
|
|
m_CurrentDebugDisplaySettings.fullScreenDebugMode != FullScreenDebugMode.None || |
|
|
|
m_CurrentDebugDisplaySettings.colorPickerDebugSettings.colorPickerMode != ColorPickerDebugMode.None) |
|
|
|
{ |
|
|
|
m_ShadowSettings.enabled = m_FrameSettings.enableShadow; |
|
|
|
var lightingDebugSettings = m_CurrentDebugDisplaySettings.lightingDebugSettings; |
|
|
|
var debugAlbedo = new Vector4(lightingDebugSettings.debugLightingAlbedo.r, lightingDebugSettings.debugLightingAlbedo.g, lightingDebugSettings.debugLightingAlbedo.b, 0.0f); |
|
|
|
var debugSmoothness = new Vector4(lightingDebugSettings.overrideSmoothness ? 1.0f : 0.0f, lightingDebugSettings.overrideSmoothnessValue, 0.0f, 0.0f); |
|
|
|
var lightingDebugSettings = m_CurrentDebugDisplaySettings.lightingDebugSettings; |
|
|
|
var debugAlbedo = new Vector4(lightingDebugSettings.debugLightingAlbedo.r, lightingDebugSettings.debugLightingAlbedo.g, lightingDebugSettings.debugLightingAlbedo.b, 0.0f); |
|
|
|
var debugSmoothness = new Vector4(lightingDebugSettings.overrideSmoothness ? 1.0f : 0.0f, lightingDebugSettings.overrideSmoothnessValue, 0.0f, 0.0f); |
|
|
|
cmd.SetGlobalInt(HDShaderIDs._DebugViewMaterial, (int)m_CurrentDebugDisplaySettings.GetDebugMaterialIndex()); |
|
|
|
cmd.SetGlobalInt(HDShaderIDs._DebugLightingMode, (int)m_CurrentDebugDisplaySettings.GetDebugLightingMode()); |
|
|
|
cmd.SetGlobalInt(HDShaderIDs._DebugMipMapMode, (int)m_CurrentDebugDisplaySettings.GetDebugMipMapMode()); |
|
|
|
cmd.SetGlobalVector(HDShaderIDs._DebugLightingAlbedo, debugAlbedo); |
|
|
|
cmd.SetGlobalInt(HDShaderIDs._DebugViewMaterial, (int)m_CurrentDebugDisplaySettings.GetDebugMaterialIndex()); |
|
|
|
cmd.SetGlobalInt(HDShaderIDs._DebugLightingMode, (int)m_CurrentDebugDisplaySettings.GetDebugLightingMode()); |
|
|
|
cmd.SetGlobalInt(HDShaderIDs._DebugMipMapMode, (int)m_CurrentDebugDisplaySettings.GetDebugMipMapMode()); |
|
|
|
cmd.SetGlobalVector(HDShaderIDs._DebugLightingAlbedo, debugAlbedo); |
|
|
|
cmd.SetGlobalVector(HDShaderIDs._DebugLightingSmoothness, debugSmoothness); |
|
|
|
cmd.SetGlobalVector(HDShaderIDs._DebugLightingSmoothness, debugSmoothness); |
|
|
|
Vector2 mousePixelCoord = MousePositionDebug.instance.GetMousePosition(hdCamera.screenSize.y); |
|
|
|
var mouseParam = new Vector4(mousePixelCoord.x, mousePixelCoord.y, mousePixelCoord.x / hdCamera.screenSize.x, mousePixelCoord.y / hdCamera.screenSize.y); |
|
|
|
cmd.SetGlobalVector(HDShaderIDs._MousePixelCoord, mouseParam); |
|
|
|
Vector2 mousePixelCoord = MousePositionDebug.instance.GetMousePosition(hdCamera.screenSize.y); |
|
|
|
var mouseParam = new Vector4(mousePixelCoord.x, mousePixelCoord.y, mousePixelCoord.x / hdCamera.screenSize.x, mousePixelCoord.y / hdCamera.screenSize.y); |
|
|
|
cmd.SetGlobalVector(HDShaderIDs._MousePixelCoord, mouseParam); |
|
|
|
cmd.SetGlobalTexture(HDShaderIDs._DebugFont, m_Asset.renderPipelineResources.debugFontTexture); |
|
|
|
cmd.SetGlobalTexture(HDShaderIDs._DebugFont, m_Asset.renderPipelineResources.debugFontTexture); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void PushColorPickerDebugTexture(CommandBuffer cmd, RenderTargetIdentifier textureID, HDCamera hdCamera) |
|
|
|