From 5b5a913017be774183f31e43ca902ca663b87a88 Mon Sep 17 00:00:00 2001 From: ACiiL Date: Sat, 8 Aug 2020 07:13:10 -0600 Subject: [PATCH] Add GUI - Add custom GUI - Add single pass instancing (SPI) support - Workaround "shadow flickering" in maps without a directional light, in some system setups. - Limit to Additional Lights Blending in Alpha Transparent, as Premultiplied Alpha wants ADD mode and incorrectly darkened when lit by Point/Spot lights only. --- Assets/shaders/aciil/ACLS/ACLS_CORE.cginc | 43 +- .../aciil/ACLS/ACLS_SHADOWCASTER.cginc | 17 +- .../aciil/ACLS/ACLS_base_cutout.shader | 51 +- .../aciil/ACLS/ACLS_base_cutoutAlpha.shader | 50 +- .../ACLS/ACLS_base_cutoutAlphaDither.shader | 51 +- .../shaders/aciil/ACLS/ACLS_base_solid.shader | 52 +- .../aciil/ACLS/Editor/ACLSInspector.cs | 491 ++++++++++++++++++ Assets/shaders/aciil/ACLS/Editor/ACLStyles.cs | 172 ++++++ README.md | 2 +- 9 files changed, 822 insertions(+), 107 deletions(-) create mode 100644 Assets/shaders/aciil/ACLS/Editor/ACLSInspector.cs create mode 100644 Assets/shaders/aciil/ACLS/Editor/ACLStyles.cs diff --git a/Assets/shaders/aciil/ACLS/ACLS_CORE.cginc b/Assets/shaders/aciil/ACLS/ACLS_CORE.cginc index 4008fb8..a7d0742 100644 --- a/Assets/shaders/aciil/ACLS/ACLS_CORE.cginc +++ b/Assets/shaders/aciil/ACLS/ACLS_CORE.cginc @@ -166,24 +166,28 @@ float4 tangent : TANGENT; float2 uv : TEXCOORD0; float4 color : COLOR; + UNITY_VERTEX_INPUT_INSTANCE_ID }; //// test "_centroid" for MSAA workarounds struct VertexOutput { - float4 color : COLOR0; float4 pos : SV_POSITION; + float4 color : COLOR0; float4 center : TEXCOORD0; - float4 worldPos : TEXCOORD1; + float3 worldPos : TEXCOORD1; float3 wNormal : TEXCOORD2; float4 tangent : TEXCOORD3; float3 bitTangent : TEXCOORD4; float3 vertexLighting : TEXCOORD5; - float3 dirGI : TEXCOORD7; - float2 uv : TEXCOORD8; - float4 screenPos : TEXCOORD9; - float3 vertTo0 : TEXCOORD10; + float3 dirGI : TEXCOORD6; + float2 uv : TEXCOORD7; + float4 screenPos : TEXCOORD8; + float3 vertTo0 : TEXCOORD9; + UNITY_FOG_COORDS(10) UNITY_SHADOW_COORDS(11) - UNITY_FOG_COORDS(12) + // LIGHTING_COORDS(11,12) + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO }; @@ -194,18 +198,24 @@ //// vert VertexOutput vert (VertexInput v) { - VertexOutput o = (VertexOutput)0; - o.pos = UnityObjectToClipPos( v.vertex ); + UNITY_SETUP_INSTANCE_ID(v); + VertexOutput o; + // VertexOutput o = (VertexOutput)0; + UNITY_INITIALIZE_OUTPUT(VertexOutput, o); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); + o.uv = v.uv; o.worldPos = mul( unity_ObjectToWorld, v.vertex); o.center = mul( unity_ObjectToWorld, float4(0,0,0,1)); o.wNormal = UnityObjectToWorldNormal( v.normal); o.tangent = ( float4(UnityObjectToWorldDir(v.tangent.xyz), v.tangent.w)); o.bitTangent = ( cross( o.wNormal, o.tangent.xyz ) * v.tangent.w); - o.uv = v.uv; o.screenPos = ComputeScreenPos(o.pos); o.color = v.color; + // TRANSFER_VERTEX_TO_FRAGMENT(o); + UNITY_TRANSFER_SHADOW(o, 0); // o.uv1 used for lightmap variants (dont exist) UNITY_TRANSFER_FOG(o, o.pos); - UNITY_TRANSFER_SHADOW(o, o.uv); #ifdef VERTEXLIGHT_ON o.vertexLighting = softShade4PointLights_Atten( @@ -265,6 +275,9 @@ VertexOutput i , bool frontFace : SV_IsFrontFace ) : SV_TARGET { + // UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + UNITY_SETUP_INSTANCE_ID(i); + int isBackFace = !frontFace; i.wNormal = normalize( i.wNormal); if(isBackFace) { //// flip normal for back faces. @@ -450,11 +463,19 @@ //// Light attenuation (falloff and shadows), used for mixing in shadows and effects that react to shadow #ifdef DIRECTIONAL //// directional lights handle UNITY_LIGHT_ATTENUATION() differently. I want to split attenuation and shadows, but both concepts fuse in directional lights + // float lightAtten = LIGHT_ATTENUATION(i); + // UNITY_LIGHT_ATTENUATION(lightAtten, i, i.worldPos.xyz); UNITY_LIGHT_ATTENUATION_NOSHADOW(lightAtten, i, i.worldPos.xyz); + if ( !(any(_LightColor0.rgb))) /// lightAtten is random in scenes without directional lights. Using this raw is unstable so we correct when lacking light color. + { + lightAtten = 1; + } float shadowFullTrue = lightAtten; lightAtten = smoothstep(0, 0.6, lightAtten); float shadowAtten = lightAtten; #else + // float lightAtten = LIGHT_ATTENUATION(i); + // UNITY_LIGHT_ATTENUATION(lightAtten, i, i.worldPos.xyz); UNITY_LIGHT_ATTENUATION_NOSHADOW(lightAtten, i, i.worldPos.xyz); float shadowAtten = UNITY_SHADOW_ATTENUATION(i, i.worldPos.xyz); float shadowFullTrue = shadowAtten; diff --git a/Assets/shaders/aciil/ACLS/ACLS_SHADOWCASTER.cginc b/Assets/shaders/aciil/ACLS/ACLS_SHADOWCASTER.cginc index c5b36f7..4f68eed 100644 --- a/Assets/shaders/aciil/ACLS/ACLS_SHADOWCASTER.cginc +++ b/Assets/shaders/aciil/ACLS/ACLS_SHADOWCASTER.cginc @@ -28,12 +28,15 @@ float4 vertex : POSITION; float3 normal : NORMAL; float2 texcoord0 : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct VertexOutput { // V2F_SHADOW_CASTER; float2 uv0 : TEXCOORD0; float4 worldPos : TEXCOORD1; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO }; @@ -47,6 +50,11 @@ out float4 opos : SV_POSITION ) { + o = (VertexOutput)0; + UNITY_SETUP_INSTANCE_ID(v); + // UNITY_INITIALIZE_OUTPUT(VertexOutput, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.uv0 = v.texcoord0; opos = UnityObjectToClipPos(v.vertex); o.worldPos = mul( unity_ObjectToWorld, v.vertex); @@ -62,6 +70,7 @@ float4 frag(VertexOutput i, UNITY_VPOS_TYPE screenPos : VPOS) : SV_TARGET { + UNITY_SETUP_INSTANCE_ID(i); #ifndef NotAlpha float2 Set_UV0 = i.uv0; float4 clippingMaskTex = tex2D(_ClippingMask,TRANSFORM_TEX(Set_UV0, _ClippingMask)); @@ -81,11 +90,11 @@ #else //// Dither clip(clipTest); #endif //// Dither - return 0; - // SHADOW_CASTER_FRAGMENT(i) + // return 0; + SHADOW_CASTER_FRAGMENT(i) #else //// NotAlpha - return 0; - // SHADOW_CASTER_FRAGMENT(i) + // return 0; + SHADOW_CASTER_FRAGMENT(i) #endif //// NotAlpha } #endif // ACLS_SHADOWCASTER diff --git a/Assets/shaders/aciil/ACLS/ACLS_base_cutout.shader b/Assets/shaders/aciil/ACLS/ACLS_base_cutout.shader index 5f76f9b..660bc6c 100644 --- a/Assets/shaders/aciil/ACLS/ACLS_base_cutout.shader +++ b/Assets/shaders/aciil/ACLS/ACLS_base_cutout.shader @@ -6,15 +6,15 @@ Shader "ACiiL/toon/ACLS_Toon_Cutout" { [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode("Cull Mode", int) = 2 //OFF/FRONT/BACK [HDR] _backFaceColorTint("Backface Color Tint",Color) = (1,1,1,1) - [Header(Testing)] + // [Header(Testing)] // _AO_shadePosFront_Offset("Front Offset", Range(-1,1)) = 0 // _AO_shadePosBack_Offset("Back Offset", Range(-1,1)) = 0 - [Header(Toon ramp)] + // [Header(Toon ramp)] _MainTex("Main Tex", 2D) = "white" {} [Enum(Self,0,MainTex,1)] _Use_BaseAs1st("1st shade source", Int) = 1 [NoScaleOffset] _1st_ShadeMap("--1st shade Tex", 2D) = "white" {} - [Enum(Self,0,Shade1,1,MainTex,2)] _Use_1stAs2nd("2st shade source", Int) = 1 + [Enum(Self,0,Shade1,1,MainTex,2)] _Use_1stAs2nd("2nd shade source", Int) = 1 [NoScaleOffset] _2nd_ShadeMap("--2nd shade Tex", 2D) = "white" {} [HDR] _Color("Base color", Color) = (1,1,1,1) [HDR] _0_ShadeColor("--Foward color", Color) = (0.97,0.97,0.97,1) @@ -26,14 +26,14 @@ Shader "ACiiL/toon/ACLS_Toon_Cutout" { _1st2nd_Shades_Feather("--Feather: back", Range(0.0001, 1)) = 0.001 [Enum(All Light,0,Natural ambient,1)] _ToonRampLightSourceType_Backwards("Toon ramp Backface light source type:",Int) = 0 // _Set_SystemShadowsToBase("shadows mix core tone mix",Range(0,1)) = 0 - [Space(18)] + // [Space(18)] [Enum(Off,0,On,1)] _Diff_GSF_01("Toon ramp GSF effect", Int) = 0 _DiffGSF_Offset("--Offset",Range(0,2)) = 1 _DiffGSF_Feather("--Feather",Range(0.0001,2)) = 0.2 - [Header(Specular Shine)] + // [Header(Specular Shine)] [Toggle(_)] _UseSpecularSystem("Use specular effects",Int) = 0 - [Enum(Unity Specular Setup,0,Add,1)] _Is_BlendAddToHiColor("Specular Blend mode", Int ) = 1 + [Enum(On,0,Off,1)] _Is_BlendAddToHiColor("Energy conservation", Int ) = 1 [HDR] _SpecColor("Specular Primary Color",Color) = (.5,.5,.5,1) _Glossiness("Smoothness",Range(0,1)) = .3 _HighColor_Tex("--Specular Setup Tex: (RGB):Tint, (A):Smoothness", 2D) = "white" {} @@ -41,21 +41,21 @@ Shader "ACiiL/toon/ACLS_Toon_Cutout" { _SpecularMaskHSV("--Adjest (H)ue (S)sat (V)alue (I)ntensity",Float) = (0,0,0,1) [HDR] _HighColor("Spec col 01", Color) = (1,1,1,1) [Enum(Sharp,0,Soft,1,Unity,2)] _Is_SpecularToHighColor("Specular mode", Int ) = 0 - _TweakHighColorOnShadow("Spec shadow mask", Range(0, 1)) = 1 + _TweakHighColorOnShadow("Spec shadow mask", Range(0, 1)) = 0.5 - [Header(Reflection)] + // [Header(Reflection)] [Enum(None,0,Standard,1,Override,2)] _ENVMmode("Reflection Setup:",Int) = 0 _ENVMix("--Reflection mix",Range(0,1)) = 1 _envRoughness("--Reflection smoothness", Range(0, 1)) = 0.34 [Enum(Off,0,Smart,1,Replace,2)] _CubemapFallbackMode("Fallback mix mode:",Int) = 0 [NoScaleOffset] _CubemapFallback("--Fallback Cubemap",Cube) = "black" {} - [Space(18)] + // [Space(18)] [Enum(Off,0,On,1)] _EnvGrazeMix("Graze Natural mix",Int) = 1 [Enum(Off,0,On,1)] _EnvGrazeRimMix("Graze RimLights Mask mix",Int) = 0 _envOnRim("Mask on rimLights", Range(0,1)) = 0.25 _envOnRimColorize("--Colorize rim lights", Range(0,1)) = 0 - [Header(Rimlights)] + // [Header(Rimlights)] [Enum(Off,0,Add,1)] _RimLight("RimLight blend",Int) = 1 [Enum(Off,0,Add,1)] _Add_Antipodean_RimLight("Ap RimLight blend",Int) = 1 _rimAlbedoMix("Mix Albedo",Range(0,1)) = 0 @@ -69,8 +69,8 @@ Shader "ACiiL/toon/ACLS_Toon_Cutout" { [Toggle(_)] _LightDirection_MaskOn("Use light direction",Int) = 1 _Tweak_LightDirection_MaskLevel("--Mask: Light direction",Range(0, 1)) = 0 - [Header(Matcap)] - [Enum(Off,0,On,1)] _MatCap("Use MatCap", Int ) = 0 + // [Header(Matcap)] + [Toggle(_)] _MatCap("Use MatCap", Int ) = 0 [HDR] _MatCapColMult ("Diffuse color", Color) = (1,1,1,1) [NoScaleOffset] _MatCapTexMult ("Diffuse matcap", 2D) = "black" {} [HDR] _MatCapColAdd ("Specular color", Color) = (1,1,1,1) @@ -79,7 +79,7 @@ Shader "ACiiL/toon/ACLS_Toon_Cutout" { [NoScaleOffset] _MatCapTexEmis ("Emissive matcap", 2D) = "black" {} [Toggle(_)] _Is_NormalMapForMatCap("Use matcap normalMap ", Float ) = 0 _NormalMapForMatCap("--MatCap normalMap", 2D) = "bump" {} - [Space(9)] + // [Space(9)] _Tweak_MatCapUV("Zoom matCap", Range(-0.5, 0.5)) = 0 _Rotate_MatCapUV("Rotate matCap", Range(-1, 1)) = 0 _Rotate_NormalMapForMatCapUV("Rotate normalMap matCap", Range(-1, 1)) = 0 @@ -87,20 +87,20 @@ Shader "ACiiL/toon/ACLS_Toon_Cutout" { _Set_MatcapMask("Diffuse matcap mask (G)", 2D) = "white" {} _Tweak_MatcapMaskLevel("--Tweak mask", Range(-1, 1)) = 0 - [Header(Emission)] + // [Header(Emission)] [HDR] _Emissive_Color("Emissive color", Color) = (0,0,0,1) [HDR] _EmissiveProportional_Color("Emissive Proportional color", Color) = (0,0,0,1) _Emissive_Tex("Emissive mask (G)", 2D) = "white" {} _EmissionColorTex("--Emissive color (RGB)", 2D) = "white" {} - [Header(Lighting Behaviour)] + // [Header(Lighting Behaviour)] _directLightIntensity("Direct light intensity",Range(0,1)) = 1 [Enum(HDR,0,Limit,1)] _forceLightClamp("Force scene Lights Clamp",Int) = 0 [Enum(Real ADD,0,Safe MAX,4)] _BlendOp("Additional lights blending", Float) = 4 _shadowCastMin_black("Dynamic Shadow Removal",Range(0.0,1.0)) = 0.1 [NoScaleOffset] _DynamicShadowMask("Dynamic Shadow mask",2D) = "black" {} - [Header(Light Map Shift Masks)] + // [Header(Light Map Shift Masks)] [Enum(Off,0,On,1,Use Vertex Color Red,2)] _UseLightMap("Light Map mode", Int) = 0 _LightMap("Light map mask (G)", 2D) = "gray" {} _lightMap_remapArr("--Range: (Z):LOW, (W):HIGH", Vector) = (-1,-1,0,1) @@ -110,13 +110,13 @@ Shader "ACiiL/toon/ACLS_Toon_Cutout" { [NoScaleOffset] _Set_1st_ShadePosition("Forward Toon Shadows (G)", 2D) = "white" {} [NoScaleOffset] _Set_2nd_ShadePosition("Backward Toon Shadow (G)", 2D) = "white" {} - [Header(Ambient Occlusion Maps)] + // [Header(Ambient Occlusion Maps)] _Set_HighColorMask("Specular Mask (G)", 2D) = "white" {} _Tweak_HighColorMaskLevel("--Tweak Mask", Range(-1, 1)) = 0 _Set_RimLightMask("RimLight Mask (G)", 2D) = "white" {} _Tweak_RimLightMaskLevel("--Tweak Mask", Range(-1, 1)) = 0 - [Header(Normal map)] + // [Header(Normal map)] _NormalMap("NormalMap", 2D) = "bump" {} _DetailNormalMapScale01("--Detail scale", Range(0,1)) = 0 _NormalMapDetail("----Detail Normal map", 2d) = "bump" {} @@ -126,20 +126,20 @@ Shader "ACiiL/toon/ACLS_Toon_Cutout" { [Toggle(_)] _Is_NormalMapToRimLight("On Rims",Int) = 1 [Toggle(_)] _Is_NormaMapToEnv("On Reflection",Int) = 1 - [Header(Alpha mask)] - [Space(18)] + // [Header(Alpha mask)] + // [Space(18)] // [Enum(Off,0,On,1)] _ZWrite("Z Write Depth sorting (Recommend off)",Int) = 1 [Enum(Clipping Mask,0,Main Texture,1)] _IsBaseMapAlphaAsClippingMask("Alpha mask source",Int) = 1 _ClippingMask("--Clipping mask (G)",2D) = "white" {} [Toggle(_)] _Inverse_Clipping("Inverse clipping", Float ) = 0 _Clipping_Level("Clipping level", Range(0, 1)) = 0.5 _Tweak_transparency("--Tweak transparency", Range(-1, 1)) = 0 - [Space(18)] + // [Space(18)] // [Toggle(_)] _UseSpecAlpha("Use specular Alpha",Float) = 0 [Toggle(_)] _DetachShadowClipping("Separate Shadow Clipping Level",Int) = 0 _Clipping_Level_Shadow("--Shadow Clip", Range(0, 1)) = 1 - [Header(Stencil Helpers. Requires Queue Order Edits)] + // [Header(Stencil Helpers. Requires Queue Order Edits)] _Stencil("Stencil ID [0;255]", Range(0,255)) = 0 [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("--Comparison", Int) = 0 [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp("--Pass", Int) = 0 @@ -182,7 +182,9 @@ Shader "ACiiL/toon/ACLS_Toon_Cutout" { #include "UnityCG.cginc" #include "AutoLight.cginc" #include "Lighting.cginc" - #pragma multi_compile_fwdbase_fullshadows + // #pragma multi_compile_fwdbase_fullshadows + #pragma multi_compile_fwdbase + #pragma multi_compile_instancing #pragma multi_compile_fog #pragma multi_compile UNITY_PASS_FORWARDBASE #pragma multi_compile _ UNITY_HDR_ON @@ -218,6 +220,7 @@ Shader "ACiiL/toon/ACLS_Toon_Cutout" { #include "AutoLight.cginc" #include "Lighting.cginc" #pragma multi_compile_fwdadd_fullshadows + #pragma multi_compile_instancing #pragma multi_compile_fog #pragma multi_compile UNITY_PASS_FORWARDADD #pragma multi_compile _ UNITY_HDR_ON @@ -243,10 +246,12 @@ Shader "ACiiL/toon/ACLS_Toon_Cutout" { #include "UnityCG.cginc" #include "Lighting.cginc" #pragma multi_compile_shadowcaster + #pragma multi_compile_instancing #define IsClip #include "ACLS_ShadowCaster.cginc" ENDCG } } FallBack "Legacy Shaders/VertexLit" + CustomEditor "ACLSInspector" } diff --git a/Assets/shaders/aciil/ACLS/ACLS_base_cutoutAlpha.shader b/Assets/shaders/aciil/ACLS/ACLS_base_cutoutAlpha.shader index 04cf1d1..05115f8 100644 --- a/Assets/shaders/aciil/ACLS/ACLS_base_cutoutAlpha.shader +++ b/Assets/shaders/aciil/ACLS/ACLS_base_cutoutAlpha.shader @@ -6,15 +6,15 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode("Cull Mode", Int) = 2 //OFF/FRONT/BACK [HDR] _backFaceColorTint("Backface Color Tint",Color) = (1,1,1,1) - [Header(Testing)] + // [Header(Testing)] // _AO_shadePosFront_Offset("Front Offset", Range(-1,1)) = 0 // _AO_shadePosBack_Offset("Back Offset", Range(-1,1)) = 0 - [Header(Toon ramp)] + // [Header(Toon ramp)] _MainTex("Main Tex", 2D) = "white" {} [Enum(Self,0,MainTex,1)] _Use_BaseAs1st("1st shade source", Int) = 1 [NoScaleOffset] _1st_ShadeMap("--1st shade Tex", 2D) = "white" {} - [Enum(Self,0,Shade1,1,MainTex,2)] _Use_1stAs2nd("2st shade source", Int) = 1 + [Enum(Self,0,Shade1,1,MainTex,2)] _Use_1stAs2nd("2nd shade source", Int) = 1 [NoScaleOffset] _2nd_ShadeMap("--2nd shade Tex", 2D) = "white" {} [HDR] _Color("Base color", Color) = (1,1,1,1) [HDR] _0_ShadeColor("--Foward color", Color) = (0.97,0.97,0.97,1) @@ -26,14 +26,14 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { _1st2nd_Shades_Feather("--Feather: back", Range(0.0001, 1)) = 0.001 [Enum(All Light,0,Natural ambient,1)] _ToonRampLightSourceType_Backwards("Toon ramp Backface light source type:",Int) = 0 // _Set_SystemShadowsToBase("shadows mix core tone mix",Range(0,1)) = 0 - [Space(18)] + // [Space(18)] [Enum(Off,0,On,1)] _Diff_GSF_01("Toon ramp GSF effect", Int) = 0 _DiffGSF_Offset("--Offset",Range(0,2)) = 1 _DiffGSF_Feather("--Feather",Range(0.0001,2)) = 0.2 - [Header(Specular Shine)] + // [Header(Specular Shine)] [Toggle(_)] _UseSpecularSystem("Use specular effects",Int) = 0 - [Enum(Unity Specular Setup,0,Add,1)] _Is_BlendAddToHiColor("Specular Blend mode", Int ) = 1 + [Enum(On,0,Off,1)] _Is_BlendAddToHiColor("Energy conservation", Int ) = 1 [HDR] _SpecColor("Specular Primary Color",Color) = (.5,.5,.5,1) _Glossiness("Smoothness",Range(0,1)) = .3 _HighColor_Tex("--Specular Setup Tex: (RGB):Tint, (A):Smoothness", 2D) = "white" {} @@ -41,21 +41,21 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { _SpecularMaskHSV("--Adjest (H)ue (S)sat (V)alue (I)ntensity",Float) = (0,0,0,1) [HDR] _HighColor("Spec col 01", Color) = (1,1,1,1) [Enum(Sharp,0,Soft,1,Unity,2)] _Is_SpecularToHighColor("Specular mode", Int ) = 0 - _TweakHighColorOnShadow("Spec shadow mask", Range(0, 1)) = 1 + _TweakHighColorOnShadow("Spec shadow mask", Range(0, 1)) = 0.5 - [Header(Reflection)] + // [Header(Reflection)] [Enum(None,0,Standard,1,Override,2)] _ENVMmode("Reflection Setup:",Int) = 0 _ENVMix("--Reflection mix",Range(0,1)) = 1 _envRoughness("--Reflection smoothness", Range(0, 1)) = 0.34 [Enum(Off,0,Smart,1,Replace,2)] _CubemapFallbackMode("Fallback mix mode:",Int) = 0 [NoScaleOffset] _CubemapFallback("--Fallback Cubemap",Cube) = "black" {} - [Space(18)] + // [Space(18)] [Enum(Off,0,On,1)] _EnvGrazeMix("Graze Natural mix",Int) = 1 [Enum(Off,0,On,1)] _EnvGrazeRimMix("Graze RimLights Mask mix",Int) = 0 _envOnRim("Mask on rimLights", Range(0,1)) = 0.25 _envOnRimColorize("--Colorize rim lights", Range(0,1)) = 0 - [Header(Rimlights)] + // [Header(Rimlights)] [Enum(Off,0,Add,1)] _RimLight("RimLight blend",Int) = 1 [Enum(Off,0,Add,1)] _Add_Antipodean_RimLight("Ap RimLight blend",Int) = 1 _rimAlbedoMix("Mix Albedo",Range(0,1)) = 0 @@ -69,8 +69,8 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { [Toggle(_)] _LightDirection_MaskOn("Use light direction",Int) = 1 _Tweak_LightDirection_MaskLevel("--Mask: Light direction",Range(0, 1)) = 0 - [Header(Matcap)] - [Enum(Off,0,On,1)] _MatCap("Use MatCap", Int ) = 0 + // [Header(Matcap)] + [Toggle(_)] _MatCap("Use MatCap", Int ) = 0 [HDR] _MatCapColMult ("Diffuse color", Color) = (1,1,1,1) [NoScaleOffset] _MatCapTexMult ("Diffuse matcap", 2D) = "black" {} [HDR] _MatCapColAdd ("Specular color", Color) = (1,1,1,1) @@ -79,7 +79,7 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { [NoScaleOffset] _MatCapTexEmis ("Emissive matcap", 2D) = "black" {} [Toggle(_)] _Is_NormalMapForMatCap("Use matcap normalMap ", Float ) = 0 _NormalMapForMatCap("--MatCap normalMap", 2D) = "bump" {} - [Space(9)] + // [Space(9)] _Tweak_MatCapUV("Zoom matCap", Range(-0.5, 0.5)) = 0 _Rotate_MatCapUV("Rotate matCap", Range(-1, 1)) = 0 _Rotate_NormalMapForMatCapUV("Rotate normalMap matCap", Range(-1, 1)) = 0 @@ -87,20 +87,20 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { _Set_MatcapMask("Diffuse matcap mask (G)", 2D) = "white" {} _Tweak_MatcapMaskLevel("--Tweak mask", Range(-1, 1)) = 0 - [Header(Emission)] + // [Header(Emission)] [HDR] _Emissive_Color("Emissive color", Color) = (0,0,0,1) [HDR] _EmissiveProportional_Color("Emissive Proportional color", Color) = (0,0,0,1) _Emissive_Tex("Emissive mask (G)", 2D) = "white" {} _EmissionColorTex("--Emissive color (RGB)", 2D) = "white" {} - [Header(Lighting Behaviour)] + // [Header(Lighting Behaviour)] _directLightIntensity("Direct light intensity",Range(0,1)) = 1 [Enum(HDR,0,Limit,1)] _forceLightClamp("Force scene Lights Clamp",Int) = 0 [Enum(Real ADD,0,Safe MAX,4)] _BlendOp("Additional lights blending", Float) = 4 _shadowCastMin_black("Dynamic Shadow Removal",Range(0.0,1.0)) = 0.1 [NoScaleOffset] _DynamicShadowMask("Dynamic Shadow mask",2D) = "black" {} - [Header(Light Map Shift Masks)] + // [Header(Light Map Shift Masks)] [Enum(Off,0,On,1,Use Vertex Color Red,2)] _UseLightMap("Light Map mode", Int) = 0 _LightMap("Light map mask (G)", 2D) = "gray" {} _lightMap_remapArr("--Range: (Z):LOW, (W):HIGH", Vector) = (-1,-1,0,1) @@ -110,13 +110,13 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { [NoScaleOffset] _Set_1st_ShadePosition("Forward Toon Shadows (G)", 2D) = "white" {} [NoScaleOffset] _Set_2nd_ShadePosition("Backward Toon Shadow (G)", 2D) = "white" {} - [Header(Ambient Occlusion Maps)] + // [Header(Ambient Occlusion Maps)] _Set_HighColorMask("Specular Mask (G)", 2D) = "white" {} _Tweak_HighColorMaskLevel("--Tweak Mask", Range(-1, 1)) = 0 _Set_RimLightMask("RimLight Mask (G)", 2D) = "white" {} _Tweak_RimLightMaskLevel("--Tweak Mask", Range(-1, 1)) = 0 - [Header(Normal map)] + // [Header(Normal map)] _NormalMap("NormalMap", 2D) = "bump" {} _DetailNormalMapScale01("--Detail scale", Range(0,1)) = 0 _NormalMapDetail("----Detail Normal map", 2d) = "bump" {} @@ -126,7 +126,7 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { [Toggle(_)] _Is_NormalMapToRimLight("On Rims",Int) = 1 [Toggle(_)] _Is_NormaMapToEnv("On Reflection",Int) = 1 - [Header(Alpha mask)] + // [Header(Alpha mask)] [Enum(Off,0,On,1)] _ZWrite("Z Write Depth sorting (Recommend off)",Int) = 1 [Enum(Clipping Mask,0,Main Texture,1)] _IsBaseMapAlphaAsClippingMask("Alpha mask source",Int) = 1 _ClippingMask("--Clipping mask (G)",2D) = "white" {} @@ -137,7 +137,7 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { [Toggle(_)] _DetachShadowClipping("Separate Shadow Clipping Level",Int) = 0 _Clipping_Level_Shadow("--Shadow Clip",Range(0, 1)) = 1 - [Header(Stencil Helpers. Requires Queue Order Edits)] + // [Header(Stencil Helpers. Requires Queue Order Edits)] _Stencil("Stencil ID [0;255]", Range(0,255)) = 0 [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("--Comparison", Int) = 0 [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp("--Pass", Int) = 0 @@ -183,7 +183,9 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { #include "UnityCG.cginc" #include "AutoLight.cginc" #include "Lighting.cginc" - #pragma multi_compile_fwdbase_fullshadows + // #pragma multi_compile_fwdbase_fullshadows + #pragma multi_compile_fwdbase + #pragma multi_compile_instancing #pragma multi_compile_fog #pragma multi_compile UNITY_PASS_FORWARDBASE #pragma multi_compile _ UNITY_HDR_ON @@ -203,7 +205,8 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { // Blend One OneMinusSrcAlpha //// PremultiplyAlpha? // Blend SrcAlpha One // Blend One One //// PremultiplyAlpha? - BlendOp[_BlendOp] + BlendOp ADD + // BlendOp[_BlendOp] Cull[_CullMode] ZWrite off @@ -222,6 +225,7 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { #include "AutoLight.cginc" #include "Lighting.cginc" #pragma multi_compile_fwdadd_fullshadows + #pragma multi_compile_instancing #pragma multi_compile_fog #pragma multi_compile UNITY_PASS_FORWARDADD #pragma multi_compile _ UNITY_HDR_ON @@ -249,10 +253,12 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaTransparent" { #include "Lighting.cginc" #pragma fragmentoption ARB_precision_hint_fastest #pragma multi_compile_shadowcaster + #pragma multi_compile_instancing // #define Dither #include "ACLS_ShadowCaster.cginc" ENDCG } } FallBack "Legacy Shaders/VertexLit" + CustomEditor "ACLSInspector" } diff --git a/Assets/shaders/aciil/ACLS/ACLS_base_cutoutAlphaDither.shader b/Assets/shaders/aciil/ACLS/ACLS_base_cutoutAlphaDither.shader index 5a301e5..2a64f8f 100644 --- a/Assets/shaders/aciil/ACLS/ACLS_base_cutoutAlphaDither.shader +++ b/Assets/shaders/aciil/ACLS/ACLS_base_cutoutAlphaDither.shader @@ -6,15 +6,15 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaCutout_Dither" { [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode("Cull Mode", int) = 2 //OFF/FRONT/BACK [HDR] _backFaceColorTint("Backface Color Tint",Color) = (1,1,1,1) - [Header(Testing)] + // [Header(Testing)] // _AO_shadePosFront_Offset("Front Offset", Range(-1,1)) = 0 // _AO_shadePosBack_Offset("Back Offset", Range(-1,1)) = 0 - [Header(Toon ramp)] + // [Header(Toon ramp)] _MainTex("Main Tex", 2D) = "white" {} [Enum(Self,0,MainTex,1)] _Use_BaseAs1st("1st shade source", Int) = 1 [NoScaleOffset] _1st_ShadeMap("--1st shade Tex", 2D) = "white" {} - [Enum(Self,0,Shade1,1,MainTex,2)] _Use_1stAs2nd("2st shade source", Int) = 1 + [Enum(Self,0,Shade1,1,MainTex,2)] _Use_1stAs2nd("2nd shade source", Int) = 1 [NoScaleOffset] _2nd_ShadeMap("--2nd shade Tex", 2D) = "white" {} [HDR] _Color("Base color", Color) = (1,1,1,1) [HDR] _0_ShadeColor("--Foward color", Color) = (0.97,0.97,0.97,1) @@ -26,14 +26,14 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaCutout_Dither" { _1st2nd_Shades_Feather("--Feather: back", Range(0.0001, 1)) = 0.001 [Enum(All Light,0,Natural ambient,1)] _ToonRampLightSourceType_Backwards("Toon ramp Backface light source type:",Int) = 0 // _Set_SystemShadowsToBase("shadows mix core tone mix",Range(0,1)) = 0 - [Space(18)] + // [Space(18)] [Enum(Off,0,On,1)] _Diff_GSF_01("Toon ramp GSF effect", Int) = 0 _DiffGSF_Offset("--Offset",Range(0,2)) = 1 _DiffGSF_Feather("--Feather",Range(0.0001,2)) = 0.2 - [Header(Specular Shine)] + // [Header(Specular Shine)] [Toggle(_)] _UseSpecularSystem("Use specular effects",Int) = 0 - [Enum(Unity Specular Setup,0,Add,1)] _Is_BlendAddToHiColor("Specular Blend mode", Int ) = 1 + [Enum(On,0,Off,1)] _Is_BlendAddToHiColor("Energy conservation", Int ) = 1 [HDR] _SpecColor("Specular Primary Color",Color) = (.5,.5,.5,1) _Glossiness("Smoothness",Range(0,1)) = .3 _HighColor_Tex("--Specular Setup Tex: (RGB):Tint, (A):Smoothness", 2D) = "white" {} @@ -41,21 +41,21 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaCutout_Dither" { _SpecularMaskHSV("--Adjest (H)ue (S)sat (V)alue (I)ntensity",Float) = (0,0,0,1) [HDR] _HighColor("Spec col 01", Color) = (1,1,1,1) [Enum(Sharp,0,Soft,1,Unity,2)] _Is_SpecularToHighColor("Specular mode", Int ) = 0 - _TweakHighColorOnShadow("Spec shadow mask", Range(0, 1)) = 1 + _TweakHighColorOnShadow("Spec shadow mask", Range(0, 1)) = 0.5 - [Header(Reflection)] + // [Header(Reflection)] [Enum(None,0,Standard,1,Override,2)] _ENVMmode("Reflection Setup:",Int) = 0 _ENVMix("--Reflection mix",Range(0,1)) = 1 _envRoughness("--Reflection smoothness", Range(0, 1)) = 0.34 [Enum(Off,0,Smart,1,Replace,2)] _CubemapFallbackMode("Fallback mix mode:",Int) = 0 [NoScaleOffset] _CubemapFallback("--Fallback Cubemap",Cube) = "black" {} - [Space(18)] + // [Space(18)] [Enum(Off,0,On,1)] _EnvGrazeMix("Graze Natural mix",Int) = 1 [Enum(Off,0,On,1)] _EnvGrazeRimMix("Graze RimLights Mask mix",Int) = 0 _envOnRim("Mask on rimLights", Range(0,1)) = 0.25 _envOnRimColorize("--Colorize rim lights", Range(0,1)) = 0 - [Header(Rimlights)] + // [Header(Rimlights)] [Enum(Off,0,Add,1)] _RimLight("RimLight blend",Int) = 1 [Enum(Off,0,Add,1)] _Add_Antipodean_RimLight("Ap RimLight blend",Int) = 1 _rimAlbedoMix("Mix Albedo",Range(0,1)) = 0 @@ -69,8 +69,8 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaCutout_Dither" { [Toggle(_)] _LightDirection_MaskOn("Use light direction",Int) = 1 _Tweak_LightDirection_MaskLevel("--Mask: Light direction",Range(0, 1)) = 0 - [Header(Matcap)] - [Enum(Off,0,On,1)] _MatCap("Use MatCap", Int ) = 0 + // [Header(Matcap)] + [Toggle(_)] _MatCap("Use MatCap", Int ) = 0 [HDR] _MatCapColMult ("Diffuse color", Color) = (1,1,1,1) [NoScaleOffset] _MatCapTexMult ("Diffuse matcap", 2D) = "black" {} [HDR] _MatCapColAdd ("Specular color", Color) = (1,1,1,1) @@ -79,7 +79,7 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaCutout_Dither" { [NoScaleOffset] _MatCapTexEmis ("Emissive matcap", 2D) = "black" {} [Toggle(_)] _Is_NormalMapForMatCap("Use matcap normalMap ", Float ) = 0 _NormalMapForMatCap("--MatCap normalMap", 2D) = "bump" {} - [Space(9)] + // [Space(9)] _Tweak_MatCapUV("Zoom matCap", Range(-0.5, 0.5)) = 0 _Rotate_MatCapUV("Rotate matCap", Range(-1, 1)) = 0 _Rotate_NormalMapForMatCapUV("Rotate normalMap matCap", Range(-1, 1)) = 0 @@ -87,20 +87,20 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaCutout_Dither" { _Set_MatcapMask("Diffuse matcap mask (G)", 2D) = "white" {} _Tweak_MatcapMaskLevel("--Tweak mask", Range(-1, 1)) = 0 - [Header(Emission)] + // [Header(Emission)] [HDR] _Emissive_Color("Emissive color", Color) = (0,0,0,1) [HDR] _EmissiveProportional_Color("Emissive Proportional color", Color) = (0,0,0,1) _Emissive_Tex("Emissive mask (G)", 2D) = "white" {} _EmissionColorTex("--Emissive color (RGB)", 2D) = "white" {} - [Header(Lighting Behaviour)] + // [Header(Lighting Behaviour)] _directLightIntensity("Direct light intensity",Range(0,1)) = 1 [Enum(HDR,0,Limit,1)] _forceLightClamp("Force scene Lights Clamp",Int) = 0 [Enum(Real ADD,0,Safe MAX,4)] _BlendOp("Additional lights blending", Float) = 4 _shadowCastMin_black("Dynamic Shadow Removal",Range(0.0,1.0)) = 0.1 [NoScaleOffset] _DynamicShadowMask("Dynamic Shadow mask",2D) = "black" {} - [Header(Light Map Shift Masks)] + // [Header(Light Map Shift Masks)] [Enum(Off,0,On,1,Use Vertex Color Red,2)] _UseLightMap("Light Map mode", Int) = 0 _LightMap("Light map mask (G)", 2D) = "gray" {} _lightMap_remapArr("--Range: (Z):LOW, (W):HIGH", Vector) = (-1,-1,0,1) @@ -110,13 +110,13 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaCutout_Dither" { [NoScaleOffset] _Set_1st_ShadePosition("Forward Toon Shadows (G)", 2D) = "white" {} [NoScaleOffset] _Set_2nd_ShadePosition("Backward Toon Shadow (G)", 2D) = "white" {} - [Header(Ambient Occlusion Maps)] + // [Header(Ambient Occlusion Maps)] _Set_HighColorMask("Specular Mask (G)", 2D) = "white" {} _Tweak_HighColorMaskLevel("--Tweak Mask", Range(-1, 1)) = 0 _Set_RimLightMask("RimLight Mask (G)", 2D) = "white" {} _Tweak_RimLightMaskLevel("--Tweak Mask", Range(-1, 1)) = 0 - [Header(Normal map)] + // [Header(Normal map)] _NormalMap("NormalMap", 2D) = "bump" {} _DetailNormalMapScale01("--Detail scale", Range(0,1)) = 0 _NormalMapDetail("----Detail Normal map", 2d) = "bump" {} @@ -126,20 +126,20 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaCutout_Dither" { [Toggle(_)] _Is_NormalMapToRimLight("On Rims",Int) = 1 [Toggle(_)] _Is_NormaMapToEnv("On Reflection",Int) = 1 - [Header(Alpha mask)] - [Space(18)] + // [Header(Alpha mask)] + // [Space(18)] // [Enum(Off,0,On,1)] _ZWrite("Z Write Depth sorting (Recommend off)",Int) = 1 [Enum(Clipping Mask,0,Main Texture,1)] _IsBaseMapAlphaAsClippingMask("Alpha mask source",Int) = 1 _ClippingMask("--Clipping mask (G)",2D) = "white" {} [Toggle(_)] _Inverse_Clipping("Inverse clipping",Int) = 0 _Clipping_Level("Clipping level",Range(0, 1)) = 0.5 _Tweak_transparency("--Tweak transparency",Range(-1, 1)) = 0 - [Space(18)] + // [Space(18)] // [Enum(alpha,0,reflect,1)] _UseSpecAlpha("Specular Alpha opacity",Int) = 0 [Toggle(_)] _DetachShadowClipping("Separate Shadow Clipping Level",Int) = 0 _Clipping_Level_Shadow("--Shadow Clip",Range(0, 1)) = 1 - [Header(Stencil Helpers. Requires Queue Order Edits)] + // [Header(Stencil Helpers. Requires Queue Order Edits)] _Stencil("Stencil ID [0;255]", Range(0,255)) = 0 [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("--Comparison", Int) = 0 [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp("--Pass", Int) = 0 @@ -187,7 +187,9 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaCutout_Dither" { #include "UnityCG.cginc" #include "AutoLight.cginc" #include "Lighting.cginc" - #pragma multi_compile_fwdbase_fullshadows + // #pragma multi_compile_fwdbase_fullshadows + #pragma multi_compile_fwdbase + #pragma multi_compile_instancing #pragma multi_compile_fog #pragma multi_compile UNITY_PASS_FORWARDBASE #pragma multi_compile _ UNITY_HDR_ON @@ -227,6 +229,7 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaCutout_Dither" { #include "AutoLight.cginc" #include "Lighting.cginc" #pragma multi_compile_fwdadd_fullshadows + #pragma multi_compile_instancing #pragma multi_compile_fog #pragma multi_compile UNITY_PASS_FORWARDADD #pragma multi_compile _ UNITY_HDR_ON @@ -254,10 +257,12 @@ Shader "ACiiL/toon/ACLS_Toon_AlphaCutout_Dither" { #include "Lighting.cginc" #pragma fragmentoption ARB_precision_hint_fastest #pragma multi_compile_shadowcaster + #pragma multi_compile_instancing #define Dither #include "ACLS_ShadowCaster.cginc" ENDCG } } FallBack "Legacy Shaders/VertexLit" + CustomEditor "ACLSInspector" } diff --git a/Assets/shaders/aciil/ACLS/ACLS_base_solid.shader b/Assets/shaders/aciil/ACLS/ACLS_base_solid.shader index f7dbebc..3c44689 100644 --- a/Assets/shaders/aciil/ACLS/ACLS_base_solid.shader +++ b/Assets/shaders/aciil/ACLS/ACLS_base_solid.shader @@ -5,16 +5,17 @@ Shader "ACiiL/toon/ACLS_Toon_Solid" { Properties { [Enum(OFF,0,FRONT,1,BACK,2)] _CullMode("Cull Mode", int) = 2 //OFF/FRONT/BACK [HDR] _backFaceColorTint("Backface Color Tint",Color) = (1,1,1,1) + // [ToggleUI] _TestToggle ("Test toggle",Int) = 0 - [Header(Testing)] + // [Header(Testing)] // _AO_shadePosFront_Offset("Front Offset", Range(-1,1)) = 0 // _AO_shadePosBack_Offset("Back Offset", Range(-1,1)) = 0 - [Header(Toon ramp)] + // [Header(Toon ramp)] _MainTex("Main Tex", 2D) = "white" {} [Enum(Self,0,MainTex,1)] _Use_BaseAs1st("1st shade source", Int) = 1 [NoScaleOffset] _1st_ShadeMap("--1st shade Tex", 2D) = "white" {} - [Enum(Self,0,Shade1,1,MainTex,2)] _Use_1stAs2nd("2st shade source", Int) = 1 + [Enum(Self,0,Shade1,1,MainTex,2)] _Use_1stAs2nd("2nd shade source", Int) = 1 [NoScaleOffset] _2nd_ShadeMap("--2nd shade Tex", 2D) = "white" {} [HDR] _Color("Base color", Color) = (1,1,1,1) [HDR] _0_ShadeColor("--Foward color", Color) = (0.97,0.97,0.97,1) @@ -26,14 +27,14 @@ Shader "ACiiL/toon/ACLS_Toon_Solid" { _1st2nd_Shades_Feather("--Feather: back", Range(0.0001, 1)) = 0.001 [Enum(All Light,0,Natural ambient,1)] _ToonRampLightSourceType_Backwards("Toon ramp Backface light source type:",Int) = 0 // _Set_SystemShadowsToBase("shadows mix core tone mix",Range(0,1)) = 0 - [Space(18)] + // [Space(18)] [Enum(Off,0,On,1)] _Diff_GSF_01("Toon ramp GSF effect", Int) = 0 _DiffGSF_Offset("--Offset",Range(0,2)) = 1 _DiffGSF_Feather("--Feather",Range(0.0001,2)) = 0.2 - [Header(Specular Shine)] + // [Header(Specular Shine)] [Toggle(_)] _UseSpecularSystem("Use specular effects",Int) = 0 - [Enum(Unity Specular Setup,0,Add,1)] _Is_BlendAddToHiColor("Specular Blend mode", Int ) = 1 + [Enum(On,0,Off,1)] _Is_BlendAddToHiColor("Energy conservation", Int ) = 1 [HDR] _SpecColor("Specular Primary Color",Color) = (.5,.5,.5,1) _Glossiness("Smoothness",Range(0,1)) = .3 _HighColor_Tex("--Specular Setup Tex: (RGB):Tint, (A):Smoothness", 2D) = "white" {} @@ -41,21 +42,21 @@ Shader "ACiiL/toon/ACLS_Toon_Solid" { _SpecularMaskHSV("--Adjest (H)ue (S)sat (V)alue (I)ntensity",Float) = (0,0,0,1) [HDR] _HighColor("Spec col 01", Color) = (1,1,1,1) [Enum(Sharp,0,Soft,1,Unity,2)] _Is_SpecularToHighColor("Specular mode", Int ) = 0 - _TweakHighColorOnShadow("Spec shadow mask", Range(0, 1)) = 1 + _TweakHighColorOnShadow("Spec shadow mask", Range(0, 1)) = 0.5 - [Header(Reflection)] + // [Header(Reflection)] [Enum(None,0,Standard,1,Override,2)] _ENVMmode("Reflection Setup:",Int) = 0 _ENVMix("--Reflection mix",Range(0,1)) = 1 _envRoughness("--Reflection smoothness", Range(0, 1)) = 0.34 [Enum(Off,0,Smart,1,Replace,2)] _CubemapFallbackMode("Fallback mix mode:",Int) = 0 [NoScaleOffset] _CubemapFallback("--Fallback Cubemap",Cube) = "black" {} - [Space(18)] + // [Space(18)] [Enum(Off,0,On,1)] _EnvGrazeMix("Graze Natural mix",Int) = 1 [Enum(Off,0,On,1)] _EnvGrazeRimMix("Graze RimLights Mask mix",Int) = 0 _envOnRim("Mask on rimLights", Range(0,1)) = 0.25 _envOnRimColorize("--Colorize rim lights", Range(0,1)) = 0 - [Header(Rimlights)] + // [Header(Rimlights)] [Enum(Off,0,Add,1)] _RimLight("RimLight blend",Int) = 1 [Enum(Off,0,Add,1)] _Add_Antipodean_RimLight("Ap RimLight blend",Int) = 1 _rimAlbedoMix("Mix Albedo",Range(0,1)) = 0 @@ -69,8 +70,8 @@ Shader "ACiiL/toon/ACLS_Toon_Solid" { [Toggle(_)] _LightDirection_MaskOn("Use light direction",Int) = 1 _Tweak_LightDirection_MaskLevel("--Mask: Light direction",Range(0, 1)) = 0 - [Header(Matcap)] - [Enum(Off,0,On,1)] _MatCap("Use MatCap", Int ) = 0 + // [Header(Matcap)] + [Toggle(_)] _MatCap("Use MatCap", Int ) = 0 [HDR] _MatCapColMult ("Diffuse color", Color) = (1,1,1,1) [NoScaleOffset] _MatCapTexMult ("Diffuse matcap", 2D) = "black" {} [HDR] _MatCapColAdd ("Specular color", Color) = (1,1,1,1) @@ -79,7 +80,7 @@ Shader "ACiiL/toon/ACLS_Toon_Solid" { [NoScaleOffset] _MatCapTexEmis ("Emissive matcap", 2D) = "black" {} [Toggle(_)] _Is_NormalMapForMatCap("Use matcap normalMap ", Float ) = 0 _NormalMapForMatCap("--MatCap normalMap", 2D) = "bump" {} - [Space(9)] + // [Space(9)] _Tweak_MatCapUV("Zoom matCap", Range(-0.5, 0.5)) = 0 _Rotate_MatCapUV("Rotate matCap", Range(-1, 1)) = 0 _Rotate_NormalMapForMatCapUV("Rotate normalMap matCap", Range(-1, 1)) = 0 @@ -87,20 +88,20 @@ Shader "ACiiL/toon/ACLS_Toon_Solid" { _Set_MatcapMask("Diffuse matcap mask (G)", 2D) = "white" {} _Tweak_MatcapMaskLevel("--Tweak mask", Range(-1, 1)) = 0 - [Header(Emission)] + // [Header(Emission)] [HDR] _Emissive_Color("Emissive color", Color) = (0,0,0,1) [HDR] _EmissiveProportional_Color("Emissive Proportional color", Color) = (0,0,0,1) _Emissive_Tex("Emissive mask (G)", 2D) = "white" {} _EmissionColorTex("--Emissive color (RGB)", 2D) = "white" {} - [Header(Lighting Behaviour)] + // [Header(Lighting Behaviour)] _directLightIntensity("Direct light intensity",Range(0,1)) = 1 [Enum(HDR,0,Limit,1)] _forceLightClamp("Force scene Lights Clamp",Int) = 0 [Enum(Real ADD,0,Safe MAX,4)] _BlendOp("Additional lights blending", Float) = 4 _shadowCastMin_black("Dynamic Shadow Removal",Range(0.0,1.0)) = 0.1 [NoScaleOffset] _DynamicShadowMask("Dynamic Shadow mask",2D) = "black" {} - [Header(Light Map Shift Masks)] + // [Header(Light Map Shift Masks)] [Enum(Off,0,On,1,Use Vertex Color Red,2)] _UseLightMap("Light Map mode", Int) = 0 _LightMap("Light map mask (G)", 2D) = "gray" {} _lightMap_remapArr("--Range: (Z):LOW, (W):HIGH", Vector) = (-1,-1,0,1) @@ -110,13 +111,13 @@ Shader "ACiiL/toon/ACLS_Toon_Solid" { [NoScaleOffset] _Set_1st_ShadePosition("Forward Toon Shadows (G)", 2D) = "white" {} [NoScaleOffset] _Set_2nd_ShadePosition("Backward Toon Shadow (G)", 2D) = "white" {} - [Header(Ambient Occlusion Maps)] + // [Header(Ambient Occlusion Maps)] _Set_HighColorMask("Specular Mask (G)", 2D) = "white" {} _Tweak_HighColorMaskLevel("--Tweak Mask", Range(-1, 1)) = 0 _Set_RimLightMask("RimLight Mask (G)", 2D) = "white" {} _Tweak_RimLightMaskLevel("--Tweak Mask", Range(-1, 1)) = 0 - [Header(Normal map)] + // [Header(Normal map)] _NormalMap("NormalMap", 2D) = "bump" {} _DetailNormalMapScale01("--Detail scale", Range(0,1)) = 0 _NormalMapDetail("----Detail Normal map", 2d) = "bump" {} @@ -126,11 +127,11 @@ Shader "ACiiL/toon/ACLS_Toon_Solid" { [Toggle(_)] _Is_NormalMapToRimLight("On Rims",Int) = 1 [Toggle(_)] _Is_NormaMapToEnv("On Reflection",Int) = 1 - [Header(Alpha mask)] - [Space(198)] - [Space(18)] + // [Header(Alpha mask)] + // [Space(198)] + // [Space(18)] - [Header(Stencil Helpers. Requires Queue Order Edits)] + // [Header(Stencil Helpers. Requires Queue Order Edits)] _Stencil("Stencil ID [0;255]", Range(0,255)) = 0 [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("--Comparison", Int) = 0 [Enum(UnityEngine.Rendering.StencilOp)] _StencilOp("--Pass", Int) = 0 @@ -172,7 +173,9 @@ Shader "ACiiL/toon/ACLS_Toon_Solid" { #include "UnityCG.cginc" #include "AutoLight.cginc" #include "Lighting.cginc" - #pragma multi_compile_fwdbase_fullshadows + // #pragma multi_compile_fwdbase_fullshadows + #pragma multi_compile_fwdbase + #pragma multi_compile_instancing #pragma multi_compile_fog #pragma multi_compile UNITY_PASS_FORWARDBASE #pragma multi_compile _ UNITY_HDR_ON @@ -208,6 +211,7 @@ Shader "ACiiL/toon/ACLS_Toon_Solid" { #include "AutoLight.cginc" #include "Lighting.cginc" #pragma multi_compile_fwdadd_fullshadows + #pragma multi_compile_instancing #pragma multi_compile_fog #pragma multi_compile UNITY_PASS_FORWARDADD #pragma multi_compile _ UNITY_HDR_ON @@ -234,10 +238,12 @@ Shader "ACiiL/toon/ACLS_Toon_Solid" { #include "Lighting.cginc" #pragma fragmentoption ARB_precision_hint_fastest #pragma multi_compile_shadowcaster + #pragma multi_compile_instancing #define NotAlpha #include "ACLS_ShadowCaster.cginc" ENDCG } } FallBack "Legacy Shaders/VertexLit" + CustomEditor "ACLSInspector" } diff --git a/Assets/shaders/aciil/ACLS/Editor/ACLSInspector.cs b/Assets/shaders/aciil/ACLS/Editor/ACLSInspector.cs new file mode 100644 index 0000000..894c709 --- /dev/null +++ b/Assets/shaders/aciil/ACLS/Editor/ACLSInspector.cs @@ -0,0 +1,491 @@ +using UnityEditor; +using UnityEngine; +// using System.Collections; +// using System.Collections.Generic; +// using System.Linq; +// using System; +using System.Reflection; + +// Base prepared by Morioh for me. +// This code is based off synqark's arktoon-shaders and Xiexe. +// Citation to "https://github.com/synqark", "https://github.com/synqark/arktoon-shaders", https://gitlab.com/xMorioh/moriohs-toon-shader. + +public class ACLSInspector : ShaderGUI +{ + BindingFlags bindingFlags = BindingFlags.Public | + BindingFlags.NonPublic | + BindingFlags.Instance | + BindingFlags.Static; + // Toon ramp + MaterialProperty _CullMode = null; + MaterialProperty _backFaceColorTint = null; + MaterialProperty _Use_BaseAs1st = null; + MaterialProperty _1st_ShadeMap = null; + MaterialProperty _Use_1stAs2nd = null; + MaterialProperty _2nd_ShadeMap = null; + MaterialProperty _MainTex = null; + MaterialProperty _Color = null; + MaterialProperty _0_ShadeColor = null; + MaterialProperty _1st_ShadeColor = null; + MaterialProperty _2nd_ShadeColor = null; + MaterialProperty _BaseColor_Step = null; + MaterialProperty _BaseShade_Feather = null; + MaterialProperty _ShadeColor_Step = null; + MaterialProperty _1st2nd_Shades_Feather = null; + MaterialProperty _ToonRampLightSourceType_Backwards = null; + MaterialProperty _Diff_GSF_01 = null; + MaterialProperty _DiffGSF_Offset = null; + MaterialProperty _DiffGSF_Feather = null; + // Specular Shine + MaterialProperty _UseSpecularSystem = null; + MaterialProperty _Is_BlendAddToHiColor = null; + MaterialProperty _SpecColor = null; + MaterialProperty _Glossiness = null; + MaterialProperty _HighColor_Tex = null; + MaterialProperty _highColTexSource = null; + MaterialProperty _SpecularMaskHSV = null; + MaterialProperty _HighColor = null; + MaterialProperty _Is_SpecularToHighColor = null; + MaterialProperty _TweakHighColorOnShadow = null; + // Reflection + MaterialProperty _ENVMmode = null; + MaterialProperty _ENVMix = null; + MaterialProperty _envRoughness = null; + MaterialProperty _CubemapFallbackMode = null; + MaterialProperty _CubemapFallback = null; + MaterialProperty _EnvGrazeMix = null; + MaterialProperty _EnvGrazeRimMix = null; + MaterialProperty _envOnRim = null; + MaterialProperty _envOnRimColorize = null; + // Rimlights + MaterialProperty _RimLight = null; + MaterialProperty _Add_Antipodean_RimLight = null; + MaterialProperty _rimAlbedoMix = null; + MaterialProperty _RimLightSource = null; + MaterialProperty _RimLightColor = null; + MaterialProperty _Ap_RimLightColor = null; + MaterialProperty _RimLight_Power = null; + MaterialProperty _Ap_RimLight_Power = null; + MaterialProperty _RimLight_InsideMask = null; + MaterialProperty _RimLightAreaOffset = null; + MaterialProperty _LightDirection_MaskOn = null; + MaterialProperty _Tweak_LightDirection_MaskLevel = null; + // Matcap + MaterialProperty _MatCap = null; + MaterialProperty _MatCapColMult = null; + MaterialProperty _MatCapTexMult = null; + MaterialProperty _MatCapColAdd = null; + MaterialProperty _MatCapTexAdd = null; + MaterialProperty _MatCapColEmis = null; + MaterialProperty _MatCapTexEmis = null; + MaterialProperty _Is_NormalMapForMatCap = null; + MaterialProperty _NormalMapForMatCap = null; + MaterialProperty _Tweak_MatCapUV = null; + MaterialProperty _Rotate_MatCapUV = null; + MaterialProperty _Rotate_NormalMapForMatCapUV = null; + MaterialProperty _TweakMatCapOnShadow = null; + MaterialProperty _Set_MatcapMask = null; + MaterialProperty _Tweak_MatcapMaskLevel = null; + // Emission + MaterialProperty _Emissive_Color = null; + MaterialProperty _EmissiveProportional_Color = null; + MaterialProperty _Emissive_Tex = null; + MaterialProperty _EmissionColorTex = null; + // Lighting Behaviour + MaterialProperty _directLightIntensity = null; + MaterialProperty _forceLightClamp = null; + MaterialProperty _BlendOp = null; + MaterialProperty _shadowCastMin_black = null; + MaterialProperty _DynamicShadowMask = null; + // Light Map Shift Masks + MaterialProperty _UseLightMap = null; + MaterialProperty _LightMap = null; + MaterialProperty _lightMap_remapArr = null; + MaterialProperty _toonLambAry_01 = null; + MaterialProperty _toonLambAry_02 = null; + MaterialProperty _Set_1st_ShadePosition = null; + MaterialProperty _Set_2nd_ShadePosition = null; + // Ambient Occlusion Maps + MaterialProperty _Set_HighColorMask = null; + MaterialProperty _Tweak_HighColorMaskLevel = null; + MaterialProperty _Set_RimLightMask = null; + MaterialProperty _Tweak_RimLightMaskLevel = null; + // Normal map + MaterialProperty _NormalMap = null; + MaterialProperty _DetailNormalMapScale01 = null; + MaterialProperty _NormalMapDetail = null; + MaterialProperty _DetailNormalMask = null; + MaterialProperty _Is_NormalMapToBase = null; + MaterialProperty _Is_NormalMapToHighColor = null; + MaterialProperty _Is_NormalMapToRimLight = null; + MaterialProperty _Is_NormaMapToEnv = null; + // Alpha mask + MaterialProperty _ZWrite = null; + MaterialProperty _IsBaseMapAlphaAsClippingMask = null; + MaterialProperty _ClippingMask = null; + MaterialProperty _Inverse_Clipping = null; + MaterialProperty _Clipping_Level = null; + MaterialProperty _Tweak_transparency = null; + MaterialProperty _UseSpecAlpha = null; + MaterialProperty _DetachShadowClipping = null; + MaterialProperty _Clipping_Level_Shadow = null; + // Stencil Helpers. Requires Queue Order Edits + MaterialProperty _Stencil = null; + MaterialProperty _StencilComp = null; + MaterialProperty _StencilOp = null; + MaterialProperty _StencilFail = null; + // + static bool showToonramp = true; + static bool showSpecularShine = false; + static bool showReflection = false; + static bool showRimlights = false; + static bool showMatcap = false; + static bool showEmission = false; + static bool showLightingBehaviour = false; + static bool showLightMapShiftMasks = false; + static bool showAmbientOcclusionMaps = false; + static bool showNormalmap = false; + static bool showAlphamask = false; + static bool StencilHelpers = false; + + // test + // static int testInt = 1337; + + // + bool iscutout = false; + bool iscutoutAlpha = false; + bool isDither = false; + // bool issolid = false; + + + public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props) + { + Material material = materialEditor.target as Material; + Shader shader = material.shader; + + iscutout = shader.name.Contains("ACLS_Toon_Cutout"); + iscutoutAlpha = shader.name.Contains("ACLS_Toon_AlphaTransparent"); + isDither = shader.name.Contains("ACLS_Toon_AlphaCutout_Dither"); + // issolid = shader.name.Contains("ACLS_Toon_Solid"); + // + foreach (var property in GetType().GetFields(bindingFlags)) + { + if (property.FieldType == typeof(MaterialProperty)) + { + try{ property.SetValue(this, FindProperty(property.Name, props)); } catch { /*Is it really a problem if it doesn't exist?*/ } + } + } + // + EditorGUI.BeginChangeCheck(); + { + ACLStyles.ShurikenHeaderCentered(ACLStyles.ver); + // EditorGUILayout.LabelField("New value----------------------------------------------------------------------"); + // EditorGUILayout.HelpBox("BLAH BLAH BLAH BLAH", MessageType.None, true); + // testInt = EditorGUILayout.IntField(testInt); + + showLightingBehaviour = ACLStyles.ShurikenFoldout("General Lighting Behaviour", showLightingBehaviour); + if (showLightingBehaviour) + { + materialEditor.ShaderProperty(_CullMode, new GUIContent("Cull Mode", "Culling backward/forward/no faces")); + EditorGUI.indentLevel++; + materialEditor.ShaderProperty(_backFaceColorTint, new GUIContent("Backface Color Tint", "Back face color. Use to tint backfaces in certain mesh setups.\nRecommend creating actual backface mesh as backfaces reveals depth sorting issues and line artifacts.")); + EditorGUI.indentLevel--; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_shadowCastMin_black, new GUIContent("Dynamic Shadows Removal", "Counters undesirable hard dynamic shadow constrasts for NPR styles in maps with strong direct:ambient light contrasts.\nModifies direct light dynamic shadows behaviour: Each Directional/Point/Spot light in the scene has its own shadow settings and this slider at 1.0 \"brightens\" shadows away.\nUse 0.0 for intended PBR.")); + materialEditor.TexturePropertySingleLine(new GUIContent("Dynamic Shadows Mask (G)", "Works like Realtime Shadows Removal. Texture brightness removes like the slider value."), _DynamicShadowMask); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_DynamicShadowMask); + EditorGUI.indentLevel--; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_directLightIntensity, new GUIContent("Direct Light Intensity", "Soft counter for overbright maps. Dim direct light sources and thus rely more on map ambient.")); + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_ToonRampLightSourceType_Backwards, new GUIContent("Diffuse Backwards Light Mode", "For pbr/npr effects on diffuse backface area.\nAll Light: Adds direct(with shadows) and ambient light together.\nNatural ambient: Closer to PBR, backface is only ambient light as there is realistically no direct light.")); + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_forceLightClamp, new GUIContent("Scene Light clamping", "Hard Counter for overbright maps.\nHDR: When map has correctly setup \"Exposure High Definition Range (HDR)\": balancing brightness with post proccess in a realistic range.\nLimit: Prevention when map overblows your avatar colors or you glow. These maps typically attempted \"Low Definition Range (LDR)\" light levelling, were it assumes scene lights are never over 100% white and toon shaders may clamp to 100% as enforcement rule, and that only emission light goes over 100% which causes bloom.")); + if (!(iscutoutAlpha)){ + materialEditor.ShaderProperty(_BlendOp, new GUIContent("Additional Lights Blending", "How realtime Point and Spot lights combine color.\nRecommend MAX for NPR lighting that reduces overblowing color in none \"Exposure HDR\" maps (See Scene Light clamping for def).\nAdd: PBR,If you trust the maps lighting set for correct light adding.\nNot usable in Alpha Transparent due to Premultiply alpha blending needing ADD.")); + } + } + + showToonramp = ACLStyles.ShurikenFoldout("Diffuse Reflection. Toon Ramp Effects", showToonramp); + if (showToonramp) + { + // materialEditor.ShaderProperty(_CullMode, _CullMode.displayName); + materialEditor.TexturePropertySingleLine(new GUIContent("Main (Forward) Texture", "Main texture. As Forward Area intended for surface most towards light and the visual effect of being in direct light."), _MainTex); + // materialEditor.TexturePropertySingleLine(new GUIContent("Main Tex", ""), _MainTex, _Color); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_MainTex); + EditorGUI.indentLevel--; + materialEditor.ShaderProperty(_Use_BaseAs1st, new GUIContent("Core Source", "Unless you have custom set to MainTex.")); + EditorGUI.indentLevel++; + materialEditor.TexturePropertySingleLine(new GUIContent("Core Texture", "If used as source. A NPR helper, \"Core Area\' is intended as the core area were light slowly angles perpendicular and artistically painted NPR effects may occur. For example painted subsurface colouring as light penetrates the acute surface and emits within the core shallows, or shadows may be painted to indicated ambient occlusion, where light cannot enter and leave this sharp angle."), _1st_ShadeMap); + EditorGUI.indentLevel--; + materialEditor.ShaderProperty(_Use_1stAs2nd, new GUIContent("Backward Source", "Unless you have custom set to MainTex.")); + EditorGUI.indentLevel++; + materialEditor.TexturePropertySingleLine(new GUIContent("Backward Texture", "If used as source. A NPR helper, \"Backwards Area\' is intended as the area were direct light cannot hit and artistically painted represents only ambient light and no painted on shadows."), _2nd_ShadeMap); + EditorGUI.indentLevel--; + materialEditor.ShaderProperty(_Color, new GUIContent("Primary Diffuse Color", "Primary diffuse color control.")); + EditorGUI.indentLevel++; + materialEditor.ShaderProperty(_0_ShadeColor, new GUIContent("Forward Color", "See Main (Forward) Texture tooltip.")); + materialEditor.ShaderProperty(_1st_ShadeColor, new GUIContent("Core Color", "See Core Texture tooltip.")); + materialEditor.ShaderProperty(_2nd_ShadeColor, new GUIContent("Backward Color", "See Backword Texture tooltip.")); + EditorGUI.indentLevel--; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_BaseColor_Step, new GUIContent("Step Core", "Were Forward area blends to Core and Core overwraps Backwards Area\n0.5 is perpendicular to direct light.")); + EditorGUI.indentLevel++; + materialEditor.ShaderProperty(_BaseShade_Feather, new GUIContent("Feather Core", "Softens warp, wraps away from light, so increase Step Core as you soften.")); + EditorGUI.indentLevel--; + materialEditor.ShaderProperty(_ShadeColor_Step, new GUIContent("Step Backward", "Were Backward area blends behind & within Core Area.\n0.5 is perpendicular to direct light.")); + EditorGUI.indentLevel++; + materialEditor.ShaderProperty(_1st2nd_Shades_Feather, new GUIContent("Feather Backward", "Softens warp, wraps away from light, so increase Backwards Step as you soften.")); + EditorGUI.indentLevel--; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_Diff_GSF_01, new GUIContent("Diffuse GSF Effect", "Custom Geometric Shadowing Function (GSF) effect to simulate darkening or tinting of diffuse light in rough or penetrable surfaces at acute angles.\nEnabling will reveal The true mixing of regions between Forward/Core/Backaward Areas. Use this to help setup NPR cloth/skin/subsurface/iridescents setups.")); + EditorGUI.indentLevel++; + materialEditor.ShaderProperty(_DiffGSF_Offset, new GUIContent("Offset GSF", "Offset were GSF begins. You may need to use wide values.")); + materialEditor.ShaderProperty(_DiffGSF_Feather, new GUIContent("Feather GSF", "Blurs GSF")); + EditorGUI.indentLevel--; + } + + showLightMapShiftMasks = ACLStyles.ShurikenFoldout("Diffuse Light Shift Masks", showLightMapShiftMasks); + if (showLightMapShiftMasks) + { + materialEditor.TexturePropertySingleLine(new GUIContent("Diffuse Core AO (G)", "Manually forces diffuse \"Forwards\' Area to \'Core\' Area. Use to manually blend toon shadows by texture UV dynamically and union to light angle... which typically if painted on looks \"baked\" or unrealistic.\nYou may use a Ambient Occlusion Texture for this."), _Set_1st_ShadePosition); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_Set_1st_ShadePosition); + EditorGUI.indentLevel--; + materialEditor.TexturePropertySingleLine(new GUIContent("Diffuse Backward AO (G)", "Manually forces diffuse \"Core\' Area to \'Backwards\' Area. Use to manually blend toon shadows by texture UV dynamically and union to light angle... which typically if painted on looks \"baked\" or unrealistic.\nYou may use a Ambient Occlusion Texture for this."), _Set_2nd_ShadePosition); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_Set_2nd_ShadePosition); + EditorGUI.indentLevel--; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_UseLightMap, new GUIContent("LightMap Mode", "Overrides Diffuse NPR/PBR toon ramp wrapping according to intensity like a dynamic ambient occlusion (AO) mask which react to light direction onto the surface.\nScaled so 50% gray is no change, 100% white is bias towards Forward area, and 0% black is bias towards Backward Area.\nUse this Like a dynamic and reactive ambient occlusion mask to finely control NPR behaviour on diffuse.\nSetup: Define the diffuse area colors; set Core and Backward Steps to 0.5 (and Feather 0.0 for debug); apply & enable the light map from a AO mask; then finely control the Relevel's below for contolled diffuse wrapping.")); + EditorGUILayout.HelpBox("However LightMap Mode for usage and setup.", MessageType.None, true); + ACLStyles.PartingLine(); + materialEditor.TexturePropertySingleLine(new GUIContent("LightMap Mask (G)", ""), _LightMap); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_LightMap); + EditorGUI.indentLevel--; + materialEditor.ShaderProperty(_lightMap_remapArr, new GUIContent("Remap Levels", "Relevel texture high and low intensities to a [0,1] clamp.\nAdjust [Z] for low blacks and [W] for high whites.")); + EditorGUILayout.HelpBox("Relevel texture high and low intensities to a [0,1] clamp.\nAdjust [Z] for low blacks and [W] for high whites.", MessageType.None, true); + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_toonLambAry_01, new GUIContent("Core Remap", "Maps the LightMap intensity to Core ramp.\nOutput = [X] * (Input) + [Y]")); + materialEditor.ShaderProperty(_toonLambAry_02, new GUIContent("Backward Remap", "Maps the LightMap intensity to Backward ramp.\nOutput = [X] * (Input) + [Y]")); + EditorGUILayout.HelpBox("These adjest the LightMap Mask to Core and Backword Area toon ramps.\nOutput = [X] * (Input) + [Y]", MessageType.None, true); + } + + showSpecularShine = ACLStyles.ShurikenFoldout("Specular Reflection", showSpecularShine); + if (showSpecularShine) + { + materialEditor.ShaderProperty(_UseSpecularSystem, new GUIContent("Enable Specular", "Enables The direct light and Cubemap effects. Off effectively sets Primary Specular Color black which means both are off.")); + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_Is_BlendAddToHiColor, new GUIContent("Energy Conservation", "PBR and follows Standard Shader. Where specular intensity dims diffuse color.")); + materialEditor.ShaderProperty(_SpecColor, new GUIContent("Primary Specular Color", "Applies tint on Specular shine and Cubemap color.")); + materialEditor.ShaderProperty(_Glossiness, new GUIContent("Smoothness", "Follows Standard. Higher reflects the world more perfectly. Affects Shine lobe and Cubemap.")); + materialEditor.TexturePropertySingleLine(new GUIContent("Specular Mask(RGB). Smoothness(A)", "You must know how \"specular setup\" works. (RGB) intensity means more metallic, lower color saturation means more metallic (reflects without tint from surface). (A) is Smoothness value."), _HighColor_Tex); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_HighColor_Tex); + EditorGUI.indentLevel--; + materialEditor.ShaderProperty(_highColTexSource, new GUIContent("Blend Albedo", "If you dont have a custom spec mask, you may borrow and blend the diffuse textures.\nI recommend modifying (V) against pixel darkness, (I) for white intensity, (S) for metallicness.")); + EditorGUI.indentLevel++; + materialEditor.ShaderProperty(_SpecularMaskHSV, new GUIContent("Texture (HSVI)", "")); + EditorGUILayout.HelpBox("XYZW -> HSVI. Color adjestment when Blending from Albedo.", MessageType.None, true); + EditorGUI.indentLevel--; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_HighColor, new GUIContent("Shine Tint", "Multiplies over Shines color intensity and tints. Can use to shut it off (use black), or overpower in HDR (for controlling Sharp and Soft mode).")); + materialEditor.ShaderProperty(_Is_SpecularToHighColor, new GUIContent("Specular Shine Type", "Override Shape and Soft brightness with Shine Tint.\nSharp: Toony\nSoft: Simple and subtle lode\nUnity: Follow Unity's PBR")); + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_TweakHighColorOnShadow, new GUIContent("Shine Shadow Reactivity", "Affects Shine lobe's dimming in dynamic shadow. 0.0 is ignore dynamic shadows completely.")); + } + + showReflection = ACLStyles.ShurikenFoldout("Cubemap Reflection Behavour", showReflection); + if (showReflection) + { + materialEditor.ShaderProperty(_CubemapFallbackMode, new GUIContent("Fallback Mode", "Fallback Cubemap intensifies to average lighting.\nSmart: Enables when map gives nothing.\nAlways: Always override with custom.")); + EditorGUI.indentLevel++; + materialEditor.TexturePropertySingleLine(new GUIContent("Fallback Cubemap", ""), _CubemapFallback); + // EditorGUI.indentLevel++; + // materialEditor.TextureScaleOffsetProperty(_CubemapFallback); + // // EditorGUI.indentLevel--; + EditorGUI.indentLevel--; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_ENVMmode, new GUIContent("Enable & Contols", "Cubemap visibility is off unless set here.\nStandard: Follows Standard Shader formula.\nOverride: You define Intensity and Roughness exactly.")); + EditorGUI.indentLevel++; + materialEditor.ShaderProperty(_ENVMix, new GUIContent("Intensity", "With Standard: Rescales value by this.\nWith Override: Replace the value from smoothness and ignores roughness mask (can use this to blur Cubemap into abstract tone).")); + materialEditor.ShaderProperty(_envRoughness, new GUIContent("Roughness", "For Override only.")); + EditorGUI.indentLevel--; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_EnvGrazeMix, new GUIContent("Use Natural Fresnel", "Natural unmaskable specular at sharp angles linked to Specular.")); + materialEditor.ShaderProperty(_EnvGrazeRimMix, new GUIContent("Use RimLight Fresnel", "Unmaskable specular at sharp angles linked to Specular. Uses Rim Lighting visibility as mask.")); + + } + + showRimlights = ACLStyles.ShurikenFoldout("Rim Lighting (Simplified Cubemap Fresnel Effects)", showRimlights); + if (showRimlights) + { + materialEditor.ShaderProperty(_RimLight, new GUIContent("Enable RimLight +", "Rimming towards light source.\nAlso activates this as mask for Cubemap Fresnel.")); + materialEditor.ShaderProperty(_Add_Antipodean_RimLight, new GUIContent("Enable RimLight -", "Rimming away from light source.\nAlso activates this as mask for Cubemap Fresnel.")); + materialEditor.ShaderProperty(_rimAlbedoMix, new GUIContent("Mix texture", "Mix to tint RimLight by source texture.")); + EditorGUI.indentLevel++; + materialEditor.ShaderProperty(_RimLightSource, new GUIContent("Texture source", "Diffuse: Good for Matching Skin\"subsurface\" tones.\nSpecular: Good to match metallic tones as set in your Specular Reflection settings.")); + EditorGUI.indentLevel--; + materialEditor.ShaderProperty(_RimLightColor, new GUIContent("Color +", "")); + materialEditor.ShaderProperty(_Ap_RimLightColor, new GUIContent("Color - ", "")); + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_LightDirection_MaskOn, new GUIContent("Light direction mode", "Enables masking by light direction and dual + and - mode. Off makes + a simple overrap.")); + EditorGUI.indentLevel++; + materialEditor.ShaderProperty(_Tweak_LightDirection_MaskLevel, new GUIContent("Polarize", "Split + and - more by light direction.")); + EditorGUI.indentLevel--; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_RimLight_Power, new GUIContent("Power +", "Wrapping curvature")); + materialEditor.ShaderProperty(_Ap_RimLight_Power, new GUIContent("Power -", "Wrapping curvature")); + materialEditor.ShaderProperty(_RimLight_InsideMask, new GUIContent("Sharpness", "Tampers falloff to a shaper edge. Good for toony lines.")); + materialEditor.ShaderProperty(_RimLightAreaOffset, new GUIContent("Offset Wrap", "Shifts RimLights \"warp\". To control how the high and low of the rim curve appear.")); + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_envOnRim, new GUIContent("Mask by Cubemap", "Masks Rim Lighting by Cubemap colors. Uses Cubemap settings (even its off as a specular effect). I recommend overriding Cubemap Fallback and Roughness settings when applying this.")); + EditorGUI.indentLevel++; + materialEditor.ShaderProperty(_envOnRimColorize, new GUIContent("Colorize by Cubemap", "Give Cubemap Color to tint RimLight.")); + EditorGUI.indentLevel--; + } + + showMatcap = ACLStyles.ShurikenFoldout("Matcaps", showMatcap); + if (showMatcap) + { + materialEditor.ShaderProperty(_MatCap, new GUIContent("Use Matcaps", "Uses all or none. (Currently this to simplify solving 3 unique matcap systems and hit performance)")); + ACLStyles.PartingLine(); + materialEditor.TexturePropertySingleLine(new GUIContent("Diffuse Type (Multiplies)", "Use this for \"baked\" toon ramp, subsurface, or iridescent Matcaps. It multiplies on the Diffuse Texture and then adds result. Lighting is Direct(with shadows) + Indirect.\nMasked by Diffuse Matcap Mask."), _MatCapTexMult, _MatCapColMult); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_MatCapTexMult); + EditorGUI.indentLevel--; + materialEditor.TexturePropertySingleLine(new GUIContent("Specular Type (Additive)", "Use this for \"baked\" Specular Reflection Matcaps. Intensity works like Cubemap Fallback.\nMasked by Global Specular Mask."), _MatCapTexAdd, _MatCapColAdd); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_MatCapTexAdd); + EditorGUI.indentLevel--; + materialEditor.TexturePropertySingleLine(new GUIContent("Emission Type", "Adds in texture and scales to HDR Color as set.\nMasked by Emission masks."), _MatCapTexEmis, _MatCapColEmis); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_MatCapTexEmis); + EditorGUI.indentLevel--; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_Tweak_MatCapUV, new GUIContent("Scale UV", "")); + materialEditor.ShaderProperty(_Rotate_MatCapUV, new GUIContent("Rotate UV", "")); + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_Is_NormalMapForMatCap, new GUIContent("Use Normalmap", "Distort Matcaps by unique Normals.")); + ACLStyles.PartingLine(); + materialEditor.TexturePropertySingleLine(new GUIContent("Normal Map", ""), _NormalMapForMatCap); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_NormalMapForMatCap); + EditorGUI.indentLevel--; + materialEditor.ShaderProperty(_Rotate_NormalMapForMatCapUV, new GUIContent("Rotate UV", "")); + ACLStyles.PartingLine(); + materialEditor.TexturePropertySingleLine(new GUIContent("Diffuse Matcap Mask", ""), _Set_MatcapMask); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_Set_MatcapMask); + EditorGUI.indentLevel--; + materialEditor.ShaderProperty(_Tweak_MatcapMaskLevel, new GUIContent("Tweak Mask", "")); + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_TweakMatCapOnShadow, new GUIContent("Specular Shadows Reactivity", "Specular matcaps visibility in dynamic shadow. This depends on context looking like it reacts to direct light or not. 0.0 ignores masking by dynamic shadows.")); + } + + showEmission = ACLStyles.ShurikenFoldout("Emission", showEmission); + if (showEmission) + { + materialEditor.ShaderProperty(_Emissive_Color, new GUIContent("Color", "")); + materialEditor.ShaderProperty(_EmissiveProportional_Color, new GUIContent("Proportional color", "For Unrealistic proportional glow to world brightness. Scales color to the average lighting. You might want intensity higher than Emission Color.")); + ACLStyles.PartingLine(); + materialEditor.TexturePropertySingleLine(new GUIContent("Color Tint (RGB)", "Source glow color."), _EmissionColorTex); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_EmissionColorTex); + EditorGUI.indentLevel--; + materialEditor.TexturePropertySingleLine(new GUIContent("Area mask (G)", "A stronger override mask. If set bright areas will only glow. Can use this for pairing random Color Tint textures."), _Emissive_Tex); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_Emissive_Tex); + EditorGUI.indentLevel--; + } + + showAmbientOcclusionMaps = ACLStyles.ShurikenFoldout("General Effect Masks", showAmbientOcclusionMaps); + if (showAmbientOcclusionMaps) + { + materialEditor.TexturePropertySingleLine(new GUIContent("Global Specular Mask", "Hides all specular output.\nAlso masks Specular Matcap."), _Set_HighColorMask); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_Set_HighColorMask); + materialEditor.ShaderProperty(_Tweak_HighColorMaskLevel, new GUIContent("Tweak Mask", "")); + EditorGUI.indentLevel--; + materialEditor.TexturePropertySingleLine(new GUIContent("Rim Light Mask", ""), _Set_RimLightMask); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_Set_RimLightMask); + materialEditor.ShaderProperty(_Tweak_RimLightMaskLevel, new GUIContent("Tweak Mask", "")); + EditorGUI.indentLevel--; + } + + showNormalmap = ACLStyles.ShurikenFoldout("Normal Map", showNormalmap); + if (showNormalmap) + { + materialEditor.TexturePropertySingleLine(new GUIContent("Normal Map", ""), _NormalMap); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_NormalMap); + EditorGUI.indentLevel--; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_DetailNormalMapScale01, new GUIContent("Detail Scaling", "None 0.0 enables the Detail Normal Map.")); + EditorGUI.indentLevel++; + materialEditor.TexturePropertySingleLine(new GUIContent("Detail Normal Map", ""), _NormalMapDetail); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_NormalMapDetail); + EditorGUI.indentLevel--; + materialEditor.TexturePropertySingleLine(new GUIContent("Detail Mask (G)", ""), _DetailNormalMask); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_DetailNormalMask); + EditorGUI.indentLevel-=2; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_Is_NormalMapToBase, new GUIContent("Apply to Diffuse", "")); + materialEditor.ShaderProperty(_Is_NormalMapToHighColor, new GUIContent("Apply to Specular", "")); + materialEditor.ShaderProperty(_Is_NormalMapToRimLight, new GUIContent("Apply to Rim Lights", "When used alone can allow a NPR \"weavy\" rim effect.")); + materialEditor.ShaderProperty(_Is_NormaMapToEnv, new GUIContent("Apply to Cubemap", "Disable for a cheap NPR glossy effect against normalmapped others.")); + } + + if (iscutout || iscutoutAlpha || isDither) + { + showAlphamask = ACLStyles.ShurikenFoldout("Alpha Settings", showAlphamask); + if (showAlphamask) + { + if (iscutoutAlpha) + { + materialEditor.ShaderProperty(_ZWrite, new GUIContent("ZWrite", "Depth sorting. Recommend Off for alpha mesh that does not overlay self.\nOn: when strange sort layering happens.\nUsing Transparency Render Queue requires having this off.")); + ACLStyles.PartingLine(); + } + materialEditor.ShaderProperty(_IsBaseMapAlphaAsClippingMask, new GUIContent("Alpha Mask Source", "Main Texture: The typical source alpha.\nClipping mask: Use a swappable alpha mask if you reuse a Diffuse Main Texture that wants variant alpha cutout zones... such as outfit masking.")); + EditorGUI.indentLevel++; + materialEditor.TexturePropertySingleLine(new GUIContent("Clipping mask (G)", "If used. As a Alpha Mask Black 0.0 is invisible"), _ClippingMask); + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(_ClippingMask); + EditorGUI.indentLevel-=2; + ACLStyles.PartingLine(); + materialEditor.ShaderProperty(_Inverse_Clipping, new GUIContent("Inverse Alpha", "")); + materialEditor.ShaderProperty(_Clipping_Level, new GUIContent("Cutout level", "Clip out mesh were alpha is below this.")); + materialEditor.ShaderProperty(_Tweak_transparency, new GUIContent("Tweak Alpha", "Fine tune visible alpha. Good for Dithering adjustment.")); + ACLStyles.PartingLine(); + if (iscutoutAlpha) + { + materialEditor.ShaderProperty(_UseSpecAlpha, new GUIContent("Specular Alpha Mode", "Make specular reflections visible as a PBR effect.\nAlpha: Alpha only drives visibility.\nReflect: PBR like glass, shine is visible no matter how transparent.\nRecommend Reflect mode paired with Render Queue set to Transparent for PBR consistency.")); + ACLStyles.PartingLine(); + } + materialEditor.ShaderProperty(_DetachShadowClipping, new GUIContent("Split Shadow Cutout", "Control for dynamic shadows on alpha mesh. Designed so avatar effects like \"Blushes\" or \"Emotes panels\" do not artifact to dynamic shadow.")); + EditorGUI.indentLevel++; + materialEditor.ShaderProperty(_Clipping_Level_Shadow, new GUIContent("Shadow Cutout level", "Proportional to Cutout level.")); + EditorGUI.indentLevel--; + } + } + + StencilHelpers = ACLStyles.ShurikenFoldout("Stencil Helpers", StencilHelpers); + if (StencilHelpers) + { + materialEditor.ShaderProperty(_Stencil, new GUIContent("Reference Num", "")); + materialEditor.ShaderProperty(_StencilComp, new GUIContent("Compare" , "")); + materialEditor.ShaderProperty(_StencilOp, new GUIContent("Pass", "")); + materialEditor.ShaderProperty(_StencilFail, new GUIContent("Fail", "")); + EditorGUILayout.HelpBox("For typical NPR stencil effects \"like eyes over hair\".\n1st material (eyes/lashes): Same ref Num / Comp:Always / Pass:Replace / Fail:Replace\n2nd material (Hair): Same ref Num / Comp:NotEqual / Pass:Keep / Fail:Keep\nRender Queue 2nd material after 1st.", MessageType.None, true); + } + materialEditor.RenderQueueField(); + ACLStyles.DrawButtons(); + } + } +} \ No newline at end of file diff --git a/Assets/shaders/aciil/ACLS/Editor/ACLStyles.cs b/Assets/shaders/aciil/ACLS/Editor/ACLStyles.cs new file mode 100644 index 0000000..714f39a --- /dev/null +++ b/Assets/shaders/aciil/ACLS/Editor/ACLStyles.cs @@ -0,0 +1,172 @@ +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; +using System.IO; + +// Base prepared by Morioh for me. +// This code is based off synqark's arktoon-shaders and Xiexe. +// Citation to "https://github.com/synqark", "https://github.com/synqark/arktoon-shaders", https://gitlab.com/xMorioh/moriohs-toon-shader. + +[InitializeOnLoad] +public class ACLStyles : MonoBehaviour +{ + public static string ver = "ACLS-Shader v" + "1.1 "; + + private static Rect DrawShuriken(string title, Vector2 contentOffset, int HeaderHeight) + { + var style = new GUIStyle("ShurikenModuleTitle"); + style.font = new GUIStyle(EditorStyles.boldLabel).font; + style.border = new RectOffset(15, 7, 4, 4); + style.fixedHeight = HeaderHeight; + style.contentOffset = contentOffset; + var rect = GUILayoutUtility.GetRect(16f, HeaderHeight, style); + + GUI.Box(rect, title, style); + return rect; + } + + private static Rect DrawShurikenCenteredTitle(string title, Vector2 contentOffset, int HeaderHeight) + { + var style = new GUIStyle("ShurikenModuleTitle"); + style.font = new GUIStyle(EditorStyles.boldLabel).font; + style.border = new RectOffset(15, 7, 4, 4); + style.fixedHeight = HeaderHeight; + style.contentOffset = contentOffset; + style.alignment = TextAnchor.MiddleCenter; + var rect = GUILayoutUtility.GetRect(16f, HeaderHeight, style); + + GUI.Box(rect, title, style); + return rect; + } + + public static bool ShurikenFoldout(string title, bool display) + { + var rect = DrawShuriken(title, new Vector2(20f, -2f), 22); + var e = Event.current; + var toggleRect = new Rect(rect.x + 4f, rect.y + 2f, 13f, 13f); + if (e.type == EventType.Repaint) + { + EditorStyles.foldout.Draw(toggleRect, false, false, display, false); + } + if (e.type == EventType.MouseDown && rect.Contains(e.mousePosition)) + { + display = !display; + e.Use(); + } + return display; + } + + //parting line text + private static Rect DrawShurikenPartingLineText(string title, Vector2 contentOffset, int HeaderHeight) + { + var style = new GUIStyle("ShurikenModuleTitle"); + style.font = new GUIStyle(EditorStyles.boldLabel).font; + style.border = new RectOffset(15, 7, 4, 4); + style.fixedHeight = HeaderHeight; + style.contentOffset = contentOffset; + style.alignment = TextAnchor.MiddleCenter; + var rect = GUILayoutUtility.GetRect(16f, HeaderHeight, style); + + GUI.Box(rect, title, style); + return rect; + } + //end of parting line text + + //parting lines + static public void PartingLine() + { + GUILayout.Space(5); + GUILine(new Color(1f, 1f, 1f), 1.5f); + GUILayout.Space(5); + } + + static public void GUILine(float height = 0f) + { + GUILine(Color.black, height); + } + + static public void GUILine(Color color, float height = 0f) + { + Rect position = GUILayoutUtility.GetRect(0f, float.MaxValue, height, height, LineStyle); + + if (Event.current.type == EventType.Repaint) + { + Color orgColor = GUI.color; + GUI.color = orgColor * color; + LineStyle.Draw(position, false, false, false, false); + GUI.color = orgColor; + } + } + + static public GUIStyle _LineStyle; + static public GUIStyle LineStyle + { + get + { + if (_LineStyle == null) + { + _LineStyle = new GUIStyle(); + _LineStyle.normal.background = EditorGUIUtility.whiteTexture; + _LineStyle.stretchWidth = true; + } + + return _LineStyle; + } + } + // end of parting line + //exrta buttons + public static void gitVersionCheckButton(int Width, int Height) + { + if (GUILayout.Button("Check Version", GUILayout.Width(Width), GUILayout.Height(Height))) + { + Application.OpenURL("https://github.com/ACIIL/ACLS-Shader/releases"); + } + } + + public static void gitSourcebutton(int Width, int Height) + { + if (GUILayout.Button("Get Source", GUILayout.Width(Width), GUILayout.Height(Height))) + { + Application.OpenURL("https://github.com/ACIIL/ACLS-Shader/"); + } + } + + public static void wikiButton(int Width, int Height) + { + GUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + if (GUILayout.Button("Show Wiki", GUILayout.Width(Width), GUILayout.Height(Height))) + { + Application.OpenURL("https://github.com/ACIIL/ACLS-Shader/wiki"); + } + GUILayout.FlexibleSpace(); + GUILayout.EndHorizontal(); + } + + public static void ShurikenHeader(string title) + { + DrawShuriken(title, new Vector2(6f, -2f), 22); + } + + public static void ShurikenHeaderCentered(string title) + { + DrawShurikenCenteredTitle(title, new Vector2(0f, -2f), 22); + } + + public static void DrawShurikenPartingLineText(string title) + { + DrawShurikenPartingLineText(title, new Vector2(6f, -2f), 22); + } + + public static void DrawButtons() + { + ACLStyles.PartingLine(); + EditorGUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + ACLStyles.gitVersionCheckButton(100,30); + ACLStyles.gitSourcebutton(100, 30); + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + ACLStyles.wikiButton(100,30); + } +} \ No newline at end of file diff --git a/README.md b/README.md index a4010f8..3afb9ac 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Wiki: Documentation, References and Citations at: https://github.com/ACIIL/ACLS-Shader/wiki -A Unity HLSL VR ready "Toony/PBR hybrid" avatar shader for VRCHAT and similar platforms. Built with game industry standard "toony" appearances and adaptive to vrchat render constraints and reactive to common incorrect user generated map lighting. +A Unity HLSL VR ready "NPR/PBR hybrid" avatar shader for VRCHAT and similar platforms. Built with game industry standard "toony" appearances and adaptive to vrchat render constraints and reactive to common incorrect user generated map lighting. This is a hobbyist and self practice project for my technical artist experiments and professional development. Source is free and citations and credits to works and ideas as i use them.