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:
@@ -11,10 +11,10 @@ namespace Misaki.HdrpToon.Editor
|
||||
Highlight = 1 << 6,
|
||||
Rimlight = 1 << 7,
|
||||
MatCap = 1 << 8,
|
||||
AngelRing = 1 << 9,
|
||||
Emission = 1 << 10,
|
||||
Outline = 1 << 11,
|
||||
TessellationLegacy = 1 << 12,
|
||||
Stocking = 1 << 9,
|
||||
AngelRing = 1 << 10,
|
||||
Emission = 1 << 11,
|
||||
Outline = 1 << 12,
|
||||
TessellationHDRP = 1 << 13,
|
||||
SceneLight = 1 << 14,
|
||||
EnvironmentalLightEffectiveness = 1 << 15,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
22
Editor/MeterialEditor/UIScopes/StockingScope.cs
Normal file
22
Editor/MeterialEditor/UIScopes/StockingScope.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Editor/MeterialEditor/UIScopes/StockingScope.cs.meta
Normal file
2
Editor/MeterialEditor/UIScopes/StockingScope.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e91add2c76ce49448b768421496d94d
|
||||
@@ -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);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Misaki.ShaderGUI;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
namespace Misaki.HdrpToon.Editor
|
||||
{
|
||||
@@ -12,6 +13,22 @@ namespace Misaki.HdrpToon.Editor
|
||||
{
|
||||
material.SetShaderPassEnabled(UtsShaderPassName.HAIR_SHADOW_CASTER_PASS_NAME, (MaterialType)material.GetInteger("_Material_Type") == MaterialType.FrontHair);
|
||||
material.SetShaderPassEnabled(UtsShaderPassName.HAIR_BLENDING_TARGET_PASS_NAME, material.GetInteger("_HairBlendingTarget") == 1);
|
||||
|
||||
if (material.GetInteger("_AlphaCutoffEnable") > 0.0f)
|
||||
{
|
||||
material.SetInt("_ZTestGBuffer", (int)CompareFunction.Equal);
|
||||
}
|
||||
else
|
||||
{
|
||||
material.SetInt("_ZTestGBuffer", (int)CompareFunction.LessEqual);
|
||||
}
|
||||
|
||||
//if (surfaceType == SurfaceType.Opaque)
|
||||
//{
|
||||
material.SetInt("_ZTestDepthEqualForOpaque", (int)CompareFunction.Equal);
|
||||
//}
|
||||
//else
|
||||
// material.SetInt(kZTestDepthEqualForOpaque, (int)material.GetTransparentZTest());
|
||||
}
|
||||
|
||||
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
|
||||
|
||||
Reference in New Issue
Block a user