浏览代码

HDRenderPipeline: Avoid divide by zero in shader + fix typo

/Add-support-for-light-specular-color-tint
sebastienlagarde 7 年前
当前提交
938357d4
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  2. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl

4
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


// Debugging
MaterialPropertyBlock m_SharedPropertyBlock = new MaterialPropertyBlock();
DebugDisplaySettings m_DebugDisplaySettings = new DebugDisplaySettings();
static DebugDisplaySettings s_NeutraDebugDisplaySettings = new DebugDisplaySettings();
static DebugDisplaySettings s_NeutralDebugDisplaySettings = new DebugDisplaySettings();
DebugDisplaySettings m_CurrentDebugDisplaySettings = null;
private int m_DebugFullScreenTempRT;

if (camera.cameraType == CameraType.Reflection || camera.cameraType == CameraType.Preview)
{
// Neutral allow to disable all debug settings
m_CurrentDebugDisplaySettings = s_NeutraDebugDisplaySettings;
m_CurrentDebugDisplaySettings = s_NeutralDebugDisplaySettings;
}
else
{

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl


float verticalDisplacement = maxHeight - height * maxHeight;
// IDEA: precompute the tiling scale? MOV-MUL vs MOV-MOV-MAX-RCP-MUL.
float tilingScale = rcp(max(_BaseColorMap0_ST.x, _BaseColorMap0_ST.y));
return tilingScale * verticalDisplacement / NdotV;
return tilingScale * verticalDisplacement / max(NdotV, 0.001);
}
return 0.0;

正在加载...
取消
保存