Improve AmbientScope and OutlineScope

This commit is contained in:
2025-02-02 17:04:05 +09:00
parent ecd0cfdb9f
commit 281dfbc4f0
11 changed files with 200 additions and 143 deletions

View File

@@ -14,6 +14,8 @@ namespace Misaki.HdrpToon.Editor
public static MaterialProperty outlineColor;
public static MaterialProperty outlineColorMap;
public static MaterialProperty albedoAffectOutline;
public static MaterialProperty skyColorAffectOutline;
public static MaterialProperty skyColorIntensity;
public static MaterialProperty fadeIn;
public static MaterialProperty fadeOut;
@@ -26,6 +28,9 @@ namespace Misaki.HdrpToon.Editor
public static readonly GUIContent outlineWidthText = new("Outline Width", "Specifies the width of the outline.");
public static readonly GUIContent outlineColorText = new("Outline Color", "Specifies the color of the outline.");
public static readonly GUIContent albedoAffectOutlineText = new("Albedo Affect Outline", "Enable to affect the outline color with the albedo color.");
public static readonly GUIContent skyColorAffectOutlineText = new("Sky Color Affect Outline", "Enable to affect the outline color with the sky color.");
public static readonly GUIContent skyColorIntensityText = new("Sky Color Intensity", "The intensity of the sky color when add to the outline color.");
public static readonly GUIContent fadeInText = new("Fade In Distance", "Specify the nearest distance, where the outline width changes with the distance between the camera and the object. The outline will be the maximum width at this distance.");
public static readonly GUIContent fadeOutText = new("Fade Out Distance", "Specify the furthest distance, where the outline width changes with the distance between the camera and the object. The outline will be zero at this distance.");
public static readonly GUIContent useSmoothedNormalText = new("Use Smoothed Normal", "Enable to use smoothed normal(that packed in uv2) for outline calculation.");
@@ -45,6 +50,8 @@ namespace Misaki.HdrpToon.Editor
Properties.outlineColor = FindProperty("_OutlineColor");
Properties.outlineColorMap = FindProperty("_OutlineColorMap");
Properties.albedoAffectOutline = FindProperty("_AlbedoAffectOutline");
Properties.skyColorAffectOutline = FindProperty("_SkyColorAffectOutline");
Properties.skyColorIntensity = FindProperty("_SkyColorIntensity");
Properties.fadeIn = FindProperty("_OutlineFadeIn");
Properties.fadeOut = FindProperty("_OutlineFadeOut");
@@ -57,9 +64,16 @@ namespace Misaki.HdrpToon.Editor
editor.TexturePropertySingleLine(Styles.outlineWidthText, Properties.outlineWidthMap, Properties.outlineWidth);
editor.TexturePropertySingleLine(Styles.outlineColorText, Properties.outlineColorMap, Properties.outlineColor);
editor.ShaderProperty(Properties.albedoAffectOutline, Styles.albedoAffectOutlineText);
editor.ShaderProperty(Properties.skyColorAffectOutline, Styles.skyColorAffectOutlineText);
if (Properties.skyColorAffectOutline.GetBooleanValue())
{
editor.ShaderProperty(Properties.skyColorIntensity, Styles.skyColorIntensityText);
}
EditorGUILayout.Space();
editor.ShaderProperty(Properties.fadeIn, Styles.fadeInText);
editor.ShaderProperty(Properties.fadeOut, Styles.fadeOutText);
editor.ShaderProperty(Properties.useSmoothedNormal, Styles.useSmoothedNormalText);
}
}
}
}