|
|
|
|
|
|
using System; |
|
|
|
using UnityEngine; |
|
|
|
using UnityEngine.Rendering; |
|
|
|
using UnityEngine.Experimental.Rendering.HDPipeline; |
|
|
|
|
|
|
|
namespace UnityEditor.Experimental.Rendering.HDPipeline |
|
|
|
{ |
|
|
|
|
|
|
SetKeyword(material, "_DEPTHOFFSET_ON", depthOffsetEnable); |
|
|
|
|
|
|
|
// Set the reference value for the stencil test.
|
|
|
|
int stencilRef = (int)UnityEngine.Experimental.Rendering.HDPipeline.StencilBits.Standard; |
|
|
|
int stencilRef = (int)StencilBits.NonSSS; |
|
|
|
stencilRef = 1 + (int)material.GetFloat(kMaterialID); |
|
|
|
if ((int)material.GetFloat(kMaterialID) == (int)UnityEngine.Experimental.Rendering.HDPipeline.Lit.MaterialId.LitSSS) |
|
|
|
{ |
|
|
|
stencilRef = (int)StencilBits.SSS; |
|
|
|
} |
|
|
|
} |
|
|
|
material.SetInt(kStencilRef, stencilRef); |
|
|
|
|
|
|
|