mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-07-07 20:54:44 -05:00
Add Shade & Toony presets.
This commit is contained in:
parent
23a50ae7b3
commit
93d4507db7
|
|
@ -0,0 +1,8 @@
|
|||
namespace VRMShaders.VRM10.MToon10.Editor
|
||||
{
|
||||
public enum MToon10EditorEditMode
|
||||
{
|
||||
Basic = 0,
|
||||
Advanced = 1,
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 22a9170004064d029bc205fc5b5a1acc
|
||||
timeCreated: 1626335293
|
||||
|
|
@ -77,16 +77,55 @@ namespace VRMShaders.VRM10.MToon10.Editor
|
|||
}
|
||||
EditorGUILayout.Space();
|
||||
|
||||
materialEditor.ShaderProperty(props[MToon10Prop.ShadingToonyFactor], "Shading Toony");
|
||||
materialEditor.ShaderProperty(props[MToon10Prop.ShadingShiftFactor], "Shading Shift");
|
||||
if (isAdvancedEditMode)
|
||||
{
|
||||
materialEditor.ShaderProperty(props[MToon10Prop.ShadingToonyFactor], "Shading Toony");
|
||||
materialEditor.ShaderProperty(props[MToon10Prop.ShadingShiftFactor], "Shading Shift");
|
||||
materialEditor.TexturePropertySingleLine(
|
||||
new GUIContent("Additive Shading Shift", "Shading Shift (R)"),
|
||||
props[MToon10Prop.ShadingShiftTexture],
|
||||
props[MToon10Prop.ShadingShiftTextureScale]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
GUILayout.Label("Presets");
|
||||
if (GUILayout.Button("Default"))
|
||||
{
|
||||
props[MToon10Prop.ShadingToonyFactor].floatValue = 0.95f;
|
||||
props[MToon10Prop.ShadingShiftFactor].floatValue = -0.05f;
|
||||
props[MToon10Prop.ShadingShiftTexture].textureValue = null;
|
||||
}
|
||||
if (GUILayout.Button("Lambert"))
|
||||
{
|
||||
props[MToon10Prop.ShadingToonyFactor].floatValue = 0.5f;
|
||||
props[MToon10Prop.ShadingShiftFactor].floatValue = -0.5f;
|
||||
props[MToon10Prop.ShadingShiftTexture].textureValue = null;
|
||||
}
|
||||
if (GUILayout.Button("Cartoon"))
|
||||
{
|
||||
props[MToon10Prop.ShadingToonyFactor].floatValue = 1.0f;
|
||||
props[MToon10Prop.ShadingShiftFactor].floatValue = 0.0f;
|
||||
props[MToon10Prop.ShadingShiftTexture].textureValue = null;
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
GUILayout.BeginVertical(GUI.skin.box);
|
||||
materialEditor.ShaderProperty(props[MToon10Prop.ShadingToonyFactor], "Shading Toony");
|
||||
materialEditor.ShaderProperty(props[MToon10Prop.ShadingShiftFactor], "Shading Shift");
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
|
||||
if (props[MToon10Prop.ShadingShiftTexture].textureValue == null)
|
||||
{
|
||||
var toony = props[MToon10Prop.ShadingToonyFactor].floatValue;
|
||||
var shift = props[MToon10Prop.ShadingShiftFactor].floatValue;
|
||||
if (toony - shift < 1.0f - 0.001f)
|
||||
{
|
||||
EditorGUILayout.HelpBox("The lit area includes non-lit area.", MessageType.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isAdvancedEditMode)
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ Shader "VRM10/MToon10"
|
|||
_ShadeTex ("mtoon.shadeMultiplyTexture", 2D) = "white" {}
|
||||
[Normal] _BumpMap ("normalTexture", 2D) = "bump" {} // Unity specified name
|
||||
_BumpScale ("normalTexture.scale", Float) = 1.0 // Unity specified name
|
||||
_ShadingShiftFactor ("mtoon.shadingShiftFactor", Range(-1, 1)) = 0
|
||||
_ShadingShiftFactor ("mtoon.shadingShiftFactor", Range(-1, 1)) = -0.05
|
||||
_ShadingShiftTex ("mtoon.shadingShiftTexture", 2D) = "black" {} // channel R
|
||||
_ShadingShiftTexScale ("mtoon.shadingShiftTexture.scale", Float) = 1
|
||||
_ShadingToonyFactor ("mtoon.shadingToonyFactor", Range(0, 1)) = 0.9
|
||||
_ShadingToonyFactor ("mtoon.shadingToonyFactor", Range(0, 1)) = 0.95
|
||||
|
||||
// GI
|
||||
_GiEqualization ("mtoon.giEqualizationFactor", Range(0, 1)) = 0.9
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user