diff --git a/Packages/sh.orels.shaders.generator/Runtime/Sources/Functions/PBR/FragmentBase.orlsource b/Packages/sh.orels.shaders.generator/Runtime/Sources/Functions/PBR/FragmentBase.orlsource index 291c5d1..db59fc4 100644 --- a/Packages/sh.orels.shaders.generator/Runtime/Sources/Functions/PBR/FragmentBase.orlsource +++ b/Packages/sh.orels.shaders.generator/Runtime/Sources/Functions/PBR/FragmentBase.orlsource @@ -4,6 +4,13 @@ [Enum(UnityEngine.Rendering.CullMode)]_CullMode("Culling Mode", Int) = 2 [Enum(Off, 0, On, 1)]_ZWrite("Depth Write", Int) = 1 [Enum(UnityEngine.Rendering.CompareFunction)]_ZTest("Depth Test", Int) = 4 + UI_AdvancedSettingsStancilHeader("## Stencils", Int) = 1 + [IntRange]_StencilRef("Reference", Range(0, 255)) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)]_StencilComp("Comparison", Float) = 8 + [Enum(UnityEngine.Rendering.StencilOp)]_StencilPassOp("Pass Operation", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)]_StencilFailOp("Fail Operation", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)]_StencilZFailOp("ZFail Operation", Float) = 0 + UI_GSAAHeader("## GSAA", Float) = 0 [Toggle(GSAA)]_EnableGSAA("GSAA Enabled", Int) = 1 UI_GSAANote("> GSAA dramatically reduces specular aliasing", Int) = 0 diff --git a/Packages/sh.orels.shaders.generator/Runtime/Sources/Templates/PBR.orltemplate b/Packages/sh.orels.shaders.generator/Runtime/Sources/Templates/PBR.orltemplate index 41c7ced..144ce4b 100644 --- a/Packages/sh.orels.shaders.generator/Runtime/Sources/Templates/PBR.orltemplate +++ b/Packages/sh.orels.shaders.generator/Runtime/Sources/Templates/PBR.orltemplate @@ -10,6 +10,18 @@ ZTest[_ZTest] ZWrite[_ZWrite] Cull[_CullMode] + + %TemplateFeature("Stencil") + { + Stencil + { + Ref [_StencilRef] + Comp [_StencilComp] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + } %ShaderModifiers diff --git a/Packages/sh.orels.shaders/Runtime/Shaders/ORL Standard.orlshader b/Packages/sh.orels.shaders/Runtime/Shaders/ORL Standard.orlshader index f15d0d7..f6d062b 100644 --- a/Packages/sh.orels.shaders/Runtime/Shaders/ORL Standard.orlshader +++ b/Packages/sh.orels.shaders/Runtime/Shaders/ORL Standard.orlshader @@ -1,4 +1,5 @@ -%ShaderName("orels1/Standard") +%ShaderName("orels1/Standard") +%TemplateFeatures("Stencil") %CustomEditor("ORL.ShaderInspector.InspectorGUI") %Properties()