Added new fabirc pbr mode;

Added new stocking surface feature;

Fixed the issue that diffuse bsdf is not energy conserving.
Fixed the bug that shader can not render alpha clip properly;
This commit is contained in:
2025-05-15 16:07:54 +09:00
parent d19322b768
commit 35dc7b15a6
21 changed files with 234 additions and 103 deletions

View File

@@ -14,6 +14,7 @@ namespace Misaki.HdrpToon.Editor
public static MaterialProperty rimLightColor;
public static MaterialProperty rimLightIntensity;
public static MaterialProperty albedoAffectRimLight;
public static MaterialProperty screenSpaceRimLight;
public static MaterialProperty rimLightLevel;
public static MaterialProperty rimLightClipping;
@@ -28,6 +29,7 @@ namespace Misaki.HdrpToon.Editor
public static readonly GUIContent rimLightColorText = new("Rim Light Color", "Specifies the color of rim light.");
public static readonly GUIContent rimLightIntensityText = new("Rim Light Strength", "Specifies Rim Light strength.");
public static readonly GUIContent albedoAffectRimLightText = new("Albedo Affect Rim Light", "Enable to let the albedo color affect the rim light color. The alpha channel of rim light color will be the blending weight.");
public static readonly GUIContent screenSpaceRimLightText = new("Screen Space Rim Light", "Enable to make the rim light width constant in screen space.");
public static readonly GUIContent rimLightLevelText = new("Rim Light Level", "Specifies Rim Light power intensity.");
public static readonly GUIContent rimLightClippingText = new("Rim Light Clipping", "Enable to Clip the rim light at specific level");
@@ -46,6 +48,7 @@ namespace Misaki.HdrpToon.Editor
Properties.rimLightColor = FindProperty(RIM_LIGHT_COLOR);
Properties.rimLightIntensity = FindProperty(RIM_LIGHT_INTENSITY);
Properties.albedoAffectRimLight = FindProperty(ALBEDO_AFFECT_RIM_LIGHT);
Properties.screenSpaceRimLight = FindProperty(SCREEN_SPACE_RIM_LIGHT);
Properties.rimLightLevel = FindProperty(RIM_LIGHT_LEVEL);
Properties.rimLightClipping = FindProperty(RIM_LIGHT_CLIPPING);
@@ -60,6 +63,7 @@ namespace Misaki.HdrpToon.Editor
editor.ShaderProperty(Properties.rimLightColor, Styles.rimLightColorText);
editor.ShaderProperty(Properties.rimLightIntensity, Styles.rimLightIntensityText);
editor.ShaderProperty(Properties.albedoAffectRimLight, Styles.albedoAffectRimLightText);
editor.ShaderProperty(Properties.screenSpaceRimLight, Styles.screenSpaceRimLightText);
editor.ShaderProperty(Properties.rimLightLevel, Styles.rimLightLevelText);

View File

@@ -0,0 +1,22 @@
using Misaki.ShaderGUI;
using UnityEngine;
namespace Misaki.HdrpToon.Editor
{
public class StockingScope : MaterialUIScope<ShaderGUIExpandable>
{
protected override ShaderGUIExpandable ExpandableBit => ShaderGUIExpandable.Stocking;
protected override GUIContent Header => throw new System.NotImplementedException();
public override void LoadMaterialProperties()
{
throw new System.NotImplementedException();
}
protected override void DrawContent()
{
throw new System.NotImplementedException();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9e91add2c76ce49448b768421496d94d

View File

@@ -127,7 +127,7 @@ namespace Misaki.HdrpToon.Editor
if (materials.All(mat =>
{
var pbrMode = mat.GetPBRMode();
return pbrMode != PBRMode.KKHair && pbrMode != PBRMode.Toon;
return pbrMode != PBRMode.Hair && pbrMode != PBRMode.Toon;
}))
{
editor.ShaderProperty(Properties.metallic, Styles.metallicText);
@@ -137,11 +137,11 @@ namespace Misaki.HdrpToon.Editor
}
}
if (materials.All(mat => mat.GetPBRMode() == PBRMode.Anisotropy || mat.GetPBRMode() == PBRMode.KKHair))
if (materials.All(mat => mat.GetPBRMode() == PBRMode.Anisotropy || mat.GetPBRMode() == PBRMode.Hair))
{
EditorGUILayout.Space();
editor.KeywordTexturePropertySingleLine(Styles.anisotropyMapText, Properties.anisotropyMap, Properties.anisotropy);
if (materials.All(mat => mat.GetPBRMode() == PBRMode.KKHair))
if (materials.All(mat => mat.GetPBRMode() == PBRMode.Hair))
{
editor.ShaderProperty(Properties.kkColor, Styles.kkColorText);
editor.ShaderProperty(Properties.bsdfContribution, Styles.bsdfContributionText);