浏览代码

HDRenderPipeline: Fix issue with SSS not correctly enable/disable

/RenderPassXR_Sandbox
Sebastien Lagarde 7 年前
当前提交
23315237
共有 2 个文件被更改,包括 11 次插入9 次删除
  1. 14
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  2. 6
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl

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


else
{
// If SSS is disable, do lighting for both split lighting and no split lighting
if (debugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission)
if (!debugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission)
{
m_SingleDeferredMaterialSRT.SetInt("_StencilRef", (int)StencilLightingUsage.NoLighting);
m_SingleDeferredMaterialSRT.SetInt("_StencilCmp", (int)CompareFunction.NotEqual);

else
{
// If SSS is disable, do lighting for both split lighting and no split lighting
if (debugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission)
if (!debugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission)
m_DeferredDirectMaterialSRT.SetInt("_StencilRef", (int)StencilLightingUsage.NoLighting);
m_DeferredDirectMaterialSRT.SetInt("_StencilCmp", (int)CompareFunction.NotEqual);
m_DeferredIndirectMaterialSRT.SetInt("_StencilRef", (int)StencilLightingUsage.NoLighting);
m_DeferredIndirectMaterialSRT.SetInt("_StencilCmp", (int)CompareFunction.NotEqual);
m_DeferredIndirectMaterialSRT.SetInt("_StencilRef", (int)StencilLightingUsage.RegularLighting);
m_DeferredIndirectMaterialSRT.SetInt("_StencilCmp", (int)CompareFunction.Equal);
m_DeferredDirectMaterialSRT.SetInt("_StencilRef", (int)StencilLightingUsage.RegularLighting);
m_DeferredDirectMaterialSRT.SetInt("_StencilCmp", (int)CompareFunction.Equal);
m_DeferredIndirectMaterialSRT.SetInt("_StencilRef", (int)StencilLightingUsage.RegularLighting);
m_DeferredIndirectMaterialSRT.SetInt("_StencilCmp", (int)CompareFunction.Equal);

else
{
// If SSS is disable, do lighting for both split lighting and no split lighting
if (debugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission)
if (!debugDisplaySettings.renderingDebugSettings.enableSSSAndTransmission)
{
m_DeferredAllMaterialSRT.SetInt("_StencilRef", (int)StencilLightingUsage.NoLighting);
m_DeferredAllMaterialSRT.SetInt("_StencilCmp", (int)CompareFunction.NotEqual);

6
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


bool performPostScatterTexturing = IsBitSet(_TexturingModeFlags, subsurfaceProfile);
#if SHADERPASS != SHADERPASS_LIGHT_TRANSPORT // In case of GI pass don't modify the diffuseColor
#if defined(SHADERPASS) && (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) // In case of GI pass don't modify the diffuseColor
if (0)
#else
#endif
{
// We modify the albedo here as this code is used by all lighting (including light maps and GI).
if (performPostScatterTexturing)

bsdfData.diffuseColor = sqrt(bsdfData.diffuseColor);
}
}
#endif
}
//-----------------------------------------------------------------------------

正在加载...
取消
保存