Skip to content

Commit

Permalink
Transparent and cutout variants
Browse files Browse the repository at this point in the history
  • Loading branch information
naitoookami committed May 1, 2024
1 parent 9543411 commit a6a4e1b
Show file tree
Hide file tree
Showing 8 changed files with 11,937 additions and 138 deletions.
43 changes: 28 additions & 15 deletions Packages/com.furality.umbrashader/Editor/UI/UmbraShaderUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public class UmbraShaderUI : ShaderGUI

//Shader locations
Shader defaultOpaque = Shader.Find("Furality/Umbra Shader/Umbra Opaque");
Shader defaultCutout = Shader.Find("Furality/Umbra Shader/Umbra Opaque");
Shader defaultTransparent = Shader.Find("Furality/Umbra Shader/Umbra Opaque");
Shader defaultCutout = Shader.Find("Furality/Umbra Shader/Umbra Cutout");
Shader defaultTransparent = Shader.Find("Furality/Umbra Shader/Umbra Transparent");
Shader noOutlineOpaque = Shader.Find("Furality/Umbra Shader/Umbra Opaque");
Shader noOutlineCutout = Shader.Find("Furality/Umbra Shader/Umbra Opaque");
Shader noOutlineTransparent = Shader.Find("Furality/Umbra Shader/Umbra Opaque");
Shader noOutlineCutout = Shader.Find("Furality/Umbra Shader/Umbra Cutout");
Shader noOutlineTransparent = Shader.Find("Furality/Umbra Shader/Umbra Transparent");

bool enableOutline;

Expand Down Expand Up @@ -69,7 +69,7 @@ public override void OnGUI(
GUILayout.Space(10);
DoBlendMode();
GUILayout.Space(10);
editor.ShaderProperty(FindProperty(workflow), "Workflow", 2);
editor.ShaderProperty(FindProperty(workflow), "Workflow");

if ((BlendMode)target.GetFloat("_BlendModeIndex") == BlendMode.Transparent)
{
Expand Down Expand Up @@ -674,11 +674,24 @@ void DoLightingProperties()

GUILayout.EndVertical();


//Reflection Mask
EditorGUILayout.LabelField("Reflection Mask", EditorStyles.boldLabel);
editor.ShaderProperty(FindProperty("_ReflectionMask"), "Map", 2);
editor.ShaderProperty(FindProperty("_ReflectionMaskChannel"), "Channel", 2);

if ((BlendMode)target.GetFloat("_BlendModeIndex") == BlendMode.Transparent || (BlendMode)target.GetFloat("_BlendModeIndex") == BlendMode.Cutout)
{
//Opacity
EditorGUILayout.LabelField("Opacity", EditorStyles.boldLabel);
editor.ShaderProperty(FindProperty("_OpacityMap"), "Map", 2);
if(target.GetFloat("_OpacityMap") < 5)
{
editor.ShaderProperty(FindProperty("_OpacityChannel"), "Channel", 2);
}

}

//Specular
GUILayout.BeginVertical("box");
EditorGUILayout.LabelField("Specular", EditorStyles.boldLabel);
Expand Down Expand Up @@ -2488,8 +2501,8 @@ void DoIridescence()
//BlendOP Selector
void DoBlendOPSelctor()
{
MaterialProperty src = FindProperty("_BlendOPsrc");
MaterialProperty dst = FindProperty("_BlendOPdst");
MaterialProperty src = FindProperty("_SourceBlendRGB");
MaterialProperty dst = FindProperty("_DestinationBlendRGB");

BlendOP operation = (BlendOP)target.GetFloat("_BlendOPIndex");
EditorGUI.BeginChangeCheck();
Expand All @@ -2503,26 +2516,26 @@ void DoBlendOPSelctor()

if (target.GetFloat("_BlendOPIndex") == 0)
{
target.SetFloat("_BlendOPsrc", 5);
target.SetFloat("_BlendOPdst", 10);
target.SetFloat("_SourceBlendRGB", 5);
target.SetFloat("_DestinationBlendRGB", 10);
}

if (target.GetFloat("_BlendOPIndex") == 1)
{
target.SetFloat("_BlendOPsrc", 1);
target.SetFloat("_BlendOPdst", 1);
target.SetFloat("_SourceBlendRGB", 1);
target.SetFloat("_DestinationBlendRGB", 1);
}

if (target.GetFloat("_BlendOPIndex") == 2)
{
target.SetFloat("_BlendOPsrc", 4);
target.SetFloat("_BlendOPdst", 1);
target.SetFloat("_SourceBlendRGB", 4);
target.SetFloat("_DestinationBlendRGB", 1);
}

if (target.GetFloat("_BlendOPIndex") == 3)
{
target.SetFloat("_BlendOPsrc", 2);
target.SetFloat("_BlendOPdst", 0);
target.SetFloat("_SourceBlendRGB", 2);
target.SetFloat("_DestinationBlendRGB", 0);
}

}
Expand Down
13 changes: 10 additions & 3 deletions Packages/com.furality.umbrashader/Examples/Materials/Syntex.mat
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Material:
- _BlendOPIndex: 0
- _BlendOPdst: 10
- _BlendOPsrc: 5
- _BlendOpRGB: 0
- _BlueChGlowAnimationBand: 10
- _BlueChGlowAnimationMode: 0
- _BlueChGlowAnimationSpeed: 0
Expand Down Expand Up @@ -159,6 +160,7 @@ Material:
- _ClearCoatReflectionMap: 1
- _Culling: 2
- _Cutoff: 0.5
- _DestinationBlendRGB: 10
- _DetailNormalChannel: 0
- _DetailNormalMapScale: 1
- _DetailNormalMask: 4
Expand Down Expand Up @@ -248,19 +250,23 @@ Material:
- _InvertGloss: 0
- _InvertHighlightGloss: 0
- _InvertReflectionGloss: 1
- _MaskClipValue: 0.5
- _MaskMap01UV: 0
- _MaskMap02UV: 0
- _MaskMap03UV: 0
- _MaskMap04UV: 0
- _Metallic: 0
- _MetallicChannel: 0
- _MetallicMask: 0
- _MetallicMult: 1
- _MetallicMult: 0
- _Mode: 0
- _OcclusionChannel: 1
- _OcclusionMap: 0
- _OcclusionPower: 1
- _OcclusionStrength: 1
- _Opacity: 1
- _OpacityChannel: 3
- _OpacityMap: 5
- _Parallax: 0.02
- _RedChGlowAnimationBand: 10
- _RedChGlowAnimationMode: 0
Expand Down Expand Up @@ -297,13 +303,14 @@ Material:
- _ShowEmissionMain: 0
- _ShowGreenAL: 0
- _ShowGreenGlow: 0
- _ShowLighting: 1
- _ShowLighting: 0
- _ShowMain: 0
- _ShowMaps: 0
- _ShowRedAL: 0
- _ShowRedGlow: 0
- _ShowTileDiscard: 0
- _SmoothnessTextureChannel: 0
- _SourceBlendRGB: 5
- _SpecularGlint: 1
- _SpecularHighlights: 1
- _SpecularMask: 4
Expand Down Expand Up @@ -349,7 +356,7 @@ Material:
- _UseFallback1: 0
- _UseFallback2: 0
- _UseFallback3: 0
- _Workflow: 1
- _Workflow: 3
- _ZWrite: 1
- __dirty: 0
m_Colors:
Expand Down
Loading

0 comments on commit a6a4e1b

Please sign in to comment.