浏览代码

Merge pull request #820 from Unity-Technologies/Fix-issue-with-SSS

Fix misc issue with sss
/main
GitHub 7 年前
当前提交
8aebdb18
共有 3 个文件被更改,包括 9 次插入1 次删除
  1. 5
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.hlsl
  2. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.shader
  3. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs

5
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.hlsl


bool enableSss = _EnableSubsurfaceScattering != 0;
#endif
if (enableSss)
// We can enter in this function even if SSS is not enabled in case of material classification per tile
// (If there is SSS inside the tile we need to enable the feature for the whole tile with neutral value)
// thus why we test != DIFFUSION_PROFILE_NEUTRAL_ID here, to be sure neutral profile don't affect the scene
if (enableSss && diffusionProfile != DIFFUSION_PROFILE_NEUTRAL_ID)
{
bool performPostScatterTexturing = IsBitSet(asuint(_TexturingModeFlags), diffusionProfile);

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScattering.shader


Properties
{
[HideInInspector] _DstBlend("", Float) = 1 // Can be set to 1 for blending with specular
[HideInInspector] _StencilMask("_StencilMask", Int) = 7
}
SubShader

Stencil
{
ReadMask[_StencilMask]
Ref 1 // StencilLightingUsage.SplitLighting
Comp Equal
Pass Keep

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs


m_SssVerticalFilterPass = CoreUtils.CreateEngineMaterial(hdAsset.renderPipelineResources.subsurfaceScattering);
m_SssVerticalFilterPass.DisableKeyword("SSS_FILTER_HORIZONTAL_AND_COMBINE");
m_SssVerticalFilterPass.SetFloat(HDShaderIDs._DstBlend, (float)BlendMode.Zero);
m_SssVerticalFilterPass.SetInt(HDShaderIDs._StencilMask, (int)HDRenderPipeline.StencilBitMask.LightingMask);
m_SssHorizontalFilterAndCombinePass.SetInt(HDShaderIDs._StencilMask, (int)HDRenderPipeline.StencilBitMask.LightingMask);
m_CopyStencilForSplitLighting = CoreUtils.CreateEngineMaterial(hdAsset.renderPipelineResources.copyStencilBuffer);
m_CopyStencilForSplitLighting.SetInt(HDShaderIDs._StencilRef, (int)StencilLightingUsage.SplitLighting);

正在加载...
取消
保存