Removed the dependency of RenderingLayerMask in UTSOutlinePass;

This commit is contained in:
Misaki
2024-11-20 17:01:24 +09:00
parent 52469649de
commit 60631f558f
9 changed files with 165 additions and 195 deletions

View File

@@ -1646,34 +1646,34 @@ namespace UnityEditor.Rendering.Toon
switch (m_shadowMode)
{
case ShadowMode.Normal:
{
material.SetFloat(ShaderPropShadowMode, (int)ShadowMode.Normal);
material.DisableKeyword(new LocalKeyword(material.shader, "_SDFShadow"));
{
material.SetFloat(ShaderPropShadowMode, (int)ShadowMode.Normal);
material.DisableKeyword(new LocalKeyword(material.shader, "_SDFShadow"));
GUI_RangeProperty(material, Styles.shaderProp1st_ShadeColor_StepText);
GUI_RangeProperty(material, Styles.shaderProp1st_ShadeColor_FeatherText);
GUI_RangeProperty(material, Styles.shaderProp2nd_ShadeColor_StepText);
GUI_RangeProperty(material, Styles.shaderProp2nd_ShadeColor_FeatherText);
GUI_RangeProperty(material, Styles.shaderProp1st_ShadeColor_StepText);
GUI_RangeProperty(material, Styles.shaderProp1st_ShadeColor_FeatherText);
GUI_RangeProperty(material, Styles.shaderProp2nd_ShadeColor_StepText);
GUI_RangeProperty(material, Styles.shaderProp2nd_ShadeColor_FeatherText);
//Share variables with DoubleWithFeather method.
material.SetFloat(ShaderPropBaseColor_Step, material.GetFloat(ShaderProp1st_ShadeColor_Step));
material.SetFloat(ShaderPropBaseShade_Feather, material.GetFloat(ShaderProp1st_ShadeColor_Feather));
material.SetFloat(ShaderPropShadeColor_Step, material.GetFloat(ShaderProp2nd_ShadeColor_Step));
material.SetFloat(ShaderProp1st2nd_Shades_Feather, material.GetFloat(ShaderProp2nd_ShadeColor_Feather));
}
break;
//Share variables with DoubleWithFeather method.
material.SetFloat(ShaderPropBaseColor_Step, material.GetFloat(ShaderProp1st_ShadeColor_Step));
material.SetFloat(ShaderPropBaseShade_Feather, material.GetFloat(ShaderProp1st_ShadeColor_Feather));
material.SetFloat(ShaderPropShadeColor_Step, material.GetFloat(ShaderProp2nd_ShadeColor_Step));
material.SetFloat(ShaderProp1st2nd_Shades_Feather, material.GetFloat(ShaderProp2nd_ShadeColor_Feather));
}
break;
case ShadowMode.SDF:
{
material.SetFloat(ShaderPropShadowMode, (int)ShadowMode.SDF);
material.EnableKeyword(new LocalKeyword(material.shader, "_SDFShadow"));
m_MaterialEditor.TexturePropertySingleLine(Styles.SDFShadowText, SDFShadowMap);
GUI_RangeProperty(material, Styles.SDFShadowLevelText);
GUI_RangeProperty(material, Styles.SDFSmoothGammaText);
GUI_RangeProperty(material, Styles.SDFNoseHighlightCoefText);
GUI_RangeProperty(material, Styles.SDFNoseHighlightSmoothRange);
}
break;
{
material.SetFloat(ShaderPropShadowMode, (int)ShadowMode.SDF);
material.EnableKeyword(new LocalKeyword(material.shader, "_SDFShadow"));
m_MaterialEditor.TexturePropertySingleLine(Styles.SDFShadowText, SDFShadowMap);
GUI_RangeProperty(material, Styles.SDFShadowLevelText);
GUI_RangeProperty(material, Styles.SDFSmoothGammaText);
GUI_RangeProperty(material, Styles.SDFNoseHighlightCoefText);
GUI_RangeProperty(material, Styles.SDFNoseHighlightSmoothRange);
}
break;
}
EditorGUILayout.Space();
@@ -1721,60 +1721,60 @@ namespace UnityEditor.Rendering.Toon
switch (m_pbrMode)
{
case PBRMode.Off:
{
material.SetFloat(ShaderPropPBR, (int)PBRMode.Off);
{
material.SetFloat(ShaderPropPBR, (int)PBRMode.Off);
material.EnableKeyword("_PBR_Mode_OFF");
material.DisableKeyword("_PBR_Mode_ST");
material.DisableKeyword("_PBR_Mode_ANISO");
material.DisableKeyword("_PBR_Mode_KK");
material.DisableKeyword("_PBR_Mode_TOON");
}
break;
material.EnableKeyword("_PBR_Mode_OFF");
material.DisableKeyword("_PBR_Mode_ST");
material.DisableKeyword("_PBR_Mode_ANISO");
material.DisableKeyword("_PBR_Mode_KK");
material.DisableKeyword("_PBR_Mode_TOON");
}
break;
case PBRMode.Standard:
{
material.SetFloat(ShaderPropPBR, (int)PBRMode.Standard);
{
material.SetFloat(ShaderPropPBR, (int)PBRMode.Standard);
material.DisableKeyword("_PBR_Mode_OFF");
material.EnableKeyword("_PBR_Mode_ST");
material.DisableKeyword("_PBR_Mode_ANISO");
material.DisableKeyword("_PBR_Mode_KK");
material.DisableKeyword("_PBR_Mode_TOON");
}
break;
material.DisableKeyword("_PBR_Mode_OFF");
material.EnableKeyword("_PBR_Mode_ST");
material.DisableKeyword("_PBR_Mode_ANISO");
material.DisableKeyword("_PBR_Mode_KK");
material.DisableKeyword("_PBR_Mode_TOON");
}
break;
case PBRMode.Anisotropy:
{
material.SetFloat(ShaderPropPBR, (int)PBRMode.Anisotropy);
{
material.SetFloat(ShaderPropPBR, (int)PBRMode.Anisotropy);
material.DisableKeyword("_PBR_Mode_OFF");
material.DisableKeyword("_PBR_Mode_ST");
material.EnableKeyword("_PBR_Mode_ANISO");
material.DisableKeyword("_PBR_Mode_KK");
material.DisableKeyword("_PBR_Mode_TOON");
}
break;
material.DisableKeyword("_PBR_Mode_OFF");
material.DisableKeyword("_PBR_Mode_ST");
material.EnableKeyword("_PBR_Mode_ANISO");
material.DisableKeyword("_PBR_Mode_KK");
material.DisableKeyword("_PBR_Mode_TOON");
}
break;
case PBRMode.KKHair:
{
material.SetFloat(ShaderPropPBR, (int)PBRMode.KKHair);
{
material.SetFloat(ShaderPropPBR, (int)PBRMode.KKHair);
material.DisableKeyword("_PBR_Mode_OFF");
material.DisableKeyword("_PBR_Mode_ST");
material.DisableKeyword("_PBR_Mode_ANISO");
material.EnableKeyword("_PBR_Mode_KK");
material.DisableKeyword("_PBR_Mode_TOON");
}
break;
material.DisableKeyword("_PBR_Mode_OFF");
material.DisableKeyword("_PBR_Mode_ST");
material.DisableKeyword("_PBR_Mode_ANISO");
material.EnableKeyword("_PBR_Mode_KK");
material.DisableKeyword("_PBR_Mode_TOON");
}
break;
case PBRMode.Toon:
{
material.SetFloat(ShaderPropPBR, (int)PBRMode.Toon);
{
material.SetFloat(ShaderPropPBR, (int)PBRMode.Toon);
material.DisableKeyword("_PBR_Mode_OFF");
material.DisableKeyword("_PBR_Mode_ST");
material.DisableKeyword("_PBR_Mode_ANISO");
material.DisableKeyword("_PBR_Mode_KK");
material.EnableKeyword("_PBR_Mode_TOON");
}
break;
material.DisableKeyword("_PBR_Mode_OFF");
material.DisableKeyword("_PBR_Mode_ST");
material.DisableKeyword("_PBR_Mode_ANISO");
material.DisableKeyword("_PBR_Mode_KK");
material.EnableKeyword("_PBR_Mode_TOON");
}
break;
}
m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapText, normalMap, normalScale);
@@ -2515,7 +2515,8 @@ namespace UnityEditor.Rendering.Toon
GUI_FloatProperty(material, Styles.nearestDistanceText);
EditorGUI.indentLevel--;
var useOutlineTexture = GUI_Toggle(material, Styles.outlineColorMapText, ShaderPropIs_OutlineTex, MaterialGetInt(material, ShaderPropIs_OutlineTex) != 0); ;
var useOutlineTexture = GUI_Toggle(material, Styles.outlineColorMapText, ShaderPropIs_OutlineTex, MaterialGetInt(material, ShaderPropIs_OutlineTex) != 0);
;
EditorGUI.BeginDisabledGroup(!useOutlineTexture);
m_MaterialEditor.TexturePropertySingleLine(Styles.outlineTexText, outlineTex);
EditorGUI.EndDisabledGroup();