diff --git a/Assets/lilToon/CHANGELOG.md b/Assets/lilToon/CHANGELOG.md index 94e24f37..d9df5cc2 100644 --- a/Assets/lilToon/CHANGELOG.md +++ b/Assets/lilToon/CHANGELOG.md @@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.2.3] - 2021-10-30 +### Added +- Extended UV settings for MatCap +- Anisotropic reflection +- Changed main color properties to be saved in _BaseMap, _BaseColorMap and _BaseColor +- `Multi Light Specular` property +- `Backface Mask` property to MatCap, rim light, glitter, and backlight + +### Changed +- Changed the RenderQueue of the opaque material in the Stencil settings button to match AlphaTest + +### Fixed +- Fixed an issue where the preset RenderQueue was not being applied +- Fixed fur masking to be applied after fur processing +- Fixed an issue where shader rewriting was not being done properly in the UPM version +- Fixed missing localization +- Fixed an issue where a material would become dark in Planer Reflection when using Exposure in HDRP (HDRP 11.0.0 or later) +- Fixed an issue that caused parallax in distance fade + ## [1.2.2] - 2021-10-18 ### Added - Add a button to change lighting settings with one click diff --git a/Assets/lilToon/CHANGELOG_JP.md b/Assets/lilToon/CHANGELOG_JP.md index 0807ae38..a5e7fcf3 100644 --- a/Assets/lilToon/CHANGELOG_JP.md +++ b/Assets/lilToon/CHANGELOG_JP.md @@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.2.3] - 2021-10-30 +### 追加 +- マットキャップのUV関係の機能を拡張 +- 異方性反射を追加 +- メインカラーのプロパティを_BaseMapと_BaseColorMapと_BaseColorにも保存されるように変更 +- `複数ライトから光沢を生成`プロパティの追加 +- マットキャップ、リムライト、ラメ、逆光ライトに`裏面で無効化`プロパティの追加 + +### 変更 +- Stencil設定ボタンでOpaqueマテリアルのRenderQueueをAlphaTestに合わせるように変更 + +### 修正 +- プリセットのRenderQueueがうまく適用されていなかったのを修正 +- ファーのマスクをファーの処理後に適用されるように修正 +- UPM版でシェーダー書き換えが適切に行われていなかった問題の修正 +- ローカライゼーション対応漏れを修正 +- HDRPでExposure使用時、Planer Reflection内で暗くなる問題を修正 (HDRP 11.0.0以降) +- 距離フェード機能に視差が発生しないように修正 + ## [1.2.2] - 2021-10-18 ### 追加 - ライティングの設定をワンクリックで切り替える機能の追加 diff --git a/Assets/lilToon/DeveloperDocumentation.md b/Assets/lilToon/DeveloperDocumentation.md index c8d79aa0..b2a93781 100644 --- a/Assets/lilToon/DeveloperDocumentation.md +++ b/Assets/lilToon/DeveloperDocumentation.md @@ -258,6 +258,7 @@ The following keywords are currently supported (more may be added upon request) |DISSOLVE|Dissolve| |NORMAL_1ST|Normal map| |NORMAL_2ND|Normal map 2nd| +|ANISOTROPY|Anisotropy| |AUDIOLINK|AudioLink| |MAIN2ND|Main color 2nd| |MAIN3RD|Main color 3rd| diff --git a/Assets/lilToon/DeveloperDocumentation_JP.md b/Assets/lilToon/DeveloperDocumentation_JP.md index 26708d51..bc692f80 100644 --- a/Assets/lilToon/DeveloperDocumentation_JP.md +++ b/Assets/lilToon/DeveloperDocumentation_JP.md @@ -258,6 +258,7 @@ METAパスではエラーになるのでMETAパスに以下の変更を加えま |DISSOLVE|Dissolveの処理| |NORMAL_1ST|ノーマルマップの処理| |NORMAL_2ND|ノーマルマップ2ndの処理| +|ANISOTROPY|異方性反射の処理| |AUDIOLINK|AudioLinkの処理| |MAIN2ND|メインカラー2ndの処理| |MAIN3RD|メインカラー3rdの処理| diff --git a/Assets/lilToon/Editor/lang.txt b/Assets/lilToon/Editor/lang.txt index 29d847f0..98a63267 100644 --- a/Assets/lilToon/Editor/lang.txt +++ b/Assets/lilToon/Editor/lang.txt @@ -72,6 +72,8 @@ sVertex Vertex 頂点 꼭짓점 顶点 頂點 sColorAlphaZeroWarn To enable the property, increase the alpha value. プロパティを有効にするには透明度の値を上げて下さい。 속성을 유효하게 하려면 알파 값을 올려 주십시오. 增加 Alpha 值以启用该属性。 增加 Alpha 值以啟用該屬性。 sApplyTransparency Apply Transparency 透明度を適用 투명도 적용 应用透明度 應用透明度 sVRParallaxStrength VR Parallax Strength VR時の視差の強さ VR Parallax Strength VR Parallax Strength VR Parallax Strength +sShadowMask Shadow Mask 影部分で無効化 그림자 속에서 무효화 阴影蒙版 陰影蒙版 +sBackfaceMask Backface Mask 裏面で無効化 후면에서 무효화 背面蒙版 背面蒙版 sLimShadowStrength Shadow Strength 影の強さ 그림자 강도 阴影强度 陰影強度 sLimOutline Outline 輪郭線の色 윤곽선의 색 轮廓 輪廓 sLimEmission Emission 発光色 발광색 发光 發光 @@ -124,8 +126,10 @@ sMaskTiling Mask UV Tiling Mask UV Tiling Mask UV Tiling 蒙版UV Tiling 蒙版U sMaskOffset Mask UV Offset Mask UV Offset Mask UV Offset 蒙版UV Offset 蒙版UV Offset sNoise Noise ノイズ 노이즈 噪点 噪點 sNoiseR Noise (R) Noise (R) Noise (R) Noise (R) Noise (R) +sNoiseStrength Noise Strength ノイズの強度 노이즈 강도 噪点强度 噪點強度 sTriMask TriMask (Mat/Rim/Emi) TriMask (Mat/Rim/Emi) TriMask (Mat/Rim/Emi) TriMask (Mat/Rim/Emi) TriMask (Mat/Rim/Emi) sTriMaskRGB Mask (R:MatCap G:Rim B:Emission) Mask (R:MatCap G:Rim B:Emission) Mask (R:MatCap G:Rim B:Emission) Mask (R:MatCap G:Rim B:Emission) Mask (R:MatCap G:Rim B:Emission) +sApplyTo Apply to 適用先 적용처 申请 申請 sMainUV UV Setting UV設定 UV 설정 UV设置 UV設置 sMainUVTips You can set the UV position, scale and animation. UVの位置やサイズ、アニメーションの設定ができます UV의 위치 나 크기, 애니메이션을 설정할 수 있습니다 你可以设置UV位置、比例和动画。 你可以設置UV位置、比例和動畫。 sColors Color 色設定 색상 설정 颜色设置 顏色設置 @@ -215,7 +219,6 @@ sAudioLinkBandBass Bass Bass Bass Bass Bass sAudioLinkBandLowMid Low Mid Low Mid Low Mid Low Mid Low Mid sAudioLinkBandHighMid High Mid High Mid High Mid High Mid High Mid sAudioLinkBandTreble Treble Treble Treble Treble Treble -sAudioLinkApplyTo Apply to 適用先 적용처 申请 申請 sAudioLinkStartPosition Start Position 開始点 원점 初始点 初始點 sAudioLinkMovingVector Moving Vector 移動方向 이동 방향 运动方向 運動方向 sAudioLinkNormalStrength Normal Strength 法線方向の強度 법선 방향의 강도 法线强度 法線強度 @@ -244,6 +247,9 @@ sNormalMapTips You can set the normal map. ノーマルマップの設定がで sNormalMap Normal Map ノーマルマップ 노멀 맵 法线贴图 法線貼圖 sNormalMap2nd Normal Map 2nd ノーマルマップ2nd 노멀 맵 2nd 法线贴图2nd 法線貼圖2nd sNormalRGB Normal (RGB) ノーマル (RGB) 노멀 (RGB) 法线 (RGB) 法線 (RGB) +sAnisotropy Anisotropy 異方性反射 애니소트로픽 各向异性反射 各向異性反射 +sTangentWidth Tangent Width タンジェント方向の幅 Tangent Width Tangent Width Tangent Width +sBitangentWidth Bitangent Width バイタンジェント方向の幅 Bitangent Width Bitangent Width Bitangent Width sReflectionsSetting Reflections 光沢設定 광택 설정 反射设置 反射 sReflectionsTips You can set the Reflections. 光沢に関する設定ができます 광택 관한 설정을 할 수 있습니다 你可以设置反射。 你可以設置反射。 sReflection Reflection 反射 반사 反射 反射 @@ -256,15 +262,17 @@ sSpecularMode Specular Mode 光沢のタイプ 광택 타입 反射模式 反射 sSpecularNone None 無効 무효 无 無 sSpecularReal Realistic リアル 리얼 现实 現實 sSpecularToon Toon トゥーン 툰 卡通 卡通 +sMultiLightSpecular Multi Light Specular 複数ライトから光沢を生成 복수 라이트에서 광택 생성 从多个光源生成反射 從多個光源生成反射 sApplyReflection Environment Reflections 環境光の反射 환경광 반사 环境反射 環境反射 sMatCap MatCap マットキャップ 매트 캡 MatCap MatCap sMatCap2nd MatCap 2nd マットキャップ2nd 매트 캡 2nd MatCap 2nd MatCap 2nd +sBlendUV1 Blend UV1 UV1を合成 Blend UV1 Blend UV1 Blend UV1 +sMatCapZRotCancel Z-axis rotation cancellation Z軸回転キャンセル Z축 회전 취소 Z轴旋转取消 Z軸旋轉取消 +sFixPerspective Fix Perspective パース補正 Fix Perspective Fix Perspective Fix Perspective sHelpMatCapBlending Turn off "Enable Lighting" in multiply mode. 乗算モードでは"ライティングを適用"を0にしてください 곱셈 모드에서는 "라이팅을 적용"을 0으로 해 주세요 关闭乘法模式下的 启用照明。 關閉乘法模式下的 啟用照明。 sMatCapCustomNormal Custom normal map カスタムノーマルマップ 커스텀 노멀 맵 自定义法线贴图 自定義法線貼圖 -sMatCapZRotCancel Z-axis rotation cancellation Z軸回転キャンセル Z축 회전 취소 Z轴旋转取消 Z軸旋轉取消 sRimLight Rim Light リムライト 림 라이트 Rim Light Rim Light sFresnelPower Fresnel Power リムライトの細さ 림 라이트의 벌금 菲涅尔功率 菲涅爾功率 -sShadowMask Shadow Mask 影部分で無効化 그림자 속에서 무효화 阴影蒙版 陰影蒙版 sRimLightDirection Light direction strength ライト方向の影響度 라이트 방향의 영향도 光线方向影响 光線方向影響 sRimDirectionRange Direct light width 直接光の幅 직접 빛의 폭 直射光宽 直射光寬 sRimIndirectionRange Indirect light width 間接光の幅 간접 조명의 폭 间接光宽 間接光寬 @@ -425,6 +433,7 @@ sSettingEmissionGradation Emission Gradation 発光グラデーション 발광 sSettingNormal1st Normal Map ノーマルマップ 노멀 맵 法线贴图 法線貼圖 sSettingNormal2nd Normal Map 2nd ノーマルマップ2nd 노멀 맵 2nd 法线贴图2nd 法線貼圖2nd sSettingTexNormalMask Normal Map 2nd Mask ノーマルマップ2ndマスク 노멀 맵 2nd 마스크 法线贴图2nd蒙版 法線貼圖2nd蒙版 +sSettingAnisotropy Anisotropy 異方性反射 애니소트로픽 各向异性反射 各向異性反射 sSettingReflection Reflection 反射 반사 反射 反射 sSettingTexReflectionSmoothness Reflection Smoothness Mask 滑らかさマスク 부드러운 마스크 反射平滑度蒙版 反射平滑度蒙版 sSettingTexReflectionMetallic Reflection Metallic Mask 金属度マスク 금속도 마스크 反射金属程度蒙版 反射金屬程度蒙版 @@ -470,6 +479,7 @@ sAnchorShadow #shadow #影設定 #shadow #shadow #shadow sAnchorEmission #emission #発光設定 #emission #emission #emission sAnchorNormalReflection #normal-map--reflection #ノーマルマップ光沢設定 #normal-map--reflection #normal-map--reflection #normal-map--reflection sAnchorNormalMap #normal-map #ノーマルマップ設定 #normal-map #normal-map #normal-map +sAnchorAnisotropy #anisotropy #異方性反射 #anisotropy #anisotropy #anisotropy sAnchorReflections #reflections #光沢設定 #reflections #reflections #reflections sAnchorReflection #reflection #反射 #reflection #reflection #reflection sAnchorMatCap #matcap #マットキャップ #matcap #matcap #matcap diff --git a/Assets/lilToon/Editor/lilInspector.cs b/Assets/lilToon/Editor/lilInspector.cs index 96531dc4..4185e348 100644 --- a/Assets/lilToon/Editor/lilInspector.cs +++ b/Assets/lilToon/Editor/lilInspector.cs @@ -110,6 +110,7 @@ public enum lilPropertyBlock NormalMap, NormalMap1st, NormalMap2nd, + Anisotropy, Reflections, Reflection, MatCap1st, @@ -139,8 +140,8 @@ public enum lilLightingPreset //------------------------------------------------------------------------------------------------------------------------------ // Constant - private const string currentVersionName = "1.2.2"; - private const int currentVersionValue = 15; + private const string currentVersionName = "1.2.3"; + private const int currentVersionValue = 16; private const string boothURL = "https://lilxyzw.booth.pm/"; private const string githubURL = "https://github.com/lilxyzw/lilToon"; @@ -311,6 +312,8 @@ public class lilToonEditorSetting public bool isShowEmissionBlendMask = false; public bool isShowEmission2ndMap = false; public bool isShowEmission2ndBlendMask = false; + public bool isShowMatCapUV = false; + public bool isShowMatCap2ndUV = false; public bool isShowParallax = false; public bool isShowDistanceFade = false; public bool isShowAudioLink = false; @@ -401,6 +404,9 @@ public struct lilPropertyBlockData MaterialProperty monochromeLighting; MaterialProperty lilDirectionalLightStrength; MaterialProperty lightDirectionOverride; + MaterialProperty baseColor; + MaterialProperty baseMap; + MaterialProperty baseColorMap; MaterialProperty triMask; MaterialProperty cull; MaterialProperty srcBlend; @@ -513,6 +519,7 @@ public struct lilPropertyBlockData MaterialProperty backlightDirectivity; MaterialProperty backlightViewStrength; MaterialProperty backlightReceiveShadow; + MaterialProperty backlightBackfaceMask; MaterialProperty useBumpMap; MaterialProperty bumpMap; MaterialProperty bumpScale; @@ -520,6 +527,24 @@ public struct lilPropertyBlockData MaterialProperty bump2ndMap; MaterialProperty bump2ndScale; MaterialProperty bump2ndScaleMask; + MaterialProperty useAnisotropy; + MaterialProperty anisotropyTangentMap; + MaterialProperty anisotropyScale; + MaterialProperty anisotropyScaleMask; + MaterialProperty anisotropyTangentWidth; + MaterialProperty anisotropyBitangentWidth; + MaterialProperty anisotropyShift; + MaterialProperty anisotropyShiftNoiseScale; + MaterialProperty anisotropySpecularStrength; + MaterialProperty anisotropy2ndTangentWidth; + MaterialProperty anisotropy2ndBitangentWidth; + MaterialProperty anisotropy2ndShift; + MaterialProperty anisotropy2ndShiftNoiseScale; + MaterialProperty anisotropy2ndSpecularStrength; + MaterialProperty anisotropyShiftNoiseMask; + MaterialProperty anisotropy2Reflection; + MaterialProperty anisotropy2MatCap; + MaterialProperty anisotropy2MatCap2nd; MaterialProperty useReflection; MaterialProperty metallic; MaterialProperty metallicGlossMap; @@ -529,36 +554,43 @@ public struct lilPropertyBlockData MaterialProperty reflectionColor; MaterialProperty reflectionColorTex; MaterialProperty applySpecular; + MaterialProperty applySpecularFA; MaterialProperty specularToon; MaterialProperty applyReflection; MaterialProperty reflectionApplyTransparency; MaterialProperty useMatCap; MaterialProperty matcapTex; MaterialProperty matcapColor; + MaterialProperty matcapBlendUV1; + MaterialProperty matcapZRotCancel; + MaterialProperty matcapPerspective; + MaterialProperty matcapVRParallaxStrength; MaterialProperty matcapBlend; MaterialProperty matcapBlendMask; MaterialProperty matcapEnableLighting; MaterialProperty matcapShadowMask; - MaterialProperty matcapVRParallaxStrength; + MaterialProperty matcapBackfaceMask; MaterialProperty matcapBlendMode; MaterialProperty matcapMul; MaterialProperty matcapApplyTransparency; - MaterialProperty matcapZRotCancel; MaterialProperty matcapCustomNormal; MaterialProperty matcapBumpMap; MaterialProperty matcapBumpScale; MaterialProperty useMatCap2nd; MaterialProperty matcap2ndTex; MaterialProperty matcap2ndColor; + MaterialProperty matcap2ndBlendUV1; + MaterialProperty matcap2ndZRotCancel; + MaterialProperty matcap2ndPerspective; + MaterialProperty matcap2ndVRParallaxStrength; MaterialProperty matcap2ndBlend; MaterialProperty matcap2ndBlendMask; MaterialProperty matcap2ndEnableLighting; MaterialProperty matcap2ndShadowMask; - MaterialProperty matcap2ndVRParallaxStrength; + MaterialProperty matcap2ndBackfaceMask; MaterialProperty matcap2ndBlendMode; MaterialProperty matcap2ndMul; MaterialProperty matcap2ndApplyTransparency; - MaterialProperty matcap2ndZRotCancel; MaterialProperty matcap2ndCustomNormal; MaterialProperty matcap2ndBumpMap; MaterialProperty matcap2ndBumpScale; @@ -570,6 +602,7 @@ public struct lilPropertyBlockData MaterialProperty rimFresnelPower; MaterialProperty rimEnableLighting; MaterialProperty rimShadowMask; + MaterialProperty rimBackfaceMask; MaterialProperty rimApplyTransparency; MaterialProperty rimDirStrength; MaterialProperty rimDirRange; @@ -586,6 +619,7 @@ public struct lilPropertyBlockData MaterialProperty glitterParams2; MaterialProperty glitterEnableLighting; MaterialProperty glitterShadowMask; + MaterialProperty glitterBackfaceMask; MaterialProperty glitterApplyTransparency; MaterialProperty glitterVRParallaxStrength; MaterialProperty useEmission; @@ -894,7 +928,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro string sBlendModes = GetLoc("sBlendMode") + "|" + GetLoc("sBlendModeNormal") + "|" + GetLoc("sBlendModeAdd") + "|" + GetLoc("sBlendModeScreen") + "|" + GetLoc("sBlendModeMul"); string sAlphaMaskModes = GetLoc("sAlphaMask") + "|" + GetLoc("sAlphaMaskModeNone") + "|" + GetLoc("sAlphaMaskModeReplace") + "|" + GetLoc("sAlphaMaskModeMul"); string blinkSetting = GetLoc("sBlinkStrength") + "|" + GetLoc("sBlinkType") + "|" + GetLoc("sBlinkSpeed") + "|" + GetLoc("sBlinkOffset"); - string sDistanceFadeSetting = GetLoc("sStartDistance") + "|" + GetLoc("sEndDistance") + "|" + GetLoc("sStrength"); + string sDistanceFadeSetting = GetLoc("sStartDistance") + "|" + GetLoc("sEndDistance") + "|" + GetLoc("sStrength") + "|" + GetLoc("sBackfaceForceShadow"); string sDissolveParams = GetLoc("sDissolveMode") + "|" + GetLoc("sDissolveModeNone") + "|" + GetLoc("sDissolveModeAlpha") + "|" + GetLoc("sDissolveModeUV") + "|" + GetLoc("sDissolveModePosition") + "|" + GetLoc("sDissolveShape") + "|" + GetLoc("sDissolveShapePoint") + "|" + GetLoc("sDissolveShapeLine") + "|" + GetLoc("sBorder") + "|" + GetLoc("sBlur"); string sDissolveParamsMode = GetLoc("sDissolve") + "|" + GetLoc("sDissolveModeNone") + "|" + GetLoc("sDissolveModeAlpha") + "|" + GetLoc("sDissolveModeUV") + "|" + GetLoc("sDissolveModePosition"); string sDissolveParamsOther = GetLoc("sDissolveShape") + "|" + GetLoc("sDissolveShapePoint") + "|" + GetLoc("sDissolveShapeLine") + "|" + GetLoc("sBorder") + "|" + GetLoc("sBlur") + "|Dummy"; @@ -1596,6 +1630,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro outlineStencilZFail.floatValue = (float)UnityEngine.Rendering.StencilOp.Keep; } SetupMaterialWithRenderingMode(material, renderingModeBuf, transparentModeBuf, isOutl, isLite, isStWr, isTess); + if(renderingModeBuf == RenderingMode.Opaque) material.renderQueue += 450; } if(GUILayout.Button("Set Reader")) { @@ -1620,6 +1655,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro outlineStencilZFail.floatValue = (float)UnityEngine.Rendering.StencilOp.Keep; } SetupMaterialWithRenderingMode(material, renderingModeBuf, transparentModeBuf, isOutl, isLite, isStWr, isTess); + if(renderingModeBuf == RenderingMode.Opaque) material.renderQueue += 450; } if(GUILayout.Button("Reset")) { @@ -1879,6 +1915,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro stencilFail.floatValue = (float)UnityEngine.Rendering.StencilOp.Keep; stencilZFail.floatValue = (float)UnityEngine.Rendering.StencilOp.Keep; material.renderQueue = material.shader.renderQueue - 1; + if(renderingModeBuf == RenderingMode.Opaque) material.renderQueue += 450; } if(GUILayout.Button("Set Reader")) { @@ -1891,6 +1928,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro stencilFail.floatValue = (float)UnityEngine.Rendering.StencilOp.Keep; stencilZFail.floatValue = (float)UnityEngine.Rendering.StencilOp.Keep; material.renderQueue = -1; + if(renderingModeBuf == RenderingMode.Opaque) material.renderQueue += 450; } if(GUILayout.Button("Reset")) { @@ -2455,6 +2493,50 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro } EditorGUILayout.EndVertical(); } + + //------------------------------------------------------------------------------------------------------------------------------ + // Anisotropy + if(CheckFeature(shaderSetting.LIL_FEATURE_ANISOTROPY)) + { + EditorGUILayout.BeginVertical(boxOuter); + materialEditor.ShaderProperty(useAnisotropy, GetLoc("sAnisotropy")); + DrawMenuButton(GetLoc("sAnchorAnisotropy"), lilPropertyBlock.Anisotropy); + if(useAnisotropy.floatValue == 1) + { + EditorGUILayout.BeginVertical(boxInnerHalf); + materialEditor.TexturePropertySingleLine(normalMapContent, anisotropyTangentMap); + materialEditor.TextureScaleOffsetProperty(anisotropyTangentMap); + materialEditor.TexturePropertySingleLine(maskStrengthContent, anisotropyScaleMask, anisotropyScale); + GUILayout.Label(GetLoc("sApplyTo"), EditorStyles.boldLabel); + EditorGUI.indentLevel++; + materialEditor.ShaderProperty(anisotropy2Reflection, GetLoc("sReflection")); + if(anisotropy2Reflection.floatValue != 0.0f) + { + EditorGUI.indentLevel++; + EditorGUILayout.LabelField("1st Specular", EditorStyles.boldLabel); + materialEditor.ShaderProperty(anisotropyTangentWidth, GetLoc("sTangentWidth")); + materialEditor.ShaderProperty(anisotropyBitangentWidth, GetLoc("sBitangentWidth")); + materialEditor.ShaderProperty(anisotropyShift, GetLoc("sOffset")); + materialEditor.ShaderProperty(anisotropyShiftNoiseScale, GetLoc("sNoiseStrength")); + materialEditor.ShaderProperty(anisotropySpecularStrength, GetLoc("sStrength")); + DrawLine(); + EditorGUILayout.LabelField("2nd Specular", EditorStyles.boldLabel); + materialEditor.ShaderProperty(anisotropy2ndTangentWidth, GetLoc("sTangentWidth")); + materialEditor.ShaderProperty(anisotropy2ndBitangentWidth, GetLoc("sBitangentWidth")); + materialEditor.ShaderProperty(anisotropy2ndShift, GetLoc("sOffset")); + materialEditor.ShaderProperty(anisotropy2ndShiftNoiseScale, GetLoc("sNoiseStrength")); + materialEditor.ShaderProperty(anisotropy2ndSpecularStrength, GetLoc("sStrength")); + DrawLine(); + materialEditor.ShaderProperty(anisotropyShiftNoiseMask, GetLoc("sNoise")); + EditorGUI.indentLevel--; + } + materialEditor.ShaderProperty(anisotropy2MatCap, GetLoc("sMatCap")); + materialEditor.ShaderProperty(anisotropy2MatCap2nd, GetLoc("sMatCap2nd")); + EditorGUI.indentLevel--; + EditorGUILayout.EndVertical(); + } + EditorGUILayout.EndVertical(); + } } } @@ -2495,6 +2577,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro if(specularMode == 0) {applySpecular.floatValue = 0.0f;} if(specularMode == 1) {applySpecular.floatValue = 1.0f; specularToon.floatValue = 0.0f;} if(specularMode == 2) {applySpecular.floatValue = 1.0f; specularToon.floatValue = 1.0f;} + if(applySpecular.floatValue != 0.0f) materialEditor.ShaderProperty(applySpecularFA, GetLoc("sMultiLightSpecular")); materialEditor.ShaderProperty(applyReflection, GetLoc("sApplyReflection")); if(isTransparent) materialEditor.ShaderProperty(reflectionApplyTransparency, GetLoc("sApplyTransparency")); EditorGUILayout.EndVertical(); @@ -2512,23 +2595,23 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro if(useMatCap.floatValue == 1) { EditorGUILayout.BeginVertical(boxInnerHalf); - materialEditor.TexturePropertySingleLine(new GUIContent(GetLoc("sMatCap"), GetLoc("sTextureRGBA")), matcapTex, matcapColor); + MatCapTextureGUI(materialEditor, ref edSet.isShowMatCapUV, new GUIContent(GetLoc("sMatCap"), GetLoc("sTextureRGBA")), matcapTex, matcapColor, matcapBlendUV1, matcapZRotCancel, matcapPerspective, matcapVRParallaxStrength); if(matcapColor.colorValue.a == 0 && AutoFixHelpBox(GetLoc("sColorAlphaZeroWarn"))) { matcapColor.colorValue = new Color(matcapColor.colorValue.r, matcapColor.colorValue.g, matcapColor.colorValue.b, 1.0f); } + DrawLine(); if(CheckFeature(shaderSetting.LIL_FEATURE_TEX_MATCAP_MASK)) materialEditor.TexturePropertySingleLine(maskBlendContent, matcapBlendMask, matcapBlend); else materialEditor.ShaderProperty(matcapBlend, GetLoc("sBlend")); materialEditor.ShaderProperty(matcapEnableLighting, GetLoc("sEnableLighting")); materialEditor.ShaderProperty(matcapShadowMask, GetLoc("sShadowMask")); + materialEditor.ShaderProperty(matcapBackfaceMask, GetLoc("sBackfaceMask")); materialEditor.ShaderProperty(matcapBlendMode, sBlendModes); if(matcapEnableLighting.floatValue != 0.0f && matcapBlendMode.floatValue == 3.0f && AutoFixHelpBox(GetLoc("sHelpMatCapBlending"))) { matcapEnableLighting.floatValue = 0.0f; } if(isTransparent) materialEditor.ShaderProperty(matcapApplyTransparency, GetLoc("sApplyTransparency")); - materialEditor.ShaderProperty(matcapZRotCancel, GetLoc("sMatCapZRotCancel")); - materialEditor.ShaderProperty(matcapVRParallaxStrength, GetLoc("sVRParallaxStrength")); if(CheckFeature(shaderSetting.LIL_FEATURE_TEX_MATCAP_NORMALMAP)) { DrawLine(); @@ -2554,23 +2637,23 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro if(useMatCap2nd.floatValue == 1) { EditorGUILayout.BeginVertical(boxInnerHalf); - materialEditor.TexturePropertySingleLine(new GUIContent(GetLoc("sMatCap"), GetLoc("sTextureRGBA")), matcap2ndTex, matcap2ndColor); + MatCapTextureGUI(materialEditor, ref edSet.isShowMatCap2ndUV, new GUIContent(GetLoc("sMatCap"), GetLoc("sTextureRGBA")), matcap2ndTex, matcap2ndColor, matcap2ndBlendUV1, matcap2ndZRotCancel, matcap2ndPerspective, matcap2ndVRParallaxStrength); if(matcap2ndColor.colorValue.a == 0 && AutoFixHelpBox(GetLoc("sColorAlphaZeroWarn"))) { matcap2ndColor.colorValue = new Color(matcap2ndColor.colorValue.r, matcap2ndColor.colorValue.g, matcap2ndColor.colorValue.b, 1.0f); } + DrawLine(); if(CheckFeature(shaderSetting.LIL_FEATURE_TEX_MATCAP_MASK)) materialEditor.TexturePropertySingleLine(maskBlendContent, matcap2ndBlendMask, matcap2ndBlend); else materialEditor.ShaderProperty(matcap2ndBlend, GetLoc("sBlend")); materialEditor.ShaderProperty(matcap2ndEnableLighting, GetLoc("sEnableLighting")); materialEditor.ShaderProperty(matcap2ndShadowMask, GetLoc("sShadowMask")); + materialEditor.ShaderProperty(matcap2ndBackfaceMask, GetLoc("sBackfaceMask")); materialEditor.ShaderProperty(matcap2ndBlendMode, sBlendModes); if(matcap2ndEnableLighting.floatValue != 0.0f && matcap2ndBlendMode.floatValue == 3.0f && AutoFixHelpBox(GetLoc("sHelpMatCapBlending"))) { matcap2ndEnableLighting.floatValue = 0.0f; } if(isTransparent) materialEditor.ShaderProperty(matcap2ndApplyTransparency, GetLoc("sApplyTransparency")); - materialEditor.ShaderProperty(matcap2ndZRotCancel, GetLoc("sMatCapZRotCancel")); - materialEditor.ShaderProperty(matcap2ndVRParallaxStrength, GetLoc("sVRParallaxStrength")); if(CheckFeature(shaderSetting.LIL_FEATURE_TEX_MATCAP_NORMALMAP)) { DrawLine(); @@ -2604,6 +2687,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro } materialEditor.ShaderProperty(rimEnableLighting, GetLoc("sEnableLighting")); materialEditor.ShaderProperty(rimShadowMask, GetLoc("sShadowMask")); + materialEditor.ShaderProperty(rimBackfaceMask, GetLoc("sBackfaceMask")); if(isTransparent) materialEditor.ShaderProperty(rimApplyTransparency, GetLoc("sApplyTransparency")); DrawLine(); if(CheckFeature(shaderSetting.LIL_FEATURE_RIMLIGHT_DIRECTION)) @@ -2661,6 +2745,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro materialEditor.ShaderProperty(glitterMainStrength, GetLoc("sMainColorPower")); materialEditor.ShaderProperty(glitterEnableLighting, GetLoc("sEnableLighting")); materialEditor.ShaderProperty(glitterShadowMask, GetLoc("sShadowMask")); + materialEditor.ShaderProperty(glitterBackfaceMask, GetLoc("sBackfaceMask")); if(isTransparent) materialEditor.ShaderProperty(glitterApplyTransparency, GetLoc("sApplyTransparency")); DrawLine(); materialEditor.ShaderProperty(glitterParams1, sGlitterParams1); @@ -2691,6 +2776,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro materialEditor.ShaderProperty(backlightDirectivity, GetLoc("sDirectivity")); materialEditor.ShaderProperty(backlightViewStrength, GetLoc("sViewDirectionStrength")); materialEditor.ShaderProperty(backlightReceiveShadow, GetLoc("sReceiveShadow")); + materialEditor.ShaderProperty(backlightBackfaceMask, GetLoc("sBackfaceMask")); EditorGUILayout.EndVertical(); } EditorGUILayout.EndVertical(); @@ -2850,7 +2936,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro if(audioLinkUVMode.floatValue == 0) materialEditor.ShaderProperty(audioLinkUVParams, GetLoc("sOffset") + "|" + GetLoc("sAudioLinkBand") + "|" + GetLoc("sAudioLinkBandBass") + "|" + GetLoc("sAudioLinkBandLowMid") + "|" + GetLoc("sAudioLinkBandHighMid") + "|" + GetLoc("sAudioLinkBandTreble")); if(audioLinkUVMode.floatValue == 1) materialEditor.ShaderProperty(audioLinkUVParams, GetLoc("sScale") + "|" + GetLoc("sOffset") + "|" + GetLoc("sAudioLinkBand") + "|" + GetLoc("sAudioLinkBandBass") + "|" + GetLoc("sAudioLinkBandLowMid") + "|" + GetLoc("sAudioLinkBandHighMid") + "|" + GetLoc("sAudioLinkBandTreble")); if(audioLinkUVMode.floatValue == 2) materialEditor.ShaderProperty(audioLinkUVParams, GetLoc("sScale") + "|" + GetLoc("sOffset") + "|" + GetLoc("sAngle") + "|" + GetLoc("sAudioLinkBand") + "|" + GetLoc("sAudioLinkBandBass") + "|" + GetLoc("sAudioLinkBandLowMid") + "|" + GetLoc("sAudioLinkBandHighMid") + "|" + GetLoc("sAudioLinkBandTreble")); - GUILayout.Label(GetLoc("sAudioLinkApplyTo"), EditorStyles.boldLabel); + GUILayout.Label(GetLoc("sApplyTo"), EditorStyles.boldLabel); EditorGUI.indentLevel++; if(CheckFeature(shaderSetting.LIL_FEATURE_MAIN2ND)) materialEditor.ShaderProperty(audioLink2Main2nd, GetLoc("sMainColor2nd")); if(CheckFeature(shaderSetting.LIL_FEATURE_MAIN3RD)) materialEditor.ShaderProperty(audioLink2Main3rd, GetLoc("sMainColor3rd")); @@ -3047,6 +3133,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro furStencilZFail.floatValue = (float)UnityEngine.Rendering.StencilOp.Keep; } SetupMaterialWithRenderingMode(material, renderingModeBuf, transparentModeBuf, isOutl, isLite, isStWr, isTess); + if(renderingModeBuf == RenderingMode.Opaque) material.renderQueue += 450; } if(GUILayout.Button("Set Reader")) { @@ -3083,6 +3170,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro furStencilZFail.floatValue = (float)UnityEngine.Rendering.StencilOp.Keep; } SetupMaterialWithRenderingMode(material, renderingModeBuf, transparentModeBuf, isOutl, isLite, isStWr, isTess); + if(renderingModeBuf == RenderingMode.Opaque) material.renderQueue += 450; } if(GUILayout.Button("Reset")) { @@ -3329,7 +3417,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro // Bake Textures EditorGUILayout.BeginVertical(boxOuter); - EditorGUILayout.LabelField(GetLoc("sBakeTextures"), customToggleFont); + EditorGUILayout.LabelField(GetLoc("sBake"), customToggleFont); EditorGUILayout.BeginVertical(boxInnerHalf); string materialName = material.name; if(!isGem && CheckFeature(shaderSetting.LIL_FEATURE_SHADOW) && GUILayout.Button(GetLoc("sShadow1stColor"))) AutoBakeColoredMask(material, shadowColorTex, shadowColor, "Shadow1stColor"); @@ -3385,6 +3473,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro SetupMultiMaterial(material); } + CopyMainColorProperties(); SaveEditorSettingTemp(); } @@ -3405,6 +3494,9 @@ private void ResetProperties() beforeExposureLimit = null; monochromeLighting = null; lilDirectionalLightStrength = null; + baseColor = null; + baseMap = null; + baseColorMap = null; triMask = null; cull = null; srcBlend = null; @@ -3509,6 +3601,15 @@ private void ResetProperties() shadowBorderColor = null; shadowBorderRange = null; shadowReceive = null; + useBacklight = null; + backlightColor = null; + backlightColorTex = null; + backlightBorder = null; + backlightBlur = null; + backlightDirectivity = null; + backlightViewStrength = null; + backlightReceiveShadow = null; + backlightBackfaceMask = null; useBumpMap = null; bumpMap = null; bumpScale = null; @@ -3516,6 +3617,25 @@ private void ResetProperties() bump2ndMap = null; bump2ndScale = null; bump2ndScaleMask = null; + useAnisotropy = null; + anisotropyTangentMap = null; + anisotropyScale = null; + anisotropyScaleMask = null; + anisotropyTangentWidth = null; + anisotropyBitangentWidth = null; + anisotropyShift = null; + anisotropyShiftNoiseScale = null; + anisotropySpecularStrength = null; + anisotropy2ndTangentWidth = null; + anisotropy2ndBitangentWidth = null; + anisotropy2ndShift = null; + anisotropy2ndShiftNoiseScale = null; + anisotropy2ndSpecularStrength = null; + anisotropyShiftNoiseMask = null; + anisotropyShift = null; + anisotropy2Reflection = null; + anisotropy2MatCap = null; + anisotropy2MatCap2nd = null; useReflection = null; metallic = null; metallicGlossMap = null; @@ -3525,6 +3645,7 @@ private void ResetProperties() reflectionColor = null; reflectionColorTex = null; applySpecular = null; + applySpecularFA = null; specularToon = null; applyReflection = null; reflectionApplyTransparency = null; @@ -3535,6 +3656,8 @@ private void ResetProperties() matcapBlendMask = null; matcapEnableLighting = null; matcapShadowMask = null; + matcapBackfaceMask = null; + matcapBlendUV1 = null; matcapVRParallaxStrength = null; matcapBlendMode = null; matcapMul = null; @@ -3550,6 +3673,8 @@ private void ResetProperties() matcap2ndBlendMask = null; matcap2ndEnableLighting = null; matcap2ndShadowMask = null; + matcap2ndBackfaceMask = null; + matcap2ndBlendUV1 = null; matcap2ndVRParallaxStrength = null; matcap2ndBlendMode = null; matcap2ndMul = null; @@ -3566,6 +3691,7 @@ private void ResetProperties() rimFresnelPower = null; rimEnableLighting = null; rimShadowMask = null; + rimBackfaceMask = null; rimApplyTransparency = null; rimDirStrength = null; rimDirRange = null; @@ -3582,6 +3708,7 @@ private void ResetProperties() glitterParams2 = null; glitterEnableLighting = null; glitterShadowMask = null; + glitterBackfaceMask = null; glitterApplyTransparency = null; glitterVRParallaxStrength = null; useEmission = null; @@ -3748,6 +3875,9 @@ private void LoadProperties(MaterialProperty[] props) monochromeLighting = FindProperty("_MonochromeLighting", props); lilDirectionalLightStrength = FindProperty("_lilDirectionalLightStrength", props); lightDirectionOverride = FindProperty("_LightDirectionOverride", props); + baseColor = FindProperty("_BaseColor", props); + baseMap = FindProperty("_BaseMap", props); + baseColorMap = FindProperty("_BaseColorMap", props); mainTex_ScrollRotate = FindProperty("_MainTex_ScrollRotate", props); cull = FindProperty("_Cull", props); srcBlend = FindProperty("_SrcBlend", props); @@ -3862,6 +3992,7 @@ private void LoadProperties(MaterialProperty[] props) backlightDirectivity = FindProperty("_BacklightDirectivity", props); backlightViewStrength = FindProperty("_BacklightViewStrength", props); backlightReceiveShadow = FindProperty("_BacklightReceiveShadow", props); + backlightBackfaceMask = FindProperty("_BacklightBackfaceMask", props); // Outline if(isOutl) { @@ -3909,6 +4040,24 @@ private void LoadProperties(MaterialProperty[] props) bump2ndMap = FindProperty("_Bump2ndMap", props); bump2ndScale = FindProperty("_Bump2ndScale", props); bump2ndScaleMask = FindProperty("_Bump2ndScaleMask", props); + useAnisotropy = FindProperty("_UseAnisotropy", props); + anisotropyTangentMap = FindProperty("_AnisotropyTangentMap", props); + anisotropyScale = FindProperty("_AnisotropyScale", props); + anisotropyScaleMask = FindProperty("_AnisotropyScaleMask", props); + anisotropyTangentWidth = FindProperty("_AnisotropyTangentWidth", props); + anisotropyBitangentWidth = FindProperty("_AnisotropyBitangentWidth", props); + anisotropyShift = FindProperty("_AnisotropyShift", props); + anisotropyShiftNoiseScale = FindProperty("_AnisotropyShiftNoiseScale", props); + anisotropySpecularStrength = FindProperty("_AnisotropySpecularStrength", props); + anisotropy2ndTangentWidth = FindProperty("_Anisotropy2ndTangentWidth", props); + anisotropy2ndBitangentWidth = FindProperty("_Anisotropy2ndBitangentWidth", props); + anisotropy2ndShift = FindProperty("_Anisotropy2ndShift", props); + anisotropy2ndShiftNoiseScale = FindProperty("_Anisotropy2ndShiftNoiseScale", props); + anisotropy2ndSpecularStrength = FindProperty("_Anisotropy2ndSpecularStrength", props); + anisotropyShiftNoiseMask = FindProperty("_AnisotropyShiftNoiseMask", props); + anisotropy2Reflection = FindProperty("_Anisotropy2Reflection", props); + anisotropy2MatCap = FindProperty("_Anisotropy2MatCap", props); + anisotropy2MatCap2nd = FindProperty("_Anisotropy2MatCap2nd", props); useReflection = FindProperty("_UseReflection", props); smoothness = FindProperty("_Smoothness", props); smoothnessTex = FindProperty("_SmoothnessTex", props); @@ -3918,34 +4067,41 @@ private void LoadProperties(MaterialProperty[] props) reflectionColor = FindProperty("_ReflectionColor", props); reflectionColorTex = FindProperty("_ReflectionColorTex", props); applySpecular = FindProperty("_ApplySpecular", props); + applySpecularFA = FindProperty("_ApplySpecularFA", props); specularToon = FindProperty("_SpecularToon", props); applyReflection = FindProperty("_ApplyReflection", props); reflectionApplyTransparency = FindProperty("_ReflectionApplyTransparency", props); useMatCap = FindProperty("_UseMatCap", props); matcapTex = FindProperty("_MatCapTex", props); matcapColor = FindProperty("_MatCapColor", props); + matcapBlendUV1 = FindProperty("_MatCapBlendUV1", props); + matcapZRotCancel = FindProperty("_MatCapZRotCancel", props); + matcapPerspective = FindProperty("_MatCapPerspective", props); + matcapVRParallaxStrength = FindProperty("_MatCapVRParallaxStrength", props); matcapBlend = FindProperty("_MatCapBlend", props); matcapBlendMask = FindProperty("_MatCapBlendMask", props); matcapEnableLighting = FindProperty("_MatCapEnableLighting", props); matcapShadowMask = FindProperty("_MatCapShadowMask", props); - matcapVRParallaxStrength = FindProperty("_MatCapVRParallaxStrength", props); + matcapBackfaceMask = FindProperty("_MatCapBackfaceMask", props); matcapBlendMode = FindProperty("_MatCapBlendMode", props); matcapApplyTransparency = FindProperty("_MatCapApplyTransparency", props); - matcapZRotCancel = FindProperty("_MatCapZRotCancel", props); matcapCustomNormal = FindProperty("_MatCapCustomNormal", props); matcapBumpMap = FindProperty("_MatCapBumpMap", props); matcapBumpScale = FindProperty("_MatCapBumpScale", props); useMatCap2nd = FindProperty("_UseMatCap2nd", props); matcap2ndTex = FindProperty("_MatCap2ndTex", props); matcap2ndColor = FindProperty("_MatCap2ndColor", props); + matcap2ndBlendUV1 = FindProperty("_MatCap2ndBlendUV1", props); + matcap2ndZRotCancel = FindProperty("_MatCap2ndZRotCancel", props); + matcap2ndPerspective = FindProperty("_MatCap2ndPerspective", props); + matcap2ndVRParallaxStrength = FindProperty("_MatCap2ndVRParallaxStrength", props); matcap2ndBlend = FindProperty("_MatCap2ndBlend", props); matcap2ndBlendMask = FindProperty("_MatCap2ndBlendMask", props); matcap2ndEnableLighting = FindProperty("_MatCap2ndEnableLighting", props); matcap2ndShadowMask = FindProperty("_MatCap2ndShadowMask", props); - matcap2ndVRParallaxStrength = FindProperty("_MatCap2ndVRParallaxStrength", props); + matcap2ndBackfaceMask = FindProperty("_MatCap2ndBackfaceMask", props); matcap2ndBlendMode = FindProperty("_MatCap2ndBlendMode", props); matcap2ndApplyTransparency = FindProperty("_MatCap2ndApplyTransparency", props); - matcap2ndZRotCancel = FindProperty("_MatCap2ndZRotCancel", props); matcap2ndCustomNormal = FindProperty("_MatCap2ndCustomNormal", props); matcap2ndBumpMap = FindProperty("_MatCap2ndBumpMap", props); matcap2ndBumpScale = FindProperty("_MatCap2ndBumpScale", props); @@ -3957,6 +4113,7 @@ private void LoadProperties(MaterialProperty[] props) rimFresnelPower = FindProperty("_RimFresnelPower", props); rimEnableLighting = FindProperty("_RimEnableLighting", props); rimShadowMask = FindProperty("_RimShadowMask", props); + rimBackfaceMask = FindProperty("_RimBackfaceMask", props); rimApplyTransparency = FindProperty("_RimApplyTransparency", props); rimDirStrength = FindProperty("_RimDirStrength", props); rimDirRange = FindProperty("_RimDirRange", props); @@ -3971,6 +4128,7 @@ private void LoadProperties(MaterialProperty[] props) glitterMainStrength = FindProperty("_GlitterMainStrength", props); glitterEnableLighting = FindProperty("_GlitterEnableLighting", props); glitterShadowMask = FindProperty("_GlitterShadowMask", props); + glitterBackfaceMask = FindProperty("_GlitterBackfaceMask", props); glitterApplyTransparency = FindProperty("_GlitterApplyTransparency", props); glitterParams1 = FindProperty("_GlitterParams1", props); glitterParams2 = FindProperty("_GlitterParams2", props); @@ -4068,6 +4226,9 @@ private void LoadFurProperties(MaterialProperty[] props) monochromeLighting = FindProperty("_MonochromeLighting", props); lilDirectionalLightStrength = FindProperty("_lilDirectionalLightStrength", props); lightDirectionOverride = FindProperty("_LightDirectionOverride", props); + baseColor = FindProperty("_BaseColor", props); + baseMap = FindProperty("_BaseMap", props); + baseColorMap = FindProperty("_BaseColorMap", props); mainTex_ScrollRotate = FindProperty("_MainTex_ScrollRotate", props); cull = FindProperty("_Cull", props); srcBlend = FindProperty("_SrcBlend", props); @@ -4178,6 +4339,9 @@ private void LoadGemProperties(MaterialProperty[] props) monochromeLighting = FindProperty("_MonochromeLighting", props); lilDirectionalLightStrength = FindProperty("_lilDirectionalLightStrength", props); lightDirectionOverride = FindProperty("_LightDirectionOverride", props); + baseColor = FindProperty("_BaseColor", props); + baseMap = FindProperty("_BaseMap", props); + baseColorMap = FindProperty("_BaseColorMap", props); mainTex_ScrollRotate = FindProperty("_MainTex_ScrollRotate", props); cull = FindProperty("_Cull", props); srcBlend = FindProperty("_SrcBlend", props); @@ -4210,31 +4374,55 @@ private void LoadGemProperties(MaterialProperty[] props) bump2ndMap = FindProperty("_Bump2ndMap", props); bump2ndScale = FindProperty("_Bump2ndScale", props); bump2ndScaleMask = FindProperty("_Bump2ndScaleMask", props); + useAnisotropy = FindProperty("_UseAnisotropy", props); + anisotropyTangentMap = FindProperty("_AnisotropyTangentMap", props); + anisotropyScale = FindProperty("_AnisotropyScale", props); + anisotropyScaleMask = FindProperty("_AnisotropyScaleMask", props); + anisotropyTangentWidth = FindProperty("_AnisotropyTangentWidth", props); + anisotropyBitangentWidth = FindProperty("_AnisotropyBitangentWidth", props); + anisotropyShift = FindProperty("_AnisotropyShift", props); + anisotropyShiftNoiseScale = FindProperty("_AnisotropyShiftNoiseScale", props); + anisotropySpecularStrength = FindProperty("_AnisotropySpecularStrength", props); + anisotropy2ndTangentWidth = FindProperty("_Anisotropy2ndTangentWidth", props); + anisotropy2ndBitangentWidth = FindProperty("_Anisotropy2ndBitangentWidth", props); + anisotropy2ndShift = FindProperty("_Anisotropy2ndShift", props); + anisotropy2ndShiftNoiseScale = FindProperty("_Anisotropy2ndShiftNoiseScale", props); + anisotropy2ndSpecularStrength = FindProperty("_Anisotropy2ndSpecularStrength", props); + anisotropyShiftNoiseMask = FindProperty("_AnisotropyShiftNoiseMask", props); + anisotropy2Reflection = FindProperty("_Anisotropy2Reflection", props); + anisotropy2MatCap = FindProperty("_Anisotropy2MatCap", props); + anisotropy2MatCap2nd = FindProperty("_Anisotropy2MatCap2nd", props); useMatCap = FindProperty("_UseMatCap", props); matcapTex = FindProperty("_MatCapTex", props); matcapColor = FindProperty("_MatCapColor", props); + matcapBlendUV1 = FindProperty("_MatCapBlendUV1", props); + matcapZRotCancel = FindProperty("_MatCapZRotCancel", props); + matcapPerspective = FindProperty("_MatCapPerspective", props); + matcapVRParallaxStrength = FindProperty("_MatCapVRParallaxStrength", props); matcapBlend = FindProperty("_MatCapBlend", props); matcapBlendMask = FindProperty("_MatCapBlendMask", props); matcapEnableLighting = FindProperty("_MatCapEnableLighting", props); matcapShadowMask = FindProperty("_MatCapShadowMask", props); - matcapVRParallaxStrength = FindProperty("_MatCapVRParallaxStrength", props); + matcapBackfaceMask = FindProperty("_MatCapBackfaceMask", props); matcapBlendMode = FindProperty("_MatCapBlendMode", props); matcapApplyTransparency = FindProperty("_MatCapApplyTransparency", props); - matcapZRotCancel = FindProperty("_MatCapZRotCancel", props); matcapCustomNormal = FindProperty("_MatCapCustomNormal", props); matcapBumpMap = FindProperty("_MatCapBumpMap", props); matcapBumpScale = FindProperty("_MatCapBumpScale", props); useMatCap2nd = FindProperty("_UseMatCap2nd", props); matcap2ndTex = FindProperty("_MatCap2ndTex", props); matcap2ndColor = FindProperty("_MatCap2ndColor", props); + matcap2ndBlendUV1 = FindProperty("_MatCap2ndBlendUV1", props); + matcap2ndZRotCancel = FindProperty("_MatCap2ndZRotCancel", props); + matcap2ndPerspective = FindProperty("_MatCap2ndPerspective", props); + matcap2ndVRParallaxStrength = FindProperty("_MatCap2ndVRParallaxStrength", props); matcap2ndBlend = FindProperty("_MatCap2ndBlend", props); matcap2ndBlendMask = FindProperty("_MatCap2ndBlendMask", props); matcap2ndEnableLighting = FindProperty("_MatCap2ndEnableLighting", props); matcap2ndShadowMask = FindProperty("_MatCap2ndShadowMask", props); - matcap2ndVRParallaxStrength = FindProperty("_MatCap2ndVRParallaxStrength", props); + matcap2ndBackfaceMask = FindProperty("_MatCap2ndBackfaceMask", props); matcap2ndBlendMode = FindProperty("_MatCap2ndBlendMode", props); matcap2ndApplyTransparency = FindProperty("_MatCap2ndApplyTransparency", props); - matcap2ndZRotCancel = FindProperty("_MatCap2ndZRotCancel", props); matcap2ndCustomNormal = FindProperty("_MatCap2ndCustomNormal", props); matcap2ndBumpMap = FindProperty("_MatCap2ndBumpMap", props); matcap2ndBumpScale = FindProperty("_MatCap2ndBumpScale", props); @@ -4246,6 +4434,7 @@ private void LoadGemProperties(MaterialProperty[] props) rimFresnelPower = FindProperty("_RimFresnelPower", props); rimEnableLighting = FindProperty("_RimEnableLighting", props); rimShadowMask = FindProperty("_RimShadowMask", props); + rimBackfaceMask = FindProperty("_RimBackfaceMask", props); rimApplyTransparency = FindProperty("_RimApplyTransparency", props); rimDirStrength = FindProperty("_RimDirStrength", props); rimDirRange = FindProperty("_RimDirRange", props); @@ -4260,6 +4449,7 @@ private void LoadGemProperties(MaterialProperty[] props) glitterMainStrength = FindProperty("_GlitterMainStrength", props); glitterEnableLighting = FindProperty("_GlitterEnableLighting", props); glitterShadowMask = FindProperty("_GlitterShadowMask", props); + glitterBackfaceMask = FindProperty("_GlitterBackfaceMask", props); glitterApplyTransparency = FindProperty("_GlitterApplyTransparency", props); glitterParams1 = FindProperty("_GlitterParams1", props); glitterParams2 = FindProperty("_GlitterParams2", props); @@ -4333,6 +4523,9 @@ private void LoadGemProperties(MaterialProperty[] props) private void LoadFakeShadowProperties(MaterialProperty[] props) { invisible = FindProperty("_Invisible", props); + baseColor = FindProperty("_BaseColor", props); + baseMap = FindProperty("_BaseMap", props); + baseColorMap = FindProperty("_BaseColorMap", props); cull = FindProperty("_Cull", props); srcBlend = FindProperty("_SrcBlend", props); dstBlend = FindProperty("_DstBlend", props); @@ -4377,6 +4570,9 @@ private void LoadLiteProperties(MaterialProperty[] props) monochromeLighting = FindProperty("_MonochromeLighting", props); lilDirectionalLightStrength = FindProperty("_lilDirectionalLightStrength", props); lightDirectionOverride = FindProperty("_LightDirectionOverride", props); + baseColor = FindProperty("_BaseColor", props); + baseMap = FindProperty("_BaseMap", props); + baseColorMap = FindProperty("_BaseColorMap", props); mainTex_ScrollRotate = FindProperty("_MainTex_ScrollRotate", props); triMask = FindProperty("_TriMask", props); cull = FindProperty("_Cull", props); @@ -4460,6 +4656,7 @@ private void LoadLiteProperties(MaterialProperty[] props) } useMatCap = FindProperty("_UseMatCap", props); matcapTex = FindProperty("_MatCapTex", props); + matcapBlendUV1 = FindProperty("_MatCapBlendUV1", props); matcapVRParallaxStrength = FindProperty("_MatCapVRParallaxStrength", props); matcapMul = FindProperty("_MatCapMul", props); matcapZRotCancel = FindProperty("_MatCapZRotCancel", props); @@ -4484,6 +4681,13 @@ private void LoadMultiProperties(MaterialProperty[] props) useClippingCanceller = FindProperty("_UseClippingCanceller", props); asOverlay = FindProperty("_AsOverlay", props); } + + private void CopyMainColorProperties() + { + if(mainColor != null && baseColor != null) baseColor.colorValue = mainColor.colorValue; + if(mainTex != null && baseMap != null) baseMap.textureValue = mainTex.textureValue; + if(mainTex != null && baseColorMap != null) baseColorMap.textureValue = mainTex.textureValue; + } //------------------------------------------------------------------------------------------------------------------------------ // Language @@ -4765,6 +4969,7 @@ internal static void InitializeShaderSetting(ref lilToonSetting shaderSetting) shaderSetting.LIL_FEATURE_EMISSION_GRADATION = false; shaderSetting.LIL_FEATURE_NORMAL_1ST = true; shaderSetting.LIL_FEATURE_NORMAL_2ND = false; + shaderSetting.LIL_FEATURE_ANISOTROPY = false; shaderSetting.LIL_FEATURE_REFLECTION = false; shaderSetting.LIL_FEATURE_MATCAP = true; shaderSetting.LIL_FEATURE_MATCAP_2ND = false; @@ -4837,6 +5042,7 @@ internal static void TurnOffAllShaderSetting(ref lilToonSetting shaderSetting) shaderSetting.LIL_FEATURE_EMISSION_GRADATION = false; shaderSetting.LIL_FEATURE_NORMAL_1ST = false; shaderSetting.LIL_FEATURE_NORMAL_2ND = false; + shaderSetting.LIL_FEATURE_ANISOTROPY = false; shaderSetting.LIL_FEATURE_REFLECTION = false; shaderSetting.LIL_FEATURE_MATCAP = false; shaderSetting.LIL_FEATURE_MATCAP_2ND = false; @@ -4985,6 +5191,7 @@ internal static void ApplyShaderSetting(lilToonSetting shaderSetting) sb.Append("#define LIL_FEATURE_NORMAL_2ND\r\n"); if(shaderSetting.LIL_FEATURE_TEX_NORMAL_MASK) sb.Append("#define LIL_FEATURE_TEX_NORMAL_MASK\r\n"); } + if(shaderSetting.LIL_FEATURE_ANISOTROPY) sb.Append("#define LIL_FEATURE_ANISOTROPY\r\n"); if(shaderSetting.LIL_FEATURE_REFLECTION) { sb.Append("#define LIL_FEATURE_REFLECTION\r\n"); @@ -5159,6 +5366,9 @@ private static void ShaderSettingGUI() } DrawLine(); + lilToggleGUI(GetLoc("sSettingAnisotropy"), ref shaderSetting.LIL_FEATURE_ANISOTROPY); + DrawLine(); + lilToggleGUI(GetLoc("sSettingReflection"), ref shaderSetting.LIL_FEATURE_REFLECTION); if(shaderSetting.LIL_FEATURE_REFLECTION) { @@ -5852,16 +6062,6 @@ private void CopyProperties(lilPropertyBlock propertyBlock) CopyProperty(shadowColorTex); CopyProperty(shadow2ndColorTex); break; - case lilPropertyBlock.Backlight: - CopyProperty(useBacklight); - CopyProperty(backlightColor); - CopyProperty(backlightBorder); - CopyProperty(backlightBlur); - CopyProperty(backlightDirectivity); - CopyProperty(backlightViewStrength); - CopyProperty(backlightReceiveShadow); - CopyProperty(backlightColorTex); - break; case lilPropertyBlock.Emission: CopyProperty(useEmission); CopyProperty(emissionColor); @@ -5925,9 +6125,27 @@ private void CopyProperties(lilPropertyBlock propertyBlock) CopyProperty(bumpScale); CopyProperty(useBump2ndMap); CopyProperty(bump2ndScale); + CopyProperty(useAnisotropy); + CopyProperty(anisotropyScale); + CopyProperty(anisotropyTangentWidth); + CopyProperty(anisotropyBitangentWidth); + CopyProperty(anisotropyShift); + CopyProperty(anisotropyShiftNoiseScale); + CopyProperty(anisotropySpecularStrength); + CopyProperty(anisotropy2ndTangentWidth); + CopyProperty(anisotropy2ndBitangentWidth); + CopyProperty(anisotropy2ndShift); + CopyProperty(anisotropy2ndShiftNoiseScale); + CopyProperty(anisotropy2ndSpecularStrength); + CopyProperty(anisotropy2Reflection); + CopyProperty(anisotropy2MatCap); + CopyProperty(anisotropy2MatCap2nd); CopyProperty(bumpMap); CopyProperty(bump2ndMap); CopyProperty(bump2ndScaleMask); + CopyProperty(anisotropyTangentMap); + CopyProperty(anisotropyScaleMask); + CopyProperty(anisotropyShiftNoiseMask); break; case lilPropertyBlock.NormalMap1st: CopyProperty(useBumpMap); @@ -5940,6 +6158,26 @@ private void CopyProperties(lilPropertyBlock propertyBlock) CopyProperty(bump2ndMap); CopyProperty(bump2ndScaleMask); break; + case lilPropertyBlock.Anisotropy: + CopyProperty(useAnisotropy); + CopyProperty(anisotropyScale); + CopyProperty(anisotropyTangentWidth); + CopyProperty(anisotropyBitangentWidth); + CopyProperty(anisotropyShift); + CopyProperty(anisotropyShiftNoiseScale); + CopyProperty(anisotropySpecularStrength); + CopyProperty(anisotropy2ndTangentWidth); + CopyProperty(anisotropy2ndBitangentWidth); + CopyProperty(anisotropy2ndShift); + CopyProperty(anisotropy2ndShiftNoiseScale); + CopyProperty(anisotropy2ndSpecularStrength); + CopyProperty(anisotropy2Reflection); + CopyProperty(anisotropy2MatCap); + CopyProperty(anisotropy2MatCap2nd); + CopyProperty(anisotropyTangentMap); + CopyProperty(anisotropyScaleMask); + CopyProperty(anisotropyShiftNoiseMask); + break; case lilPropertyBlock.Reflections: CopyProperty(useReflection); CopyProperty(metallic); @@ -5947,27 +6185,38 @@ private void CopyProperties(lilPropertyBlock propertyBlock) CopyProperty(reflectance); CopyProperty(reflectionColor); CopyProperty(applySpecular); + CopyProperty(applySpecularFA); CopyProperty(specularToon); CopyProperty(applyReflection); CopyProperty(reflectionApplyTransparency); CopyProperty(useMatCap); CopyProperty(matcapColor); + CopyProperty(matcapBlendUV1); + CopyProperty(matcapZRotCancel); + CopyProperty(matcapPerspective); + CopyProperty(matcapVRParallaxStrength); CopyProperty(matcapBlend); CopyProperty(matcapEnableLighting); + CopyProperty(matcapShadowMask); + CopyProperty(matcapBackfaceMask); CopyProperty(matcapBlendMode); CopyProperty(matcapMul); CopyProperty(matcapApplyTransparency); - CopyProperty(matcapZRotCancel); CopyProperty(matcapCustomNormal); CopyProperty(matcapBumpScale); CopyProperty(useMatCap2nd); CopyProperty(matcap2ndColor); + CopyProperty(matcap2ndBlendUV1); + CopyProperty(matcap2ndZRotCancel); + CopyProperty(matcap2ndPerspective); + CopyProperty(matcap2ndVRParallaxStrength); CopyProperty(matcap2ndBlend); CopyProperty(matcap2ndEnableLighting); + CopyProperty(matcap2ndShadowMask); + CopyProperty(matcap2ndBackfaceMask); CopyProperty(matcap2ndBlendMode); CopyProperty(matcap2ndMul); CopyProperty(matcap2ndApplyTransparency); - CopyProperty(matcap2ndZRotCancel); CopyProperty(matcap2ndCustomNormal); CopyProperty(matcap2ndBumpScale); CopyProperty(useRim); @@ -5977,6 +6226,7 @@ private void CopyProperties(lilPropertyBlock propertyBlock) CopyProperty(rimFresnelPower); CopyProperty(rimEnableLighting); CopyProperty(rimShadowMask); + CopyProperty(rimBackfaceMask); CopyProperty(rimApplyTransparency); CopyProperty(rimDirStrength); CopyProperty(rimDirRange); @@ -5992,8 +6242,17 @@ private void CopyProperties(lilPropertyBlock propertyBlock) CopyProperty(glitterParams2); CopyProperty(glitterEnableLighting); CopyProperty(glitterShadowMask); + CopyProperty(glitterBackfaceMask); CopyProperty(glitterApplyTransparency); CopyProperty(glitterVRParallaxStrength); + CopyProperty(useBacklight); + CopyProperty(backlightColor); + CopyProperty(backlightBorder); + CopyProperty(backlightBlur); + CopyProperty(backlightDirectivity); + CopyProperty(backlightViewStrength); + CopyProperty(backlightReceiveShadow); + CopyProperty(backlightBackfaceMask); CopyProperty(gemChromaticAberration); CopyProperty(gemEnvContrast); CopyProperty(gemEnvColor); @@ -6013,6 +6272,7 @@ private void CopyProperties(lilPropertyBlock propertyBlock) CopyProperty(matcap2ndBumpMap); CopyProperty(rimColorTex); CopyProperty(glitterColorTex); + CopyProperty(backlightColorTex); break; case lilPropertyBlock.Reflection: CopyProperty(useReflection); @@ -6021,6 +6281,7 @@ private void CopyProperties(lilPropertyBlock propertyBlock) CopyProperty(reflectance); CopyProperty(reflectionColor); CopyProperty(applySpecular); + CopyProperty(applySpecularFA); CopyProperty(specularToon); CopyProperty(applyReflection); CopyProperty(reflectionApplyTransparency); @@ -6031,14 +6292,17 @@ private void CopyProperties(lilPropertyBlock propertyBlock) case lilPropertyBlock.MatCap1st: CopyProperty(useMatCap); CopyProperty(matcapColor); + CopyProperty(matcapBlendUV1); + CopyProperty(matcapZRotCancel); + CopyProperty(matcapPerspective); + CopyProperty(matcapVRParallaxStrength); CopyProperty(matcapBlend); CopyProperty(matcapEnableLighting); CopyProperty(matcapShadowMask); - CopyProperty(matcapVRParallaxStrength); + CopyProperty(matcapBackfaceMask); CopyProperty(matcapBlendMode); CopyProperty(matcapMul); CopyProperty(matcapApplyTransparency); - CopyProperty(matcapZRotCancel); CopyProperty(matcapCustomNormal); CopyProperty(matcapBumpScale); CopyProperty(matcapTex); @@ -6048,14 +6312,17 @@ private void CopyProperties(lilPropertyBlock propertyBlock) case lilPropertyBlock.MatCap2nd: CopyProperty(useMatCap2nd); CopyProperty(matcap2ndColor); + CopyProperty(matcap2ndBlendUV1); + CopyProperty(matcap2ndZRotCancel); + CopyProperty(matcap2ndPerspective); + CopyProperty(matcap2ndVRParallaxStrength); CopyProperty(matcap2ndBlend); CopyProperty(matcap2ndEnableLighting); CopyProperty(matcap2ndShadowMask); - CopyProperty(matcap2ndVRParallaxStrength); + CopyProperty(matcap2ndBackfaceMask); CopyProperty(matcap2ndBlendMode); CopyProperty(matcap2ndMul); CopyProperty(matcap2ndApplyTransparency); - CopyProperty(matcap2ndZRotCancel); CopyProperty(matcap2ndCustomNormal); CopyProperty(matcap2ndBumpScale); CopyProperty(matcap2ndTex); @@ -6070,6 +6337,7 @@ private void CopyProperties(lilPropertyBlock propertyBlock) CopyProperty(rimFresnelPower); CopyProperty(rimEnableLighting); CopyProperty(rimShadowMask); + CopyProperty(rimBackfaceMask); CopyProperty(rimApplyTransparency); CopyProperty(rimDirStrength); CopyProperty(rimDirRange); @@ -6088,10 +6356,22 @@ private void CopyProperties(lilPropertyBlock propertyBlock) CopyProperty(glitterParams2); CopyProperty(glitterEnableLighting); CopyProperty(glitterShadowMask); + CopyProperty(glitterBackfaceMask); CopyProperty(glitterApplyTransparency); CopyProperty(glitterVRParallaxStrength); CopyProperty(glitterColorTex); break; + case lilPropertyBlock.Backlight: + CopyProperty(useBacklight); + CopyProperty(backlightColor); + CopyProperty(backlightBorder); + CopyProperty(backlightBlur); + CopyProperty(backlightDirectivity); + CopyProperty(backlightViewStrength); + CopyProperty(backlightReceiveShadow); + CopyProperty(backlightBackfaceMask); + CopyProperty(backlightColorTex); + break; case lilPropertyBlock.Gem: CopyProperty(gemChromaticAberration); CopyProperty(gemEnvContrast); @@ -6470,19 +6750,6 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) PasteProperty(ref shadow2ndColorTex); } break; - case lilPropertyBlock.Backlight: - PasteProperty(ref useBacklight); - PasteProperty(ref backlightColor); - PasteProperty(ref backlightBorder); - PasteProperty(ref backlightBlur); - PasteProperty(ref backlightDirectivity); - PasteProperty(ref backlightViewStrength); - PasteProperty(ref backlightReceiveShadow); - if(shouldCopyTex) - { - PasteProperty(ref backlightColorTex); - } - break; case lilPropertyBlock.Emission: PasteProperty(ref useEmission); PasteProperty(ref emissionColor); @@ -6555,11 +6822,29 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) PasteProperty(ref bumpScale); PasteProperty(ref useBump2ndMap); PasteProperty(ref bump2ndScale); + PasteProperty(ref useAnisotropy); + PasteProperty(ref anisotropyScale); + PasteProperty(ref anisotropyTangentWidth); + PasteProperty(ref anisotropyBitangentWidth); + PasteProperty(ref anisotropyShift); + PasteProperty(ref anisotropyShiftNoiseScale); + PasteProperty(ref anisotropySpecularStrength); + PasteProperty(ref anisotropy2ndTangentWidth); + PasteProperty(ref anisotropy2ndBitangentWidth); + PasteProperty(ref anisotropy2ndShift); + PasteProperty(ref anisotropy2ndShiftNoiseScale); + PasteProperty(ref anisotropy2ndSpecularStrength); + PasteProperty(ref anisotropy2Reflection); + PasteProperty(ref anisotropy2MatCap); + PasteProperty(ref anisotropy2MatCap2nd); if(shouldCopyTex) { PasteProperty(ref bumpMap); PasteProperty(ref bump2ndMap); PasteProperty(ref bump2ndScaleMask); + PasteProperty(ref anisotropyTangentMap); + PasteProperty(ref anisotropyScaleMask); + PasteProperty(ref anisotropyShiftNoiseMask); } break; case lilPropertyBlock.NormalMap1st: @@ -6579,6 +6864,29 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) PasteProperty(ref bump2ndScaleMask); } break; + case lilPropertyBlock.Anisotropy: + PasteProperty(ref useAnisotropy); + PasteProperty(ref anisotropyScale); + PasteProperty(ref anisotropyTangentWidth); + PasteProperty(ref anisotropyBitangentWidth); + PasteProperty(ref anisotropyShift); + PasteProperty(ref anisotropyShiftNoiseScale); + PasteProperty(ref anisotropySpecularStrength); + PasteProperty(ref anisotropy2ndTangentWidth); + PasteProperty(ref anisotropy2ndBitangentWidth); + PasteProperty(ref anisotropy2ndShift); + PasteProperty(ref anisotropy2ndShiftNoiseScale); + PasteProperty(ref anisotropy2ndSpecularStrength); + PasteProperty(ref anisotropy2Reflection); + PasteProperty(ref anisotropy2MatCap); + PasteProperty(ref anisotropy2MatCap2nd); + if(shouldCopyTex) + { + PasteProperty(ref anisotropyTangentMap); + PasteProperty(ref anisotropyScaleMask); + PasteProperty(ref anisotropyShiftNoiseMask); + } + break; case lilPropertyBlock.Reflections: PasteProperty(ref useReflection); PasteProperty(ref metallic); @@ -6586,27 +6894,38 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) PasteProperty(ref reflectance); PasteProperty(ref reflectionColor); PasteProperty(ref applySpecular); + PasteProperty(ref applySpecularFA); PasteProperty(ref specularToon); PasteProperty(ref applyReflection); PasteProperty(ref reflectionApplyTransparency); PasteProperty(ref useMatCap); PasteProperty(ref matcapColor); + PasteProperty(ref matcapBlendUV1); + PasteProperty(ref matcapZRotCancel); + PasteProperty(ref matcapPerspective); + PasteProperty(ref matcapVRParallaxStrength); PasteProperty(ref matcapBlend); PasteProperty(ref matcapEnableLighting); + PasteProperty(ref matcapShadowMask); + PasteProperty(ref matcapBackfaceMask); PasteProperty(ref matcapBlendMode); PasteProperty(ref matcapMul); PasteProperty(ref matcapApplyTransparency); - PasteProperty(ref matcapZRotCancel); PasteProperty(ref matcapCustomNormal); PasteProperty(ref matcapBumpScale); PasteProperty(ref useMatCap2nd); PasteProperty(ref matcap2ndColor); + PasteProperty(ref matcap2ndBlendUV1); + PasteProperty(ref matcap2ndZRotCancel); + PasteProperty(ref matcap2ndPerspective); + PasteProperty(ref matcap2ndVRParallaxStrength); PasteProperty(ref matcap2ndBlend); PasteProperty(ref matcap2ndEnableLighting); + PasteProperty(ref matcap2ndShadowMask); + PasteProperty(ref matcap2ndBackfaceMask); PasteProperty(ref matcap2ndBlendMode); PasteProperty(ref matcap2ndMul); PasteProperty(ref matcap2ndApplyTransparency); - PasteProperty(ref matcap2ndZRotCancel); PasteProperty(ref matcap2ndCustomNormal); PasteProperty(ref matcap2ndBumpScale); PasteProperty(ref useRim); @@ -6616,6 +6935,7 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) PasteProperty(ref rimFresnelPower); PasteProperty(ref rimEnableLighting); PasteProperty(ref rimShadowMask); + PasteProperty(ref rimBackfaceMask); PasteProperty(ref rimApplyTransparency); PasteProperty(ref rimDirStrength); PasteProperty(ref rimDirRange); @@ -6631,8 +6951,17 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) PasteProperty(ref glitterParams2); PasteProperty(ref glitterEnableLighting); PasteProperty(ref glitterShadowMask); + PasteProperty(ref glitterBackfaceMask); PasteProperty(ref glitterApplyTransparency); PasteProperty(ref glitterVRParallaxStrength); + PasteProperty(ref useBacklight); + PasteProperty(ref backlightColor); + PasteProperty(ref backlightBorder); + PasteProperty(ref backlightBlur); + PasteProperty(ref backlightDirectivity); + PasteProperty(ref backlightViewStrength); + PasteProperty(ref backlightReceiveShadow); + PasteProperty(ref backlightBackfaceMask); PasteProperty(ref gemChromaticAberration); PasteProperty(ref gemEnvContrast); PasteProperty(ref gemEnvColor); @@ -6654,6 +6983,7 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) PasteProperty(ref matcap2ndBumpMap); PasteProperty(ref rimColorTex); PasteProperty(ref glitterColorTex); + PasteProperty(ref backlightColorTex); } break; case lilPropertyBlock.Reflection: @@ -6663,6 +6993,7 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) PasteProperty(ref reflectance); PasteProperty(ref reflectionColor); PasteProperty(ref applySpecular); + PasteProperty(ref applySpecularFA); PasteProperty(ref specularToon); PasteProperty(ref applyReflection); PasteProperty(ref reflectionApplyTransparency); @@ -6676,14 +7007,17 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) case lilPropertyBlock.MatCap1st: PasteProperty(ref useMatCap); PasteProperty(ref matcapColor); + PasteProperty(ref matcapBlendUV1); + PasteProperty(ref matcapZRotCancel); + PasteProperty(ref matcapPerspective); + PasteProperty(ref matcapVRParallaxStrength); PasteProperty(ref matcapBlend); PasteProperty(ref matcapEnableLighting); PasteProperty(ref matcapShadowMask); - PasteProperty(ref matcapVRParallaxStrength); + PasteProperty(ref matcapBackfaceMask); PasteProperty(ref matcapBlendMode); PasteProperty(ref matcapMul); PasteProperty(ref matcapApplyTransparency); - PasteProperty(ref matcapZRotCancel); PasteProperty(ref matcapCustomNormal); PasteProperty(ref matcapBumpScale); if(shouldCopyTex) @@ -6696,14 +7030,17 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) case lilPropertyBlock.MatCap2nd: PasteProperty(ref useMatCap2nd); PasteProperty(ref matcap2ndColor); + PasteProperty(ref matcap2ndBlendUV1); + PasteProperty(ref matcap2ndZRotCancel); + PasteProperty(ref matcap2ndPerspective); + PasteProperty(ref matcap2ndVRParallaxStrength); PasteProperty(ref matcap2ndBlend); PasteProperty(ref matcap2ndEnableLighting); PasteProperty(ref matcap2ndShadowMask); - PasteProperty(ref matcap2ndVRParallaxStrength); + PasteProperty(ref matcap2ndBackfaceMask); PasteProperty(ref matcap2ndBlendMode); PasteProperty(ref matcap2ndMul); PasteProperty(ref matcap2ndApplyTransparency); - PasteProperty(ref matcap2ndZRotCancel); PasteProperty(ref matcap2ndCustomNormal); PasteProperty(ref matcap2ndBumpScale); if(shouldCopyTex) @@ -6721,6 +7058,7 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) PasteProperty(ref rimFresnelPower); PasteProperty(ref rimEnableLighting); PasteProperty(ref rimShadowMask); + PasteProperty(ref rimBackfaceMask); PasteProperty(ref rimApplyTransparency); PasteProperty(ref rimDirStrength); PasteProperty(ref rimDirRange); @@ -6742,6 +7080,7 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) PasteProperty(ref glitterParams2); PasteProperty(ref glitterEnableLighting); PasteProperty(ref glitterShadowMask); + PasteProperty(ref glitterBackfaceMask); PasteProperty(ref glitterApplyTransparency); PasteProperty(ref glitterVRParallaxStrength); if(shouldCopyTex) @@ -6749,6 +7088,20 @@ private void PasteProperties(lilPropertyBlock propertyBlock, bool shouldCopyTex) PasteProperty(ref glitterColorTex); } break; + case lilPropertyBlock.Backlight: + PasteProperty(ref useBacklight); + PasteProperty(ref backlightColor); + PasteProperty(ref backlightBorder); + PasteProperty(ref backlightBlur); + PasteProperty(ref backlightDirectivity); + PasteProperty(ref backlightViewStrength); + PasteProperty(ref backlightReceiveShadow); + PasteProperty(ref backlightBackfaceMask); + if(shouldCopyTex) + { + PasteProperty(ref backlightColorTex); + } + break; case lilPropertyBlock.Gem: PasteProperty(ref gemChromaticAberration); PasteProperty(ref gemEnvContrast); @@ -7124,16 +7477,6 @@ private void ResetProperties(lilPropertyBlock propertyBlock) ResetProperty(ref shadowColorTex); ResetProperty(ref shadow2ndColorTex); break; - case lilPropertyBlock.Backlight: - ResetProperty(ref useBacklight); - ResetProperty(ref backlightColor); - ResetProperty(ref backlightBorder); - ResetProperty(ref backlightBlur); - ResetProperty(ref backlightDirectivity); - ResetProperty(ref backlightViewStrength); - ResetProperty(ref backlightReceiveShadow); - ResetProperty(ref backlightColorTex); - break; case lilPropertyBlock.Emission: ResetProperty(ref useEmission); ResetProperty(ref emissionColor); @@ -7197,9 +7540,27 @@ private void ResetProperties(lilPropertyBlock propertyBlock) ResetProperty(ref bumpScale); ResetProperty(ref useBump2ndMap); ResetProperty(ref bump2ndScale); + ResetProperty(ref useAnisotropy); + ResetProperty(ref anisotropyScale); + ResetProperty(ref anisotropyTangentWidth); + ResetProperty(ref anisotropyBitangentWidth); + ResetProperty(ref anisotropyShift); + ResetProperty(ref anisotropyShiftNoiseScale); + ResetProperty(ref anisotropySpecularStrength); + ResetProperty(ref anisotropy2ndTangentWidth); + ResetProperty(ref anisotropy2ndBitangentWidth); + ResetProperty(ref anisotropy2ndShift); + ResetProperty(ref anisotropy2ndShiftNoiseScale); + ResetProperty(ref anisotropy2ndSpecularStrength); + ResetProperty(ref anisotropy2Reflection); + ResetProperty(ref anisotropy2MatCap); + ResetProperty(ref anisotropy2MatCap2nd); ResetProperty(ref bumpMap); ResetProperty(ref bump2ndMap); ResetProperty(ref bump2ndScaleMask); + ResetProperty(ref anisotropyTangentMap); + ResetProperty(ref anisotropyScaleMask); + ResetProperty(ref anisotropyShiftNoiseMask); break; case lilPropertyBlock.NormalMap1st: ResetProperty(ref useBumpMap); @@ -7212,6 +7573,26 @@ private void ResetProperties(lilPropertyBlock propertyBlock) ResetProperty(ref bump2ndMap); ResetProperty(ref bump2ndScaleMask); break; + case lilPropertyBlock.Anisotropy: + ResetProperty(ref useAnisotropy); + ResetProperty(ref anisotropyScale); + ResetProperty(ref anisotropyTangentWidth); + ResetProperty(ref anisotropyBitangentWidth); + ResetProperty(ref anisotropyShift); + ResetProperty(ref anisotropyShiftNoiseScale); + ResetProperty(ref anisotropySpecularStrength); + ResetProperty(ref anisotropy2ndTangentWidth); + ResetProperty(ref anisotropy2ndBitangentWidth); + ResetProperty(ref anisotropy2ndShift); + ResetProperty(ref anisotropy2ndShiftNoiseScale); + ResetProperty(ref anisotropy2ndSpecularStrength); + ResetProperty(ref anisotropy2Reflection); + ResetProperty(ref anisotropy2MatCap); + ResetProperty(ref anisotropy2MatCap2nd); + ResetProperty(ref anisotropyTangentMap); + ResetProperty(ref anisotropyScaleMask); + ResetProperty(ref anisotropyShiftNoiseMask); + break; case lilPropertyBlock.Reflections: ResetProperty(ref useReflection); ResetProperty(ref metallic); @@ -7219,27 +7600,38 @@ private void ResetProperties(lilPropertyBlock propertyBlock) ResetProperty(ref reflectance); ResetProperty(ref reflectionColor); ResetProperty(ref applySpecular); + ResetProperty(ref applySpecularFA); ResetProperty(ref specularToon); ResetProperty(ref applyReflection); ResetProperty(ref reflectionApplyTransparency); ResetProperty(ref useMatCap); ResetProperty(ref matcapColor); + ResetProperty(ref matcapBlendUV1); + ResetProperty(ref matcapZRotCancel); + ResetProperty(ref matcapPerspective); + ResetProperty(ref matcapVRParallaxStrength); ResetProperty(ref matcapBlend); ResetProperty(ref matcapEnableLighting); + ResetProperty(ref matcapShadowMask); + ResetProperty(ref matcapBackfaceMask); ResetProperty(ref matcapBlendMode); ResetProperty(ref matcapMul); ResetProperty(ref matcapApplyTransparency); - ResetProperty(ref matcapZRotCancel); ResetProperty(ref matcapCustomNormal); ResetProperty(ref matcapBumpScale); ResetProperty(ref useMatCap2nd); ResetProperty(ref matcap2ndColor); + ResetProperty(ref matcap2ndBlendUV1); + ResetProperty(ref matcap2ndZRotCancel); + ResetProperty(ref matcap2ndPerspective); + ResetProperty(ref matcap2ndVRParallaxStrength); ResetProperty(ref matcap2ndBlend); ResetProperty(ref matcap2ndEnableLighting); + ResetProperty(ref matcap2ndShadowMask); + ResetProperty(ref matcapBackfaceMask); ResetProperty(ref matcap2ndBlendMode); ResetProperty(ref matcap2ndMul); ResetProperty(ref matcap2ndApplyTransparency); - ResetProperty(ref matcap2ndZRotCancel); ResetProperty(ref matcap2ndCustomNormal); ResetProperty(ref matcap2ndBumpScale); ResetProperty(ref useRim); @@ -7249,6 +7641,7 @@ private void ResetProperties(lilPropertyBlock propertyBlock) ResetProperty(ref rimFresnelPower); ResetProperty(ref rimEnableLighting); ResetProperty(ref rimShadowMask); + ResetProperty(ref rimBackfaceMask); ResetProperty(ref rimApplyTransparency); ResetProperty(ref rimDirStrength); ResetProperty(ref rimDirRange); @@ -7264,8 +7657,17 @@ private void ResetProperties(lilPropertyBlock propertyBlock) ResetProperty(ref glitterParams2); ResetProperty(ref glitterEnableLighting); ResetProperty(ref glitterShadowMask); + ResetProperty(ref glitterBackfaceMask); ResetProperty(ref glitterApplyTransparency); ResetProperty(ref glitterVRParallaxStrength); + ResetProperty(ref useBacklight); + ResetProperty(ref backlightColor); + ResetProperty(ref backlightBorder); + ResetProperty(ref backlightBlur); + ResetProperty(ref backlightDirectivity); + ResetProperty(ref backlightViewStrength); + ResetProperty(ref backlightReceiveShadow); + ResetProperty(ref backlightBackfaceMask); ResetProperty(ref gemChromaticAberration); ResetProperty(ref gemEnvContrast); ResetProperty(ref gemEnvColor); @@ -7285,6 +7687,7 @@ private void ResetProperties(lilPropertyBlock propertyBlock) ResetProperty(ref matcap2ndBumpMap); ResetProperty(ref rimColorTex); ResetProperty(ref glitterColorTex); + ResetProperty(ref backlightColorTex); break; case lilPropertyBlock.Reflection: ResetProperty(ref useReflection); @@ -7293,6 +7696,7 @@ private void ResetProperties(lilPropertyBlock propertyBlock) ResetProperty(ref reflectance); ResetProperty(ref reflectionColor); ResetProperty(ref applySpecular); + ResetProperty(ref applySpecularFA); ResetProperty(ref specularToon); ResetProperty(ref applyReflection); ResetProperty(ref reflectionApplyTransparency); @@ -7303,14 +7707,17 @@ private void ResetProperties(lilPropertyBlock propertyBlock) case lilPropertyBlock.MatCap1st: ResetProperty(ref useMatCap); ResetProperty(ref matcapColor); + ResetProperty(ref matcapBlendUV1); + ResetProperty(ref matcapZRotCancel); + ResetProperty(ref matcapPerspective); + ResetProperty(ref matcapVRParallaxStrength); ResetProperty(ref matcapBlend); ResetProperty(ref matcapEnableLighting); ResetProperty(ref matcapShadowMask); - ResetProperty(ref matcapVRParallaxStrength); + ResetProperty(ref matcapBackfaceMask); ResetProperty(ref matcapBlendMode); ResetProperty(ref matcapMul); ResetProperty(ref matcapApplyTransparency); - ResetProperty(ref matcapZRotCancel); ResetProperty(ref matcapCustomNormal); ResetProperty(ref matcapBumpScale); ResetProperty(ref matcapTex); @@ -7320,14 +7727,17 @@ private void ResetProperties(lilPropertyBlock propertyBlock) case lilPropertyBlock.MatCap2nd: ResetProperty(ref useMatCap2nd); ResetProperty(ref matcap2ndColor); + ResetProperty(ref matcap2ndBlendUV1); + ResetProperty(ref matcap2ndZRotCancel); + ResetProperty(ref matcap2ndPerspective); + ResetProperty(ref matcap2ndVRParallaxStrength); ResetProperty(ref matcap2ndBlend); ResetProperty(ref matcap2ndEnableLighting); ResetProperty(ref matcap2ndShadowMask); - ResetProperty(ref matcap2ndVRParallaxStrength); + ResetProperty(ref matcap2ndBackfaceMask); ResetProperty(ref matcap2ndBlendMode); ResetProperty(ref matcap2ndMul); ResetProperty(ref matcap2ndApplyTransparency); - ResetProperty(ref matcap2ndZRotCancel); ResetProperty(ref matcap2ndCustomNormal); ResetProperty(ref matcap2ndBumpScale); ResetProperty(ref matcap2ndTex); @@ -7342,6 +7752,7 @@ private void ResetProperties(lilPropertyBlock propertyBlock) ResetProperty(ref rimFresnelPower); ResetProperty(ref rimEnableLighting); ResetProperty(ref rimShadowMask); + ResetProperty(ref rimBackfaceMask); ResetProperty(ref rimApplyTransparency); ResetProperty(ref rimDirStrength); ResetProperty(ref rimDirRange); @@ -7360,10 +7771,22 @@ private void ResetProperties(lilPropertyBlock propertyBlock) ResetProperty(ref glitterParams2); ResetProperty(ref glitterEnableLighting); ResetProperty(ref glitterShadowMask); + ResetProperty(ref glitterBackfaceMask); ResetProperty(ref glitterApplyTransparency); ResetProperty(ref glitterVRParallaxStrength); ResetProperty(ref glitterColorTex); break; + case lilPropertyBlock.Backlight: + ResetProperty(ref useBacklight); + ResetProperty(ref backlightColor); + ResetProperty(ref backlightBorder); + ResetProperty(ref backlightBlur); + ResetProperty(ref backlightDirectivity); + ResetProperty(ref backlightViewStrength); + ResetProperty(ref backlightReceiveShadow); + ResetProperty(ref backlightBackfaceMask); + ResetProperty(ref backlightColorTex); + break; case lilPropertyBlock.Gem: ResetProperty(ref gemChromaticAberration); ResetProperty(ref gemEnvContrast); @@ -7972,6 +8395,7 @@ internal static void SetupShaderSettingFromMaterial(Material material, ref lilTo if(material.HasProperty("_EmissionUseGrad")) shaderSetting.LIL_FEATURE_EMISSION_GRADATION = shaderSetting.LIL_FEATURE_EMISSION_GRADATION || material.GetFloat("_EmissionUseGrad") != 0.0f; if(material.HasProperty("_UseBumpMap")) shaderSetting.LIL_FEATURE_NORMAL_1ST = shaderSetting.LIL_FEATURE_NORMAL_1ST || material.GetFloat("_UseBumpMap") != 0.0f; if(material.HasProperty("_UseBump2ndMap")) shaderSetting.LIL_FEATURE_NORMAL_2ND = shaderSetting.LIL_FEATURE_NORMAL_2ND || material.GetFloat("_UseBump2ndMap") != 0.0f; + if(material.HasProperty("_UseAnisotropy")) shaderSetting.LIL_FEATURE_ANISOTROPY = shaderSetting.LIL_FEATURE_ANISOTROPY || material.GetFloat("_UseAnisotropy") != 0.0f; if(material.HasProperty("_UseReflection")) shaderSetting.LIL_FEATURE_REFLECTION = shaderSetting.LIL_FEATURE_REFLECTION || material.GetFloat("_UseReflection") != 0.0f; if(material.HasProperty("_UseMatCap")) shaderSetting.LIL_FEATURE_MATCAP = shaderSetting.LIL_FEATURE_MATCAP || material.GetFloat("_UseMatCap") != 0.0f; if(material.HasProperty("_UseMatCap2nd")) shaderSetting.LIL_FEATURE_MATCAP_2ND = shaderSetting.LIL_FEATURE_MATCAP_2ND || material.GetFloat("_UseMatCap2nd") != 0.0f; @@ -8089,6 +8513,7 @@ internal static void SetupMaterialFromShaderSetting(Material material, lilToonSe if(!shaderSetting.LIL_FEATURE_EMISSION_GRADATION) material.SetFloat("_EmissionUseGrad", 0.0f); if(!shaderSetting.LIL_FEATURE_NORMAL_1ST) material.SetFloat("_UseBumpMap", 0.0f); if(!shaderSetting.LIL_FEATURE_NORMAL_2ND) material.SetFloat("_UseBump2ndMap", 0.0f); + if(!shaderSetting.LIL_FEATURE_ANISOTROPY) material.SetFloat("_UseAnisotropy", 0.0f); if(!shaderSetting.LIL_FEATURE_REFLECTION) material.SetFloat("_UseReflection", 0.0f); if(!shaderSetting.LIL_FEATURE_MATCAP) material.SetFloat("_UseMatCap", 0.0f); if(!shaderSetting.LIL_FEATURE_MATCAP_2ND) material.SetFloat("_UseMatCap2nd", 0.0f); @@ -8194,6 +8619,7 @@ internal static void SetupShaderSettingFromAnimationClip(AnimationClip clip, ref shaderSetting.LIL_FEATURE_EMISSION_GRADATION = shaderSetting.LIL_FEATURE_EMISSION_GRADATION || propname.Contains("_EmissionUseGrad"); shaderSetting.LIL_FEATURE_NORMAL_1ST = shaderSetting.LIL_FEATURE_NORMAL_1ST || propname.Contains("_UseBumpMap"); shaderSetting.LIL_FEATURE_NORMAL_2ND = shaderSetting.LIL_FEATURE_NORMAL_2ND || propname.Contains("_UseBump2ndMap"); + shaderSetting.LIL_FEATURE_ANISOTROPY = shaderSetting.LIL_FEATURE_ANISOTROPY || propname.Contains("_UseAnisotropy"); shaderSetting.LIL_FEATURE_REFLECTION = shaderSetting.LIL_FEATURE_REFLECTION || propname.Contains("_UseReflection"); shaderSetting.LIL_FEATURE_MATCAP = shaderSetting.LIL_FEATURE_MATCAP || propname.Contains("_UseMatCap"); shaderSetting.LIL_FEATURE_MATCAP_2ND = shaderSetting.LIL_FEATURE_MATCAP_2ND || propname.Contains("_UseMatCap2nd"); @@ -8280,6 +8706,7 @@ internal void SetupMultiMaterial(Material material) SetShaderKeywords(material, "_SUNDISK_SIMPLE", false); SetShaderKeywords(material, "_NORMALMAP", false); SetShaderKeywords(material, "EFFECT_BUMP", false); + SetShaderKeywords(material, "SOURCE_GBUFFER", false); SetShaderKeywords(material, "_SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A", false); SetShaderKeywords(material, "_SPECULARHIGHLIGHTS_OFF", false); SetShaderKeywords(material, "GEOM_TYPE_MESH", false); @@ -8297,6 +8724,7 @@ internal void SetupMultiMaterial(Material material) SetShaderKeywords(material, "_SUNDISK_SIMPLE", useEmission.floatValue != 0.0f && emissionBlendMask.textureValue != null || useEmission2nd.floatValue != 0.0f && emission2ndBlendMask.textureValue != null); SetShaderKeywords(material, "_NORMALMAP", useBumpMap.floatValue != 0.0f); SetShaderKeywords(material, "EFFECT_BUMP", useBump2ndMap.floatValue != 0.0f); + SetShaderKeywords(material, "SOURCE_GBUFFER", useAnisotropy.floatValue != 0.0f); SetShaderKeywords(material, "_SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A", useMatCap.floatValue != 0.0f); SetShaderKeywords(material, "_SPECULARHIGHLIGHTS_OFF", useMatCap2nd.floatValue != 0.0f); SetShaderKeywords(material, "GEOM_TYPE_MESH", useMatCap.floatValue != 0.0f && matcapCustomNormal.floatValue != 0.0f || useMatCap2nd.floatValue != 0.0f && matcap2ndCustomNormal.floatValue != 0.0f); @@ -8421,6 +8849,12 @@ private static void RemoveUnusedTexture(Material material, bool islite, bool isf material.SetTexture("_Bump2ndMap", null); material.SetTexture("_Bump2ndScaleMask", null); } + if(material.GetFloat("_UseAnisotropy") == 0.0f) + { + material.SetTexture("_AnisotropyTangentMap", null); + material.SetTexture("_AnisotropyScaleMask", null); + material.SetTexture("_AnisotropyShiftNoiseMask", null); + } if(material.GetFloat("_UseReflection") == 0.0f) { material.SetTexture("_SmoothnessTex", null); @@ -8504,7 +8938,6 @@ internal static void ApplyPreset(Material material, lilToonPreset preset) if(preset.floats[i].name == "_StencilPass") material.SetFloat(preset.floats[i].name, preset.floats[i].value); } if(preset.shader != null) material.shader = preset.shader; - if(preset.renderQueue != -2) material.renderQueue = preset.renderQueue; bool isoutl = preset.outline; bool istess = preset.tessellation; bool isstencil = (material.GetFloat("_StencilPass") == (float)UnityEngine.Rendering.StencilOp.Replace); @@ -8531,6 +8964,7 @@ internal static void ApplyPreset(Material material, lilToonPreset preset) if(istwopass) transparentMode = TransparentMode.TwoPass; SetupMaterialWithRenderingMode(material, renderingMode, transparentMode, isoutl, islite, isstencil, istess); + if(preset.renderQueue != -2) material.renderQueue = preset.renderQueue; for(int i = 0; i < preset.colors.Length; i++) material.SetColor(preset.colors[i].name, preset.colors[i].value); for(int i = 0; i < preset.vectors.Length; i++) material.SetVector(preset.vectors[i].name, preset.vectors[i].value); @@ -8871,6 +9305,9 @@ private void CreateLiteMaterial(Material material) { liteMaterial.SetTexture("_MatCapTex", bakedMatCap); liteMaterial.SetFloat("_UseMatCap", useMatCap.floatValue); + liteMaterial.SetFloat("_MatCapBlendUV1", matcapBlendUV1.floatValue); + liteMaterial.SetFloat("_MatCapZRotCancel", matcapZRotCancel.floatValue); + liteMaterial.SetFloat("_MatCapPerspective", matcapPerspective.floatValue); liteMaterial.SetFloat("_MatCapVRParallaxStrength", matcapVRParallaxStrength.floatValue); if(matcapBlendMode.floatValue == 3) liteMaterial.SetFloat("_MatCapMul", useMatCap.floatValue); else liteMaterial.SetFloat("_MatCapMul", useMatCap.floatValue); @@ -9335,6 +9772,26 @@ private void TextureGUI(MaterialEditor materialEditor, ref bool isShow, GUIConte } } + private void MatCapTextureGUI(MaterialEditor materialEditor, ref bool isShow, GUIContent guiContent, MaterialProperty textureName, MaterialProperty rgba, MaterialProperty blendUV1, MaterialProperty zRotCancel, MaterialProperty perspective, MaterialProperty vrParallaxStrength) + { + // Make space for foldout + EditorGUI.indentLevel++; + Rect rect = materialEditor.TexturePropertySingleLine(guiContent, textureName, rgba); + EditorGUI.indentLevel--; + rect.x += 10; + isShow = EditorGUI.Foldout(rect, isShow, ""); + if(isShow) + { + EditorGUI.indentLevel++; + materialEditor.TextureScaleOffsetProperty(textureName); + materialEditor.ShaderProperty(blendUV1, GetLoc("sBlendUV1")); + materialEditor.ShaderProperty(zRotCancel, GetLoc("sMatCapZRotCancel")); + materialEditor.ShaderProperty(perspective, GetLoc("sFixPerspective")); + materialEditor.ShaderProperty(vrParallaxStrength, GetLoc("sVRParallaxStrength")); + EditorGUI.indentLevel--; + } + } + //------------------------------------------------------------------------------------------------------------------------------ // Bake private void TextureBake(Material material, int bakeType) diff --git a/Assets/lilToon/Editor/lilStartup.cs b/Assets/lilToon/Editor/lilStartup.cs index b43eb10f..c0ef4267 100644 --- a/Assets/lilToon/Editor/lilStartup.cs +++ b/Assets/lilToon/Editor/lilStartup.cs @@ -22,11 +22,11 @@ static void lilStartupMethod() lilToonInspector.InitializeLanguage(); // Initialize - if(lilToonInspector.isUPM) + StreamReader csr = new StreamReader(shaderCommonPath); + string cs = csr.ReadToEnd(); + csr.Close(); + if(lilToonInspector.isUPM && cs.Contains("#include \"../../../lilToonSetting/lil_setting.hlsl\"")) { - StreamReader csr = new StreamReader(shaderCommonPath); - string cs = csr.ReadToEnd(); - csr.Close(); cs = cs.Replace( "#include \"../../../lilToonSetting/lil_setting.hlsl\"", "#include \"Assets/lilToonSetting/lil_setting.hlsl\""); @@ -34,11 +34,8 @@ static void lilStartupMethod() csw.Write(cs); csw.Close(); } - else + else if(!lilToonInspector.isUPM && cs.Contains("#include \"Assets/lilToonSetting/lil_setting.hlsl\"")) { - StreamReader csr = new StreamReader(shaderCommonPath); - string cs = csr.ReadToEnd(); - csr.Close(); cs = cs.Replace( "#include \"Assets/lilToonSetting/lil_setting.hlsl\"", "#include \"../../../lilToonSetting/lil_setting.hlsl\""); diff --git a/Assets/lilToon/Editor/lilToonPropertyDrawer.cs b/Assets/lilToon/Editor/lilToonPropertyDrawer.cs index 3eb3e9e2..3a328213 100644 --- a/Assets/lilToon/Editor/lilToonPropertyDrawer.cs +++ b/Assets/lilToon/Editor/lilToonPropertyDrawer.cs @@ -158,6 +158,31 @@ public override void OnGUI(Rect position, MaterialProperty prop, String label, M } } + public class lilVec2RDrawer : MaterialPropertyDrawer + { + // Draw vector4 as vector3 + // [lilVec2R] + public override void OnGUI(Rect position, MaterialProperty prop, String label, MaterialEditor editor) + { + Rect position1 = EditorGUILayout.GetControlRect(); + float x = prop.vectorValue.x; + float y = prop.vectorValue.y; + + EditorGUIUtility.wideMode = true; + + EditorGUI.BeginChangeCheck(); + EditorGUI.showMixedValue = prop.hasMixedValue; + x = EditorGUI.Slider(position, label + ": x", x, 0.0f, 1.0f); + y = EditorGUI.Slider(position1, label + ": y", y, 0.0f, 1.0f); + EditorGUI.showMixedValue = false; + + if(EditorGUI.EndChangeCheck()) + { + prop.vectorValue = new Vector4(x, y, prop.vectorValue.z, prop.vectorValue.w); + } + } + } + public class lilVec3Drawer : MaterialPropertyDrawer { // Draw vector4 as vector3 @@ -459,6 +484,36 @@ public override void OnGUI(Rect position, MaterialProperty prop, String label, M } } + public class lilFFFB : MaterialPropertyDrawer + { + // [lilFFFB] + public override void OnGUI(Rect position, MaterialProperty prop, String label, MaterialEditor editor) + { + string[] labels = label.Split('|'); + float param1 = prop.vectorValue.x; + float param2 = prop.vectorValue.y; + float param3 = prop.vectorValue.z; + bool param4 = (prop.vectorValue.w != 0.0f); + + EditorGUI.indentLevel++; + Rect position1 = EditorGUILayout.GetControlRect(); + Rect position2 = EditorGUILayout.GetControlRect(); + Rect position3 = EditorGUILayout.GetControlRect(); + + EditorGUI.BeginChangeCheck(); + param1 = EditorGUI.FloatField(position, labels[0], param1); + param2 = EditorGUI.FloatField(position1, labels[1], param2); + param3 = EditorGUI.FloatField(position2, labels[2], param3); + param4 = EditorGUI.Toggle(position3, labels[3], param4); + EditorGUI.indentLevel--; + + if(EditorGUI.EndChangeCheck()) + { + prop.vectorValue = new Vector4(param1, param2, param3, param4 ? 1.0f : 0.0f); + } + } + } + public class lilALUVMode : MaterialPropertyDrawer { // [lilALUVMode] diff --git a/Assets/lilToon/Editor/lilToonSetting.cs b/Assets/lilToon/Editor/lilToonSetting.cs index 55575f52..d93b9e16 100644 --- a/Assets/lilToon/Editor/lilToonSetting.cs +++ b/Assets/lilToon/Editor/lilToonSetting.cs @@ -23,6 +23,7 @@ public class lilToonSetting : ScriptableObject public bool LIL_FEATURE_EMISSION_GRADATION; public bool LIL_FEATURE_NORMAL_1ST; public bool LIL_FEATURE_NORMAL_2ND; + public bool LIL_FEATURE_ANISOTROPY; public bool LIL_FEATURE_REFLECTION; public bool LIL_FEATURE_MATCAP; public bool LIL_FEATURE_MATCAP_2ND; diff --git a/Assets/lilToon/MANUAL.md b/Assets/lilToon/MANUAL.md index 12e0ddce..2d40949a 100644 --- a/Assets/lilToon/MANUAL.md +++ b/Assets/lilToon/MANUAL.md @@ -14,6 +14,7 @@ - [Emission](#emission) - [Normal Map & Reflection](#normal-map--reflection) - [Normal Map](#normal-map) + - [Anisotropy](#anisotropy) - [Reflections](#reflections) - [Reflection](#reflection) - [MatCap](#matcap) @@ -259,6 +260,22 @@ You can blend colors into the main color. This is the layer function in painting
+### Anisotropy +|Name|Description| +|-|-| +|Normal Map|Specifies the Normal Map.| +|Mask|Area and strength to apply anisotropy.| +|Apply to|Target to apply the anisotropy to.| +|-|-| +|Tangent Width|Width of the specular in the tangent direction (UV X-axis).| +|Bitangent Width|Width of the specular in the bitangent direction (UV Y-axis).| +|Offset|Position of specular.| +|Noise Strength|Strength of noise that shifts the position of specular.| +|Strength|Strength of specular.| +|Noise|Noise texture that shifts the position of the specular| + +
+ ## Reflections ### Reflection |Name|Description| @@ -268,14 +285,22 @@ You can blend colors into the main color. This is the layer function in painting |Reflectance|Reflectance of environment light. [Example value](https://forum.corona-renderer.com/index.php?topic=2359.0)| |Color|Color of reflection.| |Specular Type|The appearance of light reflection.| +|Multi Light Specular|When turned on, specular will also be generated from point lights and spotlights.| |Environment Reflections|Reflects environment light.| ### MatCap |Name|Description| |-|-| |MatCap|Specifies the MatCap.| +|Blend UV1|Percentage of blending UV1 as UV in MatCap.| +|Z-axis rotation cancellation|Disable Z-axis rotation.| +|Fix Perspective|Corrects UV misalignment due to perspective.| +|VR Parallax Strength|Strength of parallax in VR.| +|-|-| |Mask|Area and strength to apply MatCap.| |Enable Lighting|Apply the color of the light to MatCap.| +|Shadow Mask|Turn off MatCap in the shadow.| +|Backface Mask|Turn off MatCap in the backface.| |Blending Mode|How to apply MatCap. You can select Normal, Add, Screen, or Multiply.| |Custom normal map|Custom normal map for MatCap.| @@ -288,6 +313,7 @@ You can blend colors into the main color. This is the layer function in painting |Fresnel Power|Sharpness of rim light.| |Enable Lighting|Apply the color of the light to rim light.| |Shadow Mask|Turn off rim light in the shadow.| +|Backface Mask|Turn off rim light in the backface.| |Light direction strength|Influence of light direction.| |Direct light width|Range of direct light.| |Indirect light width|Range of indirect light (shadow).| @@ -300,6 +326,7 @@ You can blend colors into the main color. This is the layer function in painting |Main Color Power|Multiply the Main Color.| |Enable Lighting|Apply the color of the light to glitter.| |Shadow Mask|Turn off glitter in the shadow.| +|Backface Mask|Turn off glitter in the backface.| |Tiling|Number of glitter loops.| |Particle Size|Size of glitter particle.| |Contrast|Contrast of glitter.| @@ -318,6 +345,7 @@ You can blend colors into the main color. This is the layer function in painting |Directivity|Degree to which the brightness changes according to the light direction.| |View direction strength|The degree to which the range of light changes depending on the view direction.| |Receive Shadow|Receive shadows from other objects.| +|Backface Mask|Turn off backlight in the backface.| ### Gem |Name|Description| diff --git a/Assets/lilToon/MANUAL_JP.md b/Assets/lilToon/MANUAL_JP.md index c54a718b..affc1768 100644 --- a/Assets/lilToon/MANUAL_JP.md +++ b/Assets/lilToon/MANUAL_JP.md @@ -14,6 +14,7 @@ - [発光設定](#発光設定) - [ノーマルマップ・光沢設定](#ノーマルマップ光沢設定) - [ノーマルマップ設定](#ノーマルマップ設定) + - [異方性反射](#異方性反射) - [光沢設定](#光沢設定) - [反射](#反射) - [マットキャップ](#マットキャップ) @@ -260,6 +261,22 @@ FakeShadowを使用する場合は以下のようにステンシル設定を変
+### 異方性反射 +|名前|説明| +|-|-| +|ノーマルマップ|ノーマルマップを指定します。| +|マスク|異方性反射を適用する部分と強さを指定します。| +|適用先|異方性反射を適用する対象です。| +|-|-| +|タンジェント方向の幅|ハイライトのタンジェント方向(UVのX軸)の幅です。| +|バイタンジェント方向の幅|ハイライトのバイタンジェント方向(UVのY軸)の幅です。| +|Offset|ハイライトの位置です。| +|ノイズの強度|ハイライトの位置をずらすノイズの強度です。| +|強度|ハイライトの強度です。| +|ノイズ|ハイライトの位置をずらすノイズです。| + +
+ ## 光沢設定 ### 反射 |名前|説明| @@ -269,14 +286,22 @@ FakeShadowを使用する場合は以下のようにステンシル設定を変 |反射率|環境光の反射率です。[数値のサンプル](https://forum.corona-renderer.com/index.php?topic=2359.0)| |色|反射の色です。| |光沢のタイプ|ライトを反射させる見た目です。| +|複数ライトから光沢を生成|オンにするとポイントライトやスポットライトからも光沢を生成するようになります。| |環境光の反射|周りの色を反射させます。| ### マットキャップ |名前|説明| |-|-| |マットキャップ|マットキャップを指定します。| +|UV1を合成|UV1をマットキャップのUVとしてブレンドします。| +|Z軸回転キャンセル|Z軸方向の回転を無効化します。| +|パース補正|パースによるUVのずれを補正します。| +|VR時の視差の強さ|VR時の視差の強さを変更し「ギラギラ感」を調整します。| +|-|-| |マスク|マットキャップを適用する部分を指定します。| |ライティングを適用|マットキャップにライトの明るさを適用します。| +|影部分で無効化|影の部分でマットキャップを消すようになります。| +|裏面で無効化|裏面でマットキャップを消すようになります。| |合成モード|マットキャップの合成方法です。通常、加算、スクリーン、乗算が選択できます。| |カスタムノーマルマップ|マットキャップに専用のノーマルマップを設定できます。| @@ -289,6 +314,7 @@ FakeShadowを使用する場合は以下のようにステンシル設定を変 |リムライトの細さ|リムライトの細さです。| |ライティングを適用|リムライトにライトの明るさを適用します。| |影部分で無効化|影の部分でリムライトを消すようになります。| +|裏面で無効化|裏面でリムライトを消すようになります。| |ライト方向の影響度|ライト方向によってリムライトをカスタマイズできます。| |直接光の幅|直接光の範囲です。| |関節光の幅|環境光(影)の範囲です。| @@ -301,6 +327,7 @@ FakeShadowを使用する場合は以下のようにステンシル設定を変 |メインカラーの強度|メインカラーを乗算する度合いです。| |ライティングを適用|ラメにライトの明るさを適用します。| |影部分で無効化|影の部分でラメを消すようになります。| +|裏面で無効化|裏面でラメを消すようになります。| |Tiling|ラメの細かさです。| |パーティクルサイズ|ラメの粒子のサイズです。| |コントラスト|ラメのコントラストです。| @@ -319,6 +346,7 @@ FakeShadowを使用する場合は以下のようにステンシル設定を変 |指向性|ライト方向に応じて明るさを変化させる度合いです。| |視線方向の影響度|視線方向によって光の範囲を変化させます。| |影を受け取る|他オブジェクトから影を受け取ります。| +|裏面で無効化|裏面で逆光ライトを消すようになります。| ### 宝石 |名前|説明| diff --git a/Assets/lilToon/README.md b/Assets/lilToon/README.md index 297cc0e6..95c8701c 100644 --- a/Assets/lilToon/README.md +++ b/Assets/lilToon/README.md @@ -1,5 +1,5 @@ # lilToon -Version 1.2.2 +Version 1.2.3 # Overview This shader is developed for services using avatars (VRChat, etc.) and has the following features. diff --git a/Assets/lilToon/README_JP.md b/Assets/lilToon/README_JP.md index af335618..04771379 100644 --- a/Assets/lilToon/README_JP.md +++ b/Assets/lilToon/README_JP.md @@ -1,5 +1,5 @@ # lilToon -Version 1.2.2 +Version 1.2.3 # 概要 アバターを用いたサービス(VRChat等)向けに開発したシェーダーで以下のような特徴があります。 diff --git a/Assets/lilToon/ScriptTemplates/99-lilToon__Custom Pass Shader-custom_ltsmulti.shader.txt b/Assets/lilToon/ScriptTemplates/99-lilToon__Custom Pass Shader-custom_ltsmulti.shader.txt index 05c25ee3..43cfc8cd 100644 --- a/Assets/lilToon/ScriptTemplates/99-lilToon__Custom Pass Shader-custom_ltsmulti.shader.txt +++ b/Assets/lilToon/ScriptTemplates/99-lilToon__Custom Pass Shader-custom_ltsmulti.shader.txt @@ -2,6 +2,10 @@ Shader "#NAME#" { + // Memo + // If you are using Unity 2018 or earlier, you need to replace `shader_feature_local` with` shader_feature`. + // If there are too many variants, you should also replace them with #define. + Properties { //---------------------------------------------------------------------------------------------------------------------- @@ -56,7 +60,7 @@ Shader "#NAME#" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -83,7 +87,7 @@ Shader "#NAME#" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -104,6 +108,27 @@ Shader "#NAME#" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -114,6 +139,7 @@ Shader "#NAME#" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -149,9 +175,10 @@ Shader "#NAME#" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -159,15 +186,18 @@ Shader "#NAME#" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -176,15 +206,18 @@ Shader "#NAME#" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -199,6 +232,7 @@ Shader "#NAME#" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -218,6 +252,7 @@ Shader "#NAME#" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -301,7 +336,7 @@ Shader "#NAME#" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -414,6 +449,12 @@ Shader "#NAME#" [lilToggle] _UsePOM ("Use POM", Int) = 0 [lilToggle] _UseClippingCanceller ("Use Clipping Canceller", Int) = 0 [lilToggle] _AsOverlay ("As Overlay", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } HLSLINCLUDE diff --git a/Assets/lilToon/Shader/Includes/lil_common.hlsl b/Assets/lilToon/Shader/Includes/lil_common.hlsl index 4b9ebfca..fc7cb169 100644 --- a/Assets/lilToon/Shader/Includes/lil_common.hlsl +++ b/Assets/lilToon/Shader/Includes/lil_common.hlsl @@ -14,6 +14,7 @@ #define _UseBacklight true #define _UseBumpMap true #define _UseBump2ndMap true + #define _UseAnisotropy true #define _UseReflection true #define _UseMatCap true #define _UseMatCap2nd true diff --git a/Assets/lilToon/Shader/Includes/lil_common_frag.hlsl b/Assets/lilToon/Shader/Includes/lil_common_frag.hlsl index 8c6f845c..a7fe9bca 100644 --- a/Assets/lilToon/Shader/Includes/lil_common_frag.hlsl +++ b/Assets/lilToon/Shader/Includes/lil_common_frag.hlsl @@ -42,6 +42,10 @@ #define BEFORE_NORMAL_2ND #endif +#if !defined(BEFORE_ANISOTROPY) + #define BEFORE_ANISOTROPY +#endif + #if !defined(BEFORE_AUDIOLINK) #define BEFORE_AUDIOLINK #endif @@ -264,8 +268,8 @@ float furAlpha = 1.0; \ float furLayer = abs(input.furLayer); \ if(Exists_FurNoiseMask) furAlpha = LIL_SAMPLE_2D_ST(_FurNoiseMask, sampler_MainTex, input.uv).r; \ - if(Exists_FurMask) furAlpha *= LIL_SAMPLE_2D(_FurMask, sampler_MainTex, uvMain).r; \ LIL_FUR_LAYER_ALPHA \ + if(Exists_FurMask) furAlpha *= LIL_SAMPLE_2D(_FurMask, sampler_MainTex, uvMain).r; \ col.a *= furAlpha; \ LIL_FUR_LAYER_AO #endif @@ -342,6 +346,27 @@ } #endif +//------------------------------------------------------------------------------------------------------------------------------ +// Anisotropy +#if !defined(OVERRIDE_ANISOTROPY) + #define OVERRIDE_ANISOTROPY \ + LIL_BRANCH \ + if(_UseAnisotropy) \ + { \ + float4 anisoTangentMap = LIL_SAMPLE_2D_ST(_AnisotropyTangentMap, sampler_MainTex, uvMain); \ + float3 anisoTangent = UnpackNormalScale(anisoTangentMap, 1.0); \ + anisoTangentWS = lilOrthoNormalize(normalize(mul(anisoTangent, tbnWS)), normalDirection); \ + anisoBitangentWS = cross(normalDirection, anisoTangentWS); \ + anisotropy = _AnisotropyScale; \ + anisotropy *= LIL_SAMPLE_2D(_AnisotropyScaleMask, sampler_MainTex, uvMain).r; \ + float3 anisoNormalWS = lilGetAnisotropyNormalWS(normalDirection, anisoTangentWS, anisoBitangentWS, viewDirection, anisotropy); \ + if(_Anisotropy2Reflection) reflectionNormalDirection = anisoNormalWS; \ + if(_Anisotropy2MatCap) matcapNormalDirection = anisoNormalWS; \ + if(_Anisotropy2MatCap2nd) matcap2ndNormalDirection = anisoNormalWS; \ + if(_Anisotropy2Reflection) perceptualRoughness = saturate(1.2 - abs(anisotropy)); \ + } +#endif + //------------------------------------------------------------------------------------------------------------------------------ // AudioLink #if !defined(OVERRIDE_AUDIOLINK) @@ -682,7 +707,7 @@ void lilGetShading( //------------------------------------------------------------------------------------------------------------------------------ // Backlight #if defined(LIL_FEATURE_BACKLIGHT) && !defined(LIL_LITE) && !defined(LIL_FUR) && !defined(LIL_GEM) - void lilBacklight(inout float4 col, float2 uvMain, float hl, float3 lightColor, float3 lightDirection, float3 lightDirectionCopy, float attenuation, float3 headDirection, float3 normalDirection LIL_SAMP_IN_FUNC(samp)) + void lilBacklight(inout float4 col, float2 uvMain, float facing, float hl, float3 lightColor, float3 lightDirection, float3 lightDirectionCopy, float attenuation, float3 headDirection, float3 normalDirection LIL_SAMP_IN_FUNC(samp)) { if(_UseBacklight) { @@ -694,13 +719,14 @@ void lilGetShading( #endif backlightLN = lilTooning(backlightLN, _BacklightBorder, _BacklightBlur); float backlight = backlightFactor * backlightLN; + backlight = facing < (_BacklightBackfaceMask-1.0) ? 0.0 : backlight; col.rgb += backlight * backlightColor * lightColor; } } #endif #if !defined(OVERRIDE_BACKLIGHT) - #define OVERRIDE_BACKLIGHT lilBacklight(col, uvMain, hl, lightColor, lightDirection, LIL_LIGHTDIRECTION_ORIG, attenuation, headDirection, normalDirection LIL_SAMP_IN(sampler_MainTex)); + #define OVERRIDE_BACKLIGHT lilBacklight(col, uvMain, facing, hl, lightColor, lightDirection, LIL_LIGHTDIRECTION_ORIG, attenuation, headDirection, normalDirection LIL_SAMP_IN(sampler_MainTex)); #endif //------------------------------------------------------------------------------------------------------------------------------ @@ -760,27 +786,23 @@ void lilGetShading( #define LIL_HDRP_VAL_INPUT_FUNC #endif #if defined(LIL_FEATURE_REFLECTION) && defined(LIL_PASS_FORWARD_NORMAL_INCLUDED) && !defined(LIL_LITE) && !defined(LIL_FUR) - #if !defined(LIL_REFRACTION_BLUR2) || defined(LIL_PASS_FORWARDADD) - void lilReflection(inout float4 col, float2 uvMain, float3 albedo, float3 positionWS, float3 normalDirection, float3 viewDirection, float nv, float3 lightColor, float3 lightDirection, float shadowmix, float attenuation, float nvabs LIL_SAMP_IN_FUNC(samp) LIL_HDRP_VAL_INPUT_FUNC) - #else - void lilReflection(inout float4 col, float2 uvMain, float3 albedo, float3 positionWS, float3 normalDirection, float3 viewDirection, float nv, float3 lightColor, float3 lightDirection, float shadowmix, float attenuation, float nvabs, float smoothness, float perceptualRoughness, float roughness LIL_SAMP_IN_FUNC(samp) LIL_HDRP_VAL_INPUT_FUNC) - #endif + void lilReflection(inout float4 col, float2 uvMain, float3 albedo, float3 positionWS, float3 normalDirection, float3 reflectionNormalDirection, float3 anisoTangentWS, float3 anisoBitangentWS, float3 viewDirection, float nv, float3 lightColor, float3 lightDirection, float shadowmix, float attenuation, float nvabs, float smoothness, float perceptualRoughness, float roughness, float anisotropy LIL_SAMP_IN_FUNC(samp) LIL_HDRP_VAL_INPUT_FUNC) { - #ifndef LIL_PASS_FORWARDADD + #if defined(LIL_PASS_FORWARDADD) LIL_BRANCH - if(_UseReflection) + if(_UseReflection && _ApplySpecular && _ApplySpecularFA) #else LIL_BRANCH - if(_UseReflection && _ApplySpecular) + if(_UseReflection) #endif { float3 reflectCol = 0; // Smoothness #if !defined(LIL_REFRACTION_BLUR2) || defined(LIL_PASS_FORWARDADD) - float smoothness = _Smoothness; + smoothness = _Smoothness; if(Exists_SmoothnessTex) smoothness *= LIL_SAMPLE_2D(_SmoothnessTex, samp, uvMain).r; - float perceptualRoughness = 1.0 - smoothness; - float roughness = perceptualRoughness * perceptualRoughness; + perceptualRoughness = perceptualRoughness - smoothness * perceptualRoughness; + roughness = perceptualRoughness * perceptualRoughness; #endif // Metallic float metallic = _Metallic; @@ -788,7 +810,7 @@ void lilGetShading( col.rgb = col.rgb - metallic * col.rgb; float3 specular = lerp(_Reflectance, albedo, metallic); // Specular - #ifndef LIL_PASS_FORWARDADD + #if !defined(LIL_PASS_FORWARDADD) LIL_BRANCH if(_ApplySpecular) #endif @@ -800,24 +822,36 @@ void lilGetShading( float3 lightDirectionSpc = lilGetLightDirection(positionWS); float3 lightColorSpc = LIL_MAINLIGHT_COLOR; #endif - float3 halfDirection = normalize(viewDirection + lightDirectionSpc); - float nl = saturate(dot(normalDirection, lightDirectionSpc)); - float nh = saturate(dot(normalDirection, halfDirection)); - float lh = saturate(dot(lightDirectionSpc, halfDirection)); + #if defined(LIL_FEATURE_ANISOTROPY) + bool isAnisotropy = _UseAnisotropy && _Anisotropy2Reflection; + float anisotropyShiftNoise = LIL_SAMPLE_2D_ST(_AnisotropyShiftNoiseMask, samp, uvMain).r - 0.5; + float anisotropyShift = anisotropyShiftNoise * _AnisotropyShiftNoiseScale + _AnisotropyShift; + float anisotropy2ndShift = anisotropyShiftNoise * _Anisotropy2ndShiftNoiseScale + _Anisotropy2ndShift; + #else + bool isAnisotropy = false; + float _AnisotropyTangentWidth = 1.0; + float _AnisotropyBitangentWidth = 1.0; + float _AnisotropySpecularStrength = 1.0; + float _Anisotropy2ndTangentWidth = 1.0; + float _Anisotropy2ndBitangentWidth = 1.0; + float _Anisotropy2ndSpecularStrength = 0.0; + float anisotropyShift = 0.0; + float anisotropy2ndShift = 0.0; + #endif #if defined(LIL_PASS_FORWARDADD) - reflectCol = lilCalcSpecular(nv, nl, nh, lh, roughness, specular, _SpecularToon, attenuation) * lightColorSpc; + reflectCol = lilCalcSpecular(normalDirection, anisoTangentWS, anisoBitangentWS, lightDirectionSpc, viewDirection, roughness, specular, anisotropy, _AnisotropyTangentWidth, _AnisotropyBitangentWidth, _Anisotropy2ndTangentWidth, _Anisotropy2ndBitangentWidth, _AnisotropySpecularStrength, _Anisotropy2ndSpecularStrength, anisotropyShift, anisotropy2ndShift, _SpecularToon, attenuation, isAnisotropy) * lightColorSpc; #elif defined(SHADOWS_SCREEN) - reflectCol = lilCalcSpecular(nv, nl, nh, lh, roughness, specular, _SpecularToon, shadowmix) * lightColorSpc; + reflectCol = lilCalcSpecular(normalDirection, anisoTangentWS, anisoBitangentWS, lightDirectionSpc, viewDirection, roughness, specular, anisotropy, _AnisotropyTangentWidth, _AnisotropyBitangentWidth, _Anisotropy2ndTangentWidth, _Anisotropy2ndBitangentWidth, _AnisotropySpecularStrength, _Anisotropy2ndSpecularStrength, anisotropyShift, anisotropy2ndShift, _SpecularToon, shadowmix, isAnisotropy) * lightColorSpc; #else - reflectCol = lilCalcSpecular(nv, nl, nh, lh, roughness, specular, _SpecularToon) * lightColorSpc; + reflectCol = lilCalcSpecular(normalDirection, anisoTangentWS, anisoBitangentWS, lightDirectionSpc, viewDirection, roughness, specular, anisotropy, _AnisotropyTangentWidth, _AnisotropyBitangentWidth, _Anisotropy2ndTangentWidth, _Anisotropy2ndBitangentWidth, _AnisotropySpecularStrength, _Anisotropy2ndSpecularStrength, anisotropyShift, anisotropy2ndShift, _SpecularToon, 1.0, isAnisotropy) * lightColorSpc; #endif } // Reflection - #ifndef LIL_PASS_FORWARDADD + #if !defined(LIL_PASS_FORWARDADD) LIL_BRANCH if(_ApplyReflection) { - float3 envReflectionColor = LIL_GET_ENVIRONMENT_REFLECTION(viewDirection, normalDirection, perceptualRoughness, positionWS); + float3 envReflectionColor = LIL_GET_ENVIRONMENT_REFLECTION(viewDirection, reflectionNormalDirection, perceptualRoughness, positionWS); float oneMinusReflectivity = LIL_DIELECTRIC_SPECULAR.a - metallic * LIL_DIELECTRIC_SPECULAR.a; float grazingTerm = saturate(smoothness + (1.0-oneMinusReflectivity)); @@ -848,22 +882,17 @@ void lilGetShading( #endif #if !defined(OVERRIDE_REFLECTION) - #if !defined(LIL_REFRACTION_BLUR2) || defined(LIL_PASS_FORWARDADD) - #define OVERRIDE_REFLECTION \ - lilReflection(col, uvMain, albedo, input.positionWS, normalDirection, viewDirection, nv, lightColor, lightDirection, shadowmix, attenuation, nvabs LIL_SAMP_IN(sampler_MainTex) LIL_HDRP_VAL_INPUT); - #else - #define OVERRIDE_REFLECTION \ - lilReflection(col, uvMain, albedo, input.positionWS, normalDirection, viewDirection, nv, lightColor, lightDirection, shadowmix, attenuation, nvabs, smoothness, perceptualRoughness, roughness LIL_SAMP_IN(sampler_MainTex) LIL_HDRP_VAL_INPUT); - #endif + #define OVERRIDE_REFLECTION \ + lilReflection(col, uvMain, albedo, input.positionWS, normalDirection, reflectionNormalDirection, anisoTangentWS, anisoBitangentWS, viewDirection, nv, lightColor, lightDirection, shadowmix, attenuation, nvabs, smoothness, perceptualRoughness, roughness, anisotropy LIL_SAMP_IN(sampler_MainTex) LIL_HDRP_VAL_INPUT); #endif //------------------------------------------------------------------------------------------------------------------------------ // MatCap #if defined(LIL_FEATURE_MATCAP) && !defined(LIL_LITE) && !defined(LIL_FUR) #if defined(LIL_FEATURE_TEX_MATCAP_NORMALMAP) - void lilGetMatCap(inout float4 col, float2 uvMain, float shadowmix, float3 lightColor, float3 normalDirection, float3 viewDirection, float3 headDirection, float3x3 tbnWS, float facing LIL_SAMP_IN_FUNC(samp)) + void lilGetMatCap(inout float4 col, float2 uvMain, float2 uv1, float facing, float shadowmix, float3 lightColor, float3 normalDirection, float3 viewDirection, float3 headDirection, float3x3 tbnWS LIL_SAMP_IN_FUNC(samp)) #else - void lilGetMatCap(inout float4 col, float2 uvMain, float shadowmix, float3 lightColor, float3 normalDirection, float3 viewDirection, float3 headDirection LIL_SAMP_IN_FUNC(samp)) + void lilGetMatCap(inout float4 col, float2 uvMain, float2 uv1, float facing, float shadowmix, float3 lightColor, float3 normalDirection, float3 viewDirection, float3 headDirection LIL_SAMP_IN_FUNC(samp)) #endif { LIL_BRANCH @@ -881,10 +910,10 @@ void lilGetShading( matcapNormalDirection = facing < (_FlipNormal-1.0) ? -matcapNormalDirection : matcapNormalDirection; } #endif - matUV = lilCalcMatCapUV(matcapNormalDirection, viewDirection, headDirection, _MatCapVRParallaxStrength, _MatCapZRotCancel); + matUV = lilCalcMatCapUV(uv1, matcapNormalDirection, viewDirection, headDirection, _MatCapTex_ST, _MatCapBlendUV1.xy, _MatCapZRotCancel, _MatCapPerspective, _MatCapVRParallaxStrength); float4 matCapColor = _MatCapColor; if(Exists_MatCapTex) matCapColor *= LIL_SAMPLE_2D(_MatCapTex, samp, matUV); - #ifndef LIL_PASS_FORWARDADD + #if !defined(LIL_PASS_FORWARDADD) matCapColor.rgb = lerp(matCapColor.rgb, matCapColor.rgb * lightColor, _MatCapEnableLighting); matCapColor.a = lerp(matCapColor.a, matCapColor.a * shadowmix, _MatCapShadowMask); #else @@ -893,6 +922,7 @@ void lilGetShading( #if LIL_RENDER == 2 && !defined(LIL_REFRACTION) if(_MatCapApplyTransparency) matCapColor.a *= col.a; #endif + matCapColor.a = facing < (_MatCapBackfaceMask-1.0) ? 0.0 : matCapColor.a; if(Exists_MatCapBlendMask) matCapColor.a *= LIL_SAMPLE_2D(_MatCapBlendMask, samp, uvMain).r; col.rgb = lilBlendColor(col.rgb, matCapColor.rgb, _MatCapBlend * matCapColor.a, _MatCapBlendMode); } @@ -915,10 +945,10 @@ void lilGetShading( lilGetMatCap(col, uvMain, lightColor, input.uvMat, triMask LIL_SAMP_IN(sampler_MainTex)); #elif defined(LIL_FEATURE_TEX_MATCAP_NORMALMAP) #define OVERRIDE_MATCAP \ - lilGetMatCap(col, uvMain, shadowmix, lightColor, normalDirection, viewDirection, headDirection, tbnWS, facing LIL_SAMP_IN(sampler_MainTex)); + lilGetMatCap(col, uvMain, input.uv1, facing, shadowmix, lightColor, matcapNormalDirection, viewDirection, headDirection, tbnWS LIL_SAMP_IN(sampler_MainTex)); #else #define OVERRIDE_MATCAP \ - lilGetMatCap(col, uvMain, shadowmix, lightColor, normalDirection, viewDirection, headDirection LIL_SAMP_IN(sampler_MainTex)); + lilGetMatCap(col, uvMain, input.uv1, facing, shadowmix, lightColor, matcapNormalDirection, viewDirection, headDirection LIL_SAMP_IN(sampler_MainTex)); #endif #endif @@ -926,9 +956,9 @@ void lilGetShading( // MatCap 2nd #if defined(LIL_FEATURE_MATCAP_2ND) && !defined(LIL_LITE) && !defined(LIL_FUR) #if defined(LIL_FEATURE_TEX_MATCAP_NORMALMAP) - void lilGetMatCap2nd(inout float4 col, float2 uvMain, float shadowmix, float3 lightColor, float3 normalDirection, float3 viewDirection, float3 headDirection, float3x3 tbnWS, float facing LIL_SAMP_IN_FUNC(samp)) + void lilGetMatCap2nd(inout float4 col, float2 uvMain, float2 uv1, float facing, float shadowmix, float3 lightColor, float3 normalDirection, float3 viewDirection, float3 headDirection, float3x3 tbnWS LIL_SAMP_IN_FUNC(samp)) #else - void lilGetMatCap2nd(inout float4 col, float2 uvMain, float shadowmix, float3 lightColor, float3 normalDirection, float3 viewDirection, float3 headDirection LIL_SAMP_IN_FUNC(samp)) + void lilGetMatCap2nd(inout float4 col, float2 uvMain, float2 uv1, float facing, float shadowmix, float3 lightColor, float3 normalDirection, float3 viewDirection, float3 headDirection LIL_SAMP_IN_FUNC(samp)) #endif { LIL_BRANCH @@ -946,10 +976,10 @@ void lilGetShading( matcap2ndNormalDirection = facing < (_FlipNormal-1.0) ? -matcap2ndNormalDirection : matcap2ndNormalDirection; } #endif - mat2ndUV = lilCalcMatCapUV(matcap2ndNormalDirection, viewDirection, headDirection, _MatCap2ndVRParallaxStrength, _MatCap2ndZRotCancel); + mat2ndUV = lilCalcMatCapUV(uv1, matcap2ndNormalDirection, viewDirection, headDirection, _MatCap2ndTex_ST, _MatCap2ndBlendUV1.xy, _MatCap2ndZRotCancel, _MatCap2ndPerspective, _MatCap2ndVRParallaxStrength); float4 matCap2ndColor = _MatCap2ndColor; if(Exists_MatCapTex) matCap2ndColor *= LIL_SAMPLE_2D(_MatCap2ndTex, samp, mat2ndUV); - #ifndef LIL_PASS_FORWARDADD + #if !defined(LIL_PASS_FORWARDADD) matCap2ndColor.rgb = lerp(matCap2ndColor.rgb, matCap2ndColor.rgb * lightColor, _MatCap2ndEnableLighting); matCap2ndColor.a = lerp(matCap2ndColor.a, matCap2ndColor.a * shadowmix, _MatCap2ndShadowMask); #else @@ -958,6 +988,7 @@ void lilGetShading( #if LIL_RENDER == 2 && !defined(LIL_REFRACTION) if(_MatCap2ndApplyTransparency) matCap2ndColor.a *= col.a; #endif + matCap2ndColor.a = facing < (_MatCap2ndBackfaceMask-1.0) ? 0.0 : matCap2ndColor.a; if(Exists_MatCap2ndBlendMask) matCap2ndColor.a *= LIL_SAMPLE_2D(_MatCap2ndBlendMask, samp, uvMain).r; col.rgb = lilBlendColor(col.rgb, matCap2ndColor.rgb, _MatCap2ndBlend * matCap2ndColor.a, _MatCap2ndBlendMode); } @@ -967,19 +998,19 @@ void lilGetShading( #if !defined(OVERRIDE_MATCAP_2ND) #if defined(LIL_FEATURE_TEX_MATCAP_NORMALMAP) #define OVERRIDE_MATCAP_2ND \ - lilGetMatCap2nd(col, uvMain, shadowmix, lightColor, normalDirection, viewDirection, headDirection, tbnWS, facing LIL_SAMP_IN(sampler_MainTex)); + lilGetMatCap2nd(col, uvMain, input.uv1, facing, shadowmix, lightColor, matcap2ndNormalDirection, viewDirection, headDirection, tbnWS LIL_SAMP_IN(sampler_MainTex)); #else #define OVERRIDE_MATCAP_2ND \ - lilGetMatCap2nd(col, uvMain, shadowmix, lightColor, normalDirection, viewDirection, headDirection LIL_SAMP_IN(sampler_MainTex)); + lilGetMatCap2nd(col, uvMain, input.uv1, facing, shadowmix, lightColor, matcap2ndNormalDirection, viewDirection, headDirection LIL_SAMP_IN(sampler_MainTex)); #endif #endif //------------------------------------------------------------------------------------------------------------------------------ // Rim Light #if defined(LIL_FEATURE_RIMLIGHT) && !defined(LIL_LITE) && !defined(LIL_FUR) - void lilGetRim(inout float4 col, float2 uvMain, float shadowmix, float nvabs, float3 lightColor, float3 normalDirection, float3 lightDirection LIL_SAMP_IN_FUNC(samp)) + void lilGetRim(inout float4 col, float2 uvMain, float facing, float shadowmix, float nvabs, float3 lightColor, float3 normalDirection, float3 lightDirection LIL_SAMP_IN_FUNC(samp)) { - #ifndef LIL_PASS_FORWARDADD + #if !defined(LIL_PASS_FORWARDADD) LIL_BRANCH if(_UseRim) #else @@ -1001,12 +1032,13 @@ void lilGetShading( float lnDir = saturate((lnRaw + _RimDirRange) / (1.0 + _RimDirRange)); float lnIndir = saturate((1.0-lnRaw + _RimIndirRange) / (1.0 + _RimIndirRange)); float rim = pow(saturate(1.0 - nvabs), _RimFresnelPower); + rim = facing < (_RimBackfaceMask-1.0) ? 0.0 : rim; float rimDir = lerp(rim, rim*lnDir, _RimDirStrength); float rimIndir = rim * lnIndir * _RimDirStrength; rimDir = lilTooning(rimDir, _RimBorder, _RimBlur); rimIndir = lilTooning(rimIndir, _RimIndirBorder, _RimIndirBlur); - #ifndef LIL_PASS_FORWARDADD + #if !defined(LIL_PASS_FORWARDADD) rimDir = lerp(rimDir, rimDir * shadowmix, _RimShadowMask); rimIndir = lerp(rimIndir, rimIndir * shadowmix, _RimShadowMask); #endif @@ -1018,7 +1050,7 @@ void lilGetShading( } #endif float3 rimSum = rimDir * rimColor.a * rimColor.rgb + rimIndir * rimIndirColor.a * rimIndirColor.rgb; - #ifndef LIL_PASS_FORWARDADD + #if !defined(LIL_PASS_FORWARDADD) rimSum = lerp(rimSum, rimSum * lightColor, _RimEnableLighting); col.rgb += rimSum; #else @@ -1028,11 +1060,12 @@ void lilGetShading( float4 rimColor = _RimColor; if(Exists_RimColorTex) rimColor *= LIL_SAMPLE_2D(_RimColorTex, samp, uvMain); float rim = pow(saturate(1.0 - nvabs), _RimFresnelPower); + rim = facing < (_RimBackfaceMask-1.0) ? 0.0 : rim; rim = lilTooning(rim, _RimBorder, _RimBlur); #if LIL_RENDER == 2 && !defined(LIL_REFRACTION) if(_RimApplyTransparency) rim *= col.a; #endif - #ifndef LIL_PASS_FORWARDADD + #if !defined(LIL_PASS_FORWARDADD) rim = lerp(rim, rim * shadowmix, _RimShadowMask); rimColor.rgb = lerp(rimColor.rgb, rimColor.rgb * lightColor, _RimEnableLighting); col.rgb += rim * rimColor.a * rimColor.rgb; @@ -1050,7 +1083,7 @@ void lilGetShading( { float rim = pow(saturate(1.0 - nvabs), _RimFresnelPower); rim = lilTooning(rim, _RimBorder, _RimBlur); - #ifndef LIL_PASS_FORWARDADD + #if !defined(LIL_PASS_FORWARDADD) rim = lerp(rim, rim * shadowmix, _RimShadowMask); #endif col.rgb += rim * triMask.g * _RimColor.rgb * lightColor; @@ -1064,14 +1097,14 @@ void lilGetShading( lilGetRim(col, shadowmix, nvabs, lightColor, triMask); #else #define OVERRIDE_RIMLIGHT \ - lilGetRim(col, uvMain, shadowmix, nvabs, lightColor, normalDirection, lightDirection LIL_SAMP_IN(sampler_MainTex)); + lilGetRim(col, uvMain, facing, shadowmix, nvabs, lightColor, normalDirection, lightDirection LIL_SAMP_IN(sampler_MainTex)); #endif #endif //------------------------------------------------------------------------------------------------------------------------------ // Glitter #if defined(LIL_FEATURE_GLITTER) && !defined(LIL_LITE) && !defined(LIL_FUR) - void lilGlitter(inout float4 col, float3 albedo, float2 uvMain, float2 uv, float2 uv1, float3 viewDirection, float3 headDirection, float3 lightColor, float3 normalDirection, float3 lightDirection, float shadowmix LIL_SAMP_IN_FUNC(samp)) + void lilGlitter(inout float4 col, float3 albedo, float facing, float2 uvMain, float2 uv, float2 uv1, float3 viewDirection, float3 headDirection, float3 lightColor, float3 normalDirection, float3 lightDirection, float shadowmix LIL_SAMP_IN_FUNC(samp)) { LIL_BRANCH if(_UseGlitter) @@ -1089,7 +1122,8 @@ void lilGetShading( #if LIL_RENDER == 2 && !defined(LIL_REFRACTION) if(_GlitterApplyTransparency) glitterColor.a *= col.a; #endif - #ifndef LIL_PASS_FORWARDADD + glitterColor.a = facing < (_GlitterBackfaceMask-1.0) ? 0.0 : glitterColor.a; + #if !defined(LIL_PASS_FORWARDADD) glitterColor.a = lerp(glitterColor.a, glitterColor.a * shadowmix, _GlitterShadowMask); glitterColor.rgb = lerp(glitterColor.rgb, glitterColor.rgb * lightColor, _GlitterEnableLighting); col.rgb += glitterColor.rgb * glitterColor.a; @@ -1102,7 +1136,7 @@ void lilGetShading( #if !defined(OVERRIDE_GLITTER) #define OVERRIDE_GLITTER \ - lilGlitter(col, albedo, uvMain, input.uv, input.uv1, viewDirection, headDirection, lightColor, normalDirection, lightDirection, shadowmix LIL_SAMP_IN(sampler_MainTex)); + lilGlitter(col, albedo, facing, uvMain, input.uv, input.uv1, viewDirection, headDirection, lightColor, normalDirection, lightDirection, shadowmix LIL_SAMP_IN(sampler_MainTex)); #endif @@ -1232,10 +1266,10 @@ void lilGetShading( //------------------------------------------------------------------------------------------------------------------------------ // Distance Fade #if defined(LIL_FEATURE_DISTANCE_FADE) && !defined(LIL_LITE) - void lilDistanceFade(inout float4 col, float3 positionWS) + void lilDistanceFade(inout float4 col, float3 positionWS, float depth, float facing) { - float depthFade = length(lilViewDirection(positionWS)); - float distFade = saturate((depthFade - _DistanceFade.x) / (_DistanceFade.y - _DistanceFade.x)) * _DistanceFade.z; + float distFade = saturate((depth - _DistanceFade.x) / (_DistanceFade.y - _DistanceFade.x)); + distFade = facing < (_DistanceFade.w-1.0) ? _DistanceFade.z : distFade * _DistanceFade.z; #if defined(LIL_PASS_FORWARDADD) col.rgb = lerp(col.rgb, 0.0, distFade); #elif LIL_RENDER == 2 @@ -1249,7 +1283,7 @@ void lilGetShading( #if !defined(OVERRIDE_DISTANCE_FADE) #define OVERRIDE_DISTANCE_FADE \ - lilDistanceFade(col, input.positionWS); + lilDistanceFade(col, input.positionWS, depth, facing); #endif //------------------------------------------------------------------------------------------------------------------------------ diff --git a/Assets/lilToon/Shader/Includes/lil_common_functions.hlsl b/Assets/lilToon/Shader/Includes/lil_common_functions.hlsl index cbc1380a..79d05739 100644 --- a/Assets/lilToon/Shader/Includes/lil_common_functions.hlsl +++ b/Assets/lilToon/Shader/Includes/lil_common_functions.hlsl @@ -144,6 +144,11 @@ float lilNsqDistance(float2 a, float2 b) return dot(a-b,a-b); } +float3 lilOrthoNormalize(float3 tangent, float3 normal) +{ + return normalize(tangent - normal * dot(normal, tangent)); +} + //------------------------------------------------------------------------------------------------------------------------------ // Position Transform struct lilVertexPositionInputs @@ -416,7 +421,7 @@ float2 lilCalcAtlasAnimation(float2 uv, float4 decalAnimation, float4 decalSubPa return outuv; } -float2 lilCalcMatCapUV(float3 normalWS, float3 viewDirection, float3 headDirection, float matcapVRParallaxStrength, bool zRotCancel = true) +float2 lilCalcMatCapUV(float2 uv1, float3 normalWS, float3 viewDirection, float3 headDirection, float4 matcap_ST, float2 matcapBlendUV1, bool zRotCancel, bool matcapPerspective, float matcapVRParallaxStrength) { #if LIL_MATCAP_MODE == 0 // Simple @@ -427,11 +432,16 @@ float2 lilCalcMatCapUV(float3 normalWS, float3 viewDirection, float3 headDirecti #else float3 normalVD = viewDirection; #endif + normalVD = matcapPerspective ? normalVD : LIL_MATRIX_V._m20_m21_m22; float3 bitangentVD = zRotCancel ? float3(0,1,0) : LIL_MATRIX_V._m10_m11_m12; - bitangentVD = normalize(bitangentVD - normalVD * dot(normalVD, bitangentVD)); + bitangentVD = lilOrthoNormalize(bitangentVD, normalVD); float3 tangentVD = cross(normalVD, bitangentVD); float3x3 tbnVD = float3x3(tangentVD, bitangentVD, normalVD); - return mul(tbnVD, normalWS).xy * 0.5 + 0.5; + float2 uvMat = mul(tbnVD, normalWS).xy; + uvMat = lerp(uvMat, uv1*2-1, matcapBlendUV1); + uvMat = uvMat * matcap_ST.xy + matcap_ST.zw; + uvMat = uvMat * 0.5 + 0.5; + return uvMat; #endif } @@ -970,50 +980,85 @@ float3 lilFresnelLerp(float3 F0, float3 F90, float cosA) return lerp(F0, F90, a * a * a * a * a); } -float3 lilCalcSpecular(float nv, float nl, float nh, float lh, float roughness, float3 specular, bool isSpecularToon, float attenuation = 1.0) +float3 lilCalcSpecular(float3 N, float3 T, float3 B, float3 L, float3 V, float roughness, float3 specular, float anisotropy, float anisoTangentWidth, float anisoBitangentWidth, float aniso2ndTangentWidth, float aniso2ndBitangentWidth, float anisoSpecularStrength, float aniso2ndSpecularStrength, float anisoShift, float aniso2ndShift, bool isSpecularToon, float attenuation, bool isAnisotropy) { - #if LIL_SPECULAR_MODE == 0 - // BRP Specular - float roughness2 = max(roughness, 0.002); + float3 H = normalize(V + L); + float nv = saturate(dot(N, V)); + float nl = saturate(dot(N, L)); + float lh = saturate(dot(L, H)); + float nh = saturate(dot(N, H)); - float lambdaV = nl * (nv * (1.0 - roughness2) + roughness2); - float lambdaL = nv * (nl * (1.0 - roughness2) + roughness2); - #if defined(SHADER_API_SWITCH) - float sjggx = 0.5 / (lambdaV + lambdaL + 1e-4f); - #else - float sjggx = 0.5 / (lambdaV + lambdaL + 1e-5f); - #endif + // BRP Specular + float ggx, sjggx = 0.0; + float lambdaV = 0.0; + float lambdaL = 0.0; + float vh = dot(V,H); + float d = 1.0; + if(isAnisotropy) + { + float roughnessT = max(roughness * (1.0 + anisotropy), 0.002); + float roughnessB = max(roughness * (1.0 - anisotropy), 0.002); + + float tv = dot(T, V); + float bv = dot(B, V); + float tl = dot(T, L); + float bl = dot(B, L); + + lambdaV = nl * length(float3(roughnessT * tv, roughnessB * bv, nv)); + lambdaL = nv * length(float3(roughnessT * tl, roughnessB * bl, nl)); + + float roughnessT1 = roughnessT * anisoTangentWidth; + float roughnessB1 = roughnessB * anisoBitangentWidth; + float roughnessT2 = roughnessT * aniso2ndTangentWidth; + float roughnessB2 = roughnessB * aniso2ndBitangentWidth; + float3 T1 = normalize(T - N * anisoShift); + float3 B1 = normalize(B - N * anisoShift); + float3 T2 = normalize(T - N * aniso2ndShift); + float3 B2 = normalize(B - N * aniso2ndShift); + float th1 = dot(T1, H); + float bh1 = dot(B1, H); + float th2 = dot(T2, H); + float bh2 = dot(B2, H); + + float r1 = roughnessT1 * roughnessB1; + float r2 = roughnessT2 * roughnessB2; + float3 v1 = float3(th1 * roughnessB1, bh1 * roughnessT1, nh * r1); + float3 v2 = float3(th2 * roughnessB2, bh2 * roughnessT2, nh * r2); + float w1 = r1 / dot(v1, v1); + float w2 = r2 / dot(v2, v2); + ggx = r1 * w1 * w1 * anisoSpecularStrength + r2 * w2 * w2 * aniso2ndSpecularStrength; + } + else + { + float roughness2 = max(roughness, 0.002); + lambdaV = nl * (nv * (1.0 - roughness2) + roughness2); + lambdaL = nv * (nl * (1.0 - roughness2) + roughness2); float r2 = roughness2 * roughness2; - float d = (nh * r2 - nh) * nh + 1.0; - float ggx = r2 / (d * d + 1e-7f); + d = (nh * r2 - nh) * nh + 1.0; + ggx = r2 / (d * d + 1e-7f); + } - //float specularTerm = SmithJointGGXVisibilityTerm(nl,nv,roughness2) * GGXTerm(nh,roughness2) * LIL_PI; - float specularTerm = sjggx * ggx; - #ifdef LIL_COLORSPACE_GAMMA - specularTerm = sqrt(max(1e-4h, specularTerm)); - #endif - specularTerm *= nl * attenuation; - if(isSpecularToon) return lilTooning(specularTerm, 0.5); - else return specularTerm * lilFresnelTerm(specular, lh); - #elif LIL_SPECULAR_MODE == 1 - // URP Specular - float roughness2 = max(roughness, 0.002); - float r2 = roughness2 * roughness2; - float d = (nh * r2 - nh) * nh + 1.00001; - float specularTerm = r2 / ((d * d) * max(0.1, lh * lh) * (roughness * 4.0 + 2.0)); - #if defined (SHADER_API_MOBILE) || defined (SHADER_API_SWITCH) - specularTerm = clamp(specularTerm, 0.0, 100.0); - #endif - if(isSpecularToon) return lilTooning(specularTerm, 0.5); - else return specularTerm * specular; + #if defined(SHADER_API_MOBILE) || defined(SHADER_API_SWITCH) + sjggx = 0.5 / (lambdaV + lambdaL + 1e-4f); #else - // Fast Specular - float smoothness = 1.0/max(roughness, 0.002); - float specularTerm = pow(nh, smoothness); - if(isSpecularToon) return lilTooning(specularTerm, 0.5); - else return specularTerm * smoothness * 0.1 * specular; + sjggx = 0.5 / (lambdaV + lambdaL + 1e-5f); + #endif + + float specularTerm = sjggx * ggx; + #ifdef LIL_COLORSPACE_GAMMA + specularTerm = sqrt(max(1e-4h, specularTerm)); #endif + specularTerm *= nl * attenuation; + if(isSpecularToon) return lilTooning(specularTerm, 0.5); + else return specularTerm * lilFresnelTerm(specular, lh); +} + +float3 lilGetAnisotropyNormalWS(float3 normalWS, float3 anisoTangentWS, float3 anisoBitangentWS, float3 viewDirection, float anisotropy) +{ + float3 anisoDirectionWS = anisotropy > 0.0 ? anisoBitangentWS : anisoTangentWS; + anisoDirectionWS = lilOrthoNormalize(viewDirection, anisoDirectionWS); + return normalize(lerp(normalWS, anisoDirectionWS, abs(anisotropy))); } //------------------------------------------------------------------------------------------------------------------------------ diff --git a/Assets/lilToon/Shader/Includes/lil_common_input.hlsl b/Assets/lilToon/Shader/Includes/lil_common_input.hlsl index 541c1df0..85557fd6 100644 --- a/Assets/lilToon/Shader/Includes/lil_common_input.hlsl +++ b/Assets/lilToon/Shader/Includes/lil_common_input.hlsl @@ -220,6 +220,8 @@ SAMPLER(sampler_linear_clamp); float4 _MainTex_ST; float4 _MainTex_ScrollRotate; float4 _ShadowBorderColor; + float4 _MatCapTex_ST; + float4 _MatCapBlendUV1; float4 _RimColor; float4 _EmissionColor; float4 _EmissionBlink; @@ -259,6 +261,7 @@ SAMPLER(sampler_linear_clamp); lilBool _UseShadow; lilBool _UseMatCap; lilBool _MatCapMul; + lilBool _MatCapPerspective; lilBool _MatCapZRotCancel; lilBool _UseRim; lilBool _UseEmission; @@ -366,15 +369,23 @@ SAMPLER(sampler_linear_clamp); #if defined(LIL_MULTI_INPUTS_NORMAL_2ND) float4 _Bump2ndMap_ST; #endif + #if defined(LIL_MULTI_INPUTS_ANISOTROPY) + float4 _AnisotropyTangentMap_ST; + float4 _AnisotropyShiftNoiseMask_ST; + #endif #if defined(LIL_MULTI_INPUTS_REFLECTION) float4 _ReflectionColor; #endif #if defined(LIL_MULTI_INPUTS_MATCAP) float4 _MatCapColor; + float4 _MatCapTex_ST; + float4 _MatCapBlendUV1; float4 _MatCapBumpMap_ST; #endif #if defined(LIL_MULTI_INPUTS_MATCAP_2ND) float4 _MatCap2ndColor; + float4 _MatCap2ndTex_ST; + float4 _MatCap2ndBlendUV1; float4 _MatCap2ndBumpMap_ST; #endif #if defined(LIL_MULTI_INPUTS_RIM) @@ -468,6 +479,7 @@ SAMPLER(sampler_linear_clamp); float _BacklightBlur; float _BacklightDirectivity; float _BacklightViewStrength; + float _BacklightBackfaceMask; #endif #if defined(LIL_MULTI_INPUTS_NORMAL) float _BumpScale; @@ -475,6 +487,19 @@ SAMPLER(sampler_linear_clamp); #if defined(LIL_MULTI_INPUTS_NORMAL_2ND) float _Bump2ndScale; #endif + #if defined(LIL_MULTI_INPUTS_ANISOTROPY) + float _AnisotropyScale; + float _AnisotropyTangentWidth; + float _AnisotropyBitangentWidth; + float _AnisotropyShift; + float _AnisotropyShiftNoiseScale; + float _AnisotropySpecularStrength; + float _Anisotropy2ndTangentWidth; + float _Anisotropy2ndBitangentWidth; + float _Anisotropy2ndShift; + float _Anisotropy2ndShiftNoiseScale; + float _Anisotropy2ndSpecularStrength; + #endif #if defined(LIL_MULTI_INPUTS_REFLECTION) || defined(LIL_GEM) float _Smoothness; float _Reflectance; @@ -487,6 +512,7 @@ SAMPLER(sampler_linear_clamp); float _MatCapEnableLighting; float _MatCapShadowMask; float _MatCapVRParallaxStrength; + float _MatCapBackfaceMask; float _MatCapBumpScale; #endif #if defined(LIL_MULTI_INPUTS_MATCAP_2ND) @@ -494,6 +520,7 @@ SAMPLER(sampler_linear_clamp); float _MatCap2ndEnableLighting; float _MatCap2ndShadowMask; float _MatCap2ndVRParallaxStrength; + float _MatCap2ndBackfaceMask; float _MatCap2ndBumpScale; #endif #if defined(LIL_MULTI_INPUTS_RIM) @@ -507,12 +534,14 @@ SAMPLER(sampler_linear_clamp); float _RimIndirRange; float _RimIndirBorder; float _RimIndirBlur; + float _RimBackfaceMask; #endif #if defined(LIL_MULTI_INPUTS_GLITTER) float _GlitterMainStrength; float _GlitterEnableLighting; float _GlitterShadowMask; float _GlitterVRParallaxStrength; + float _GlitterBackfaceMask; #endif #if defined(LIL_MULTI_INPUTS_EMISSION) float _EmissionBlend; @@ -613,19 +642,27 @@ SAMPLER(sampler_linear_clamp); #if defined(LIL_MULTI_INPUTS_BACKLIGHT) lilBool _BacklightReceiveShadow; #endif + #if defined(LIL_MULTI_INPUTS_ANISOTROPY) + lilBool _Anisotropy2Reflection; + lilBool _Anisotropy2MatCap; + lilBool _Anisotropy2MatCap2nd; + #endif #if defined(LIL_MULTI_INPUTS_REFLECTION) lilBool _ApplySpecular; + lilBool _ApplySpecularFA; lilBool _ApplyReflection; lilBool _SpecularToon; lilBool _ReflectionApplyTransparency; #endif #if defined(LIL_MULTI_INPUTS_MATCAP) lilBool _MatCapApplyTransparency; + lilBool _MatCapPerspective; lilBool _MatCapZRotCancel; lilBool _MatCapCustomNormal; #endif #if defined(LIL_MULTI_INPUTS_MATCAP_2ND) lilBool _MatCap2ndApplyTransparency; + lilBool _MatCap2ndPerspective; lilBool _MatCap2ndZRotCancel; lilBool _MatCap2ndCustomNormal; #endif @@ -782,6 +819,12 @@ SAMPLER(sampler_linear_clamp); float4 _Bump2ndMap_ST; #endif + // Anisotropy + #if defined(LIL_FEATURE_ANISOTROPY) + float4 _AnisotropyTangentMap_ST; + float4 _AnisotropyShiftNoiseMask_ST; + #endif + // Reflection #if defined(LIL_FEATURE_REFLECTION) float4 _ReflectionColor; @@ -790,6 +833,8 @@ SAMPLER(sampler_linear_clamp); // MatCap #if defined(LIL_FEATURE_MATCAP) float4 _MatCapColor; + float4 _MatCapTex_ST; + float4 _MatCapBlendUV1; #if defined(LIL_FEATURE_TEX_MATCAP_NORMALMAP) float4 _MatCapBumpMap_ST; #endif @@ -798,6 +843,8 @@ SAMPLER(sampler_linear_clamp); // MatCap 2nd #if defined(LIL_FEATURE_MATCAP_2ND) float4 _MatCap2ndColor; + float4 _MatCap2ndTex_ST; + float4 _MatCap2ndBlendUV1; #if defined(LIL_FEATURE_TEX_MATCAP_NORMALMAP) float4 _MatCap2ndBumpMap_ST; #endif @@ -934,6 +981,7 @@ SAMPLER(sampler_linear_clamp); float _BacklightBlur; float _BacklightDirectivity; float _BacklightViewStrength; + float _BacklightBackfaceMask; #endif #if defined(LIL_FEATURE_NORMAL_1ST) float _BumpScale; @@ -941,6 +989,19 @@ SAMPLER(sampler_linear_clamp); #if defined(LIL_FEATURE_NORMAL_2ND) float _Bump2ndScale; #endif + #if defined(LIL_FEATURE_ANISOTROPY) + float _AnisotropyScale; + float _AnisotropyTangentWidth; + float _AnisotropyBitangentWidth; + float _AnisotropyShift; + float _AnisotropyShiftNoiseScale; + float _AnisotropySpecularStrength; + float _Anisotropy2ndTangentWidth; + float _Anisotropy2ndBitangentWidth; + float _Anisotropy2ndShift; + float _Anisotropy2ndShiftNoiseScale; + float _Anisotropy2ndSpecularStrength; + #endif #if defined(LIL_FEATURE_REFLECTION) || defined(LIL_GEM) float _Smoothness; float _Reflectance; @@ -953,6 +1014,7 @@ SAMPLER(sampler_linear_clamp); float _MatCapEnableLighting; float _MatCapShadowMask; float _MatCapVRParallaxStrength; + float _MatCapBackfaceMask; #if defined(LIL_FEATURE_TEX_MATCAP_NORMALMAP) float _MatCapBumpScale; #endif @@ -962,6 +1024,7 @@ SAMPLER(sampler_linear_clamp); float _MatCap2ndEnableLighting; float _MatCap2ndShadowMask; float _MatCap2ndVRParallaxStrength; + float _MatCap2ndBackfaceMask; #if defined(LIL_FEATURE_TEX_MATCAP_NORMALMAP) float _MatCap2ndBumpScale; #endif @@ -972,6 +1035,7 @@ SAMPLER(sampler_linear_clamp); float _RimFresnelPower; float _RimEnableLighting; float _RimShadowMask; + float _RimBackfaceMask; #if defined(LIL_FEATURE_RIMLIGHT_DIRECTION) float _RimDirStrength; float _RimDirRange; @@ -985,6 +1049,7 @@ SAMPLER(sampler_linear_clamp); float _GlitterEnableLighting; float _GlitterShadowMask; float _GlitterVRParallaxStrength; + float _GlitterBackfaceMask; #endif #if defined(LIL_FEATURE_EMISSION_1ST) float _EmissionBlend; @@ -1115,9 +1180,16 @@ SAMPLER(sampler_linear_clamp); #if defined(LIL_FEATURE_NORMAL_2ND) lilBool _UseBump2ndMap; #endif + #if defined(LIL_FEATURE_ANISOTROPY) + lilBool _UseAnisotropy; + lilBool _Anisotropy2Reflection; + lilBool _Anisotropy2MatCap; + lilBool _Anisotropy2MatCap2nd; + #endif #if defined(LIL_FEATURE_REFLECTION) lilBool _UseReflection; lilBool _ApplySpecular; + lilBool _ApplySpecularFA; lilBool _ApplyReflection; lilBool _SpecularToon; lilBool _ReflectionApplyTransparency; @@ -1125,6 +1197,7 @@ SAMPLER(sampler_linear_clamp); #if defined(LIL_FEATURE_MATCAP) lilBool _UseMatCap; lilBool _MatCapApplyTransparency; + lilBool _MatCapPerspective; lilBool _MatCapZRotCancel; #if defined(LIL_FEATURE_TEX_MATCAP_NORMALMAP) lilBool _MatCapCustomNormal; @@ -1133,6 +1206,7 @@ SAMPLER(sampler_linear_clamp); #if defined(LIL_FEATURE_MATCAP_2ND) lilBool _UseMatCap2nd; lilBool _MatCap2ndApplyTransparency; + lilBool _MatCap2ndPerspective; lilBool _MatCap2ndZRotCancel; #if defined(LIL_FEATURE_TEX_MATCAP_NORMALMAP) lilBool _MatCap2ndCustomNormal; @@ -1222,6 +1296,9 @@ TEXTURE2D(_AlphaMask); TEXTURE2D(_BumpMap); TEXTURE2D(_Bump2ndMap); TEXTURE2D(_Bump2ndScaleMask); +TEXTURE2D(_AnisotropyTangentMap); +TEXTURE2D(_AnisotropyScaleMask); +TEXTURE2D(_AnisotropyShiftNoiseMask); TEXTURE2D(_ShadowBorderMask); TEXTURE2D(_ShadowBlurMask); TEXTURE2D(_ShadowStrengthMask); diff --git a/Assets/lilToon/Shader/Includes/lil_common_macro.hlsl b/Assets/lilToon/Shader/Includes/lil_common_macro.hlsl index dc5a6fad..0cedeb0b 100644 --- a/Assets/lilToon/Shader/Includes/lil_common_macro.hlsl +++ b/Assets/lilToon/Shader/Includes/lil_common_macro.hlsl @@ -29,12 +29,6 @@ #define LIL_REFRACTION_SAMPNUM 8 #define LIL_REFRACTION_GAUSDIST(i) exp(-(float)i*(float)i/(LIL_REFRACTION_SAMPNUM*LIL_REFRACTION_SAMPNUM/2.0)) -// Specular mode (Default : 0) -// 0 : BRP Specular -// 1 : URP Specular -// 2 : Fast Specular -#define LIL_SPECULAR_MODE 0 - // MatCap mode (Default : 1) // 0 : Simple // 1 : Fix Z-Rotation @@ -131,7 +125,7 @@ // Optimization Macro // tangentWS / bitangentWS / normalWS -#if defined(LIL_FEATURE_NORMAL_1ST) || defined(LIL_FEATURE_NORMAL_2ND) || defined(LIL_FEATURE_TEX_MATCAP_NORMALMAP) || defined(LIL_FEATURE_EMISSION_1ST) || defined(LIL_FEATURE_EMISSION_2ND) || defined(LIL_FEATURE_PARALLAX) +#if defined(LIL_FEATURE_NORMAL_1ST) || defined(LIL_FEATURE_NORMAL_2ND) || defined(LIL_FEATURE_ANISOTROPY) || defined(LIL_FEATURE_TEX_MATCAP_NORMALMAP) || defined(LIL_FEATURE_EMISSION_1ST) || defined(LIL_FEATURE_EMISSION_2ND) || defined(LIL_FEATURE_PARALLAX) #define LIL_SHOULD_TBN #endif @@ -151,12 +145,12 @@ #endif // positionWS -#if defined(LIL_PASS_FORWARDADD) || defined(LIL_FEATURE_MAIN2ND) || defined(LIL_FEATURE_MAIN3RD) || defined(LIL_FEATURE_RECEIVE_SHADOW) || defined(LIL_FEATURE_REFLECTION) || defined(LIL_FEATURE_MATCAP) || defined(LIL_FEATURE_MATCAP_2ND) || defined(LIL_FEATURE_RIMLIGHT) || defined(LIL_FEATURE_GLITTER) || defined(LIL_FEATURE_BACKLIGHT) || defined(LIL_FEATURE_EMISSION_1ST) || defined(LIL_FEATURE_EMISSION_2ND) || defined(LIL_FEATURE_PARALLAX) || defined(LIL_FEATURE_DISTANCE_FADE) || defined(LIL_REFRACTION) || !defined(LIL_BRP) || defined(LIL_USE_LPPV) +#if defined(LIL_PASS_FORWARDADD) || defined(LIL_FEATURE_MAIN2ND) || defined(LIL_FEATURE_MAIN3RD) || defined(LIL_FEATURE_ANISOTROPY) || defined(LIL_FEATURE_RECEIVE_SHADOW) || defined(LIL_FEATURE_REFLECTION) || defined(LIL_FEATURE_MATCAP) || defined(LIL_FEATURE_MATCAP_2ND) || defined(LIL_FEATURE_RIMLIGHT) || defined(LIL_FEATURE_GLITTER) || defined(LIL_FEATURE_BACKLIGHT) || defined(LIL_FEATURE_EMISSION_1ST) || defined(LIL_FEATURE_EMISSION_2ND) || defined(LIL_FEATURE_PARALLAX) || defined(LIL_FEATURE_DISTANCE_FADE) || defined(LIL_REFRACTION) || !defined(LIL_BRP) || defined(LIL_USE_LPPV) #define LIL_SHOULD_POSITION_WS #endif // uv1 -#if defined(LIL_FEATURE_GLITTER) +#if defined(LIL_FEATURE_MATCAP) || defined(LIL_FEATURE_MATCAP_2ND) || defined(LIL_FEATURE_GLITTER) #define LIL_SHOULD_UV1 #endif @@ -455,6 +449,8 @@ float3 lilHeadDirection(float3 positionWS) return 0; } #define LIL_GET_HDRPDATA(input) + #define LIL_HDRP_DEEXPOSURE(col) + #define LIL_HDRP_INVDEEXPOSURE(col) // Main light #define LIL_MAINLIGHT_COLOR _LightColor0.rgb @@ -660,15 +656,25 @@ float3 lilHeadDirection(float3 positionWS) } #endif + #if VERSION_LOWER(11, 0) + #define LIL_HDRP_DEEXPOSURE(col) + #define LIL_HDRP_INVDEEXPOSURE(col) + #else + #define LIL_HDRP_DEEXPOSURE(col) col.rgb *= _DeExposureMultiplier + #define LIL_HDRP_INVDEEXPOSURE(col) col.rgb /= _DeExposureMultiplier + #endif + float4 SampleEnv(LightLoopContext lightLoopContext, PositionInputs posInput, EnvLightData lightData, float3 reflUVW, float lod) { #if VERSION_GREATER_EQUAL(10, 1) - return SampleEnv(lightLoopContext, lightData.envIndex, reflUVW, lod * lightData.roughReflections, lightData.rangeCompressionFactorCompensation, posInput.positionNDC); + float4 reflectionCol = SampleEnv(lightLoopContext, lightData.envIndex, reflUVW, lod * lightData.roughReflections, lightData.rangeCompressionFactorCompensation, posInput.positionNDC); #elif VERSION_GREATER_EQUAL(7, 1) - return SampleEnv(lightLoopContext, lightData.envIndex, reflUVW, lod, lightData.rangeCompressionFactorCompensation); + float4 reflectionCol = SampleEnv(lightLoopContext, lightData.envIndex, reflUVW, lod, lightData.rangeCompressionFactorCompensation); #else - return SampleEnv(lightLoopContext, lightData.envIndex, reflUVW, lod); + float4 reflectionCol = SampleEnv(lightLoopContext, lightData.envIndex, reflUVW, lod); #endif + LIL_HDRP_INVDEEXPOSURE(reflectionCol); + return reflectionCol; } //------------------------------------------------------------------------------------------------------------------------------ @@ -1136,6 +1142,8 @@ float3 lilHeadDirection(float3 positionWS) return 0; } #define LIL_GET_HDRPDATA(input) + #define LIL_HDRP_DEEXPOSURE(col) + #define LIL_HDRP_INVDEEXPOSURE(col) // Main light #define LIL_MAINLIGHT_COLOR _MainLightColor.rgb diff --git a/Assets/lilToon/Shader/Includes/lil_common_vert.hlsl b/Assets/lilToon/Shader/Includes/lil_common_vert.hlsl index b66ecba5..eada1f73 100644 --- a/Assets/lilToon/Shader/Includes/lil_common_vert.hlsl +++ b/Assets/lilToon/Shader/Includes/lil_common_vert.hlsl @@ -154,7 +154,7 @@ LIL_V2F_TYPE vert(appdata input) LIL_V2F_OUT_BASE.uv1 = input.uv1; #endif #if defined(LIL_V2F_UVMAT) - LIL_V2F_OUT_BASE.uvMat = lilCalcMatCapUV(vertexNormalInput.normalWS, viewDirection, headDirection, _MatCapVRParallaxStrength, _MatCapZRotCancel); + LIL_V2F_OUT_BASE.uvMat = lilCalcMatCapUV(input.uv1, vertexNormalInput.normalWS, viewDirection, headDirection, _MatCapTex_ST, _MatCapBlendUV1.xy, _MatCapZRotCancel, _MatCapPerspective, _MatCapVRParallaxStrength); #endif // Position diff --git a/Assets/lilToon/Shader/Includes/lil_pass_forward_fakeshadow.hlsl b/Assets/lilToon/Shader/Includes/lil_pass_forward_fakeshadow.hlsl index 0308d93d..cceff617 100644 --- a/Assets/lilToon/Shader/Includes/lil_pass_forward_fakeshadow.hlsl +++ b/Assets/lilToon/Shader/Includes/lil_pass_forward_fakeshadow.hlsl @@ -76,6 +76,7 @@ float4 frag(v2f input) : SV_Target #endif float4 col = LIL_SAMPLE_2D(_MainTex, sampler_MainTex, input.uv); col *= _Color; + LIL_HDRP_DEEXPOSURE(col); float4 fogColor = float4(1,1,1,1); LIL_APPLY_FOG_COLOR(col, input.fogCoord, fogColor); return col; diff --git a/Assets/lilToon/Shader/Includes/lil_pass_forward_fur.hlsl b/Assets/lilToon/Shader/Includes/lil_pass_forward_fur.hlsl index 4d89eb85..838a52d4 100644 --- a/Assets/lilToon/Shader/Includes/lil_pass_forward_fur.hlsl +++ b/Assets/lilToon/Shader/Includes/lil_pass_forward_fur.hlsl @@ -118,7 +118,13 @@ float4 frag(v2f input) : SV_Target float3 albedo = 1.0; float3 emissionColor = 0.0; + float anisotropy = 0.0; + float3 anisoTangentWS = 0.0; + float3 anisoBitangentWS = 0.0; float3 normalDirection = 0.0; + float3 reflectionNormalDirection = 0.0; + float3 matcapNormalDirection = 0.0; + float3 matcap2ndNormalDirection = 0.0; float3 viewDirection = 0.0; float3 headDirection = 0.0; float3x3 tbnWS = 0.0; @@ -126,6 +132,10 @@ float4 frag(v2f input) : SV_Target float3 parallaxViewDirection = 0.0; float2 parallaxOffset = 0.0; + float smoothness = 1.0; + float roughness = 1.0; + float perceptualRoughness = 1.0; + float vl = 0.0; float hl = 0.0; float ln = 0.0; @@ -151,7 +161,7 @@ float4 frag(v2f input) : SV_Target //------------------------------------------------------------------------------------------------------------------------------ // View Direction #if defined(LIL_V2F_POSITION_WS) - depth = length(lilViewDirection(input.positionWS)); + depth = length(lilHeadDirection(input.positionWS)); viewDirection = normalize(lilViewDirection(input.positionWS)); headDirection = normalize(lilHeadDirection(input.positionWS)); vl = dot(viewDirection, lightDirection); @@ -218,6 +228,10 @@ float4 frag(v2f input) : SV_Target OVERRIDE_DISTANCE_FADE #endif + //------------------------------------------------------------------------------------------------------------------------------ + // Fix Color + LIL_HDRP_DEEXPOSURE(col); + //------------------------------------------------------------------------------------------------------------------------------ // Fog BEFORE_FOG diff --git a/Assets/lilToon/Shader/Includes/lil_pass_forward_gem.hlsl b/Assets/lilToon/Shader/Includes/lil_pass_forward_gem.hlsl index 512e2952..82deae03 100644 --- a/Assets/lilToon/Shader/Includes/lil_pass_forward_gem.hlsl +++ b/Assets/lilToon/Shader/Includes/lil_pass_forward_gem.hlsl @@ -114,7 +114,13 @@ float3 albedo = 1.0; float3 emissionColor = 0.0; + float anisotropy = 0.0; + float3 anisoTangentWS = 0.0; + float3 anisoBitangentWS = 0.0; float3 normalDirection = 0.0; + float3 reflectionNormalDirection = 0.0; + float3 matcapNormalDirection = 0.0; + float3 matcap2ndNormalDirection = 0.0; float3 viewDirection = 0.0; float3 headDirection = 0.0; float3x3 tbnWS = 0.0; @@ -122,6 +128,10 @@ float3 parallaxViewDirection = 0.0; float2 parallaxOffset = 0.0; + float smoothness = 1.0; + float roughness = 1.0; + float perceptualRoughness = 1.0; + float vl = 0.0; float hl = 0.0; float ln = 0.0; @@ -147,7 +157,7 @@ //------------------------------------------------------------------------------------------------------------------------------ // View Direction #if defined(LIL_V2F_POSITION_WS) - depth = length(lilViewDirection(input.positionWS)); + depth = length(lilHeadDirection(input.positionWS)); viewDirection = normalize(lilViewDirection(input.positionWS)); headDirection = normalize(lilHeadDirection(input.positionWS)); vl = dot(viewDirection, lightDirection); @@ -204,6 +214,10 @@ normalDirection = facing < 0.0 ? -normalDirection - viewDirection * 0.2 : normalDirection; normalDirection = normalize(normalDirection); #endif + reflectionNormalDirection = normalDirection; + matcapNormalDirection = normalDirection; + matcap2ndNormalDirection = normalDirection; + nvabs = abs(dot(normalDirection, viewDirection)); nv = nvabs; float nv1 = abs(dot(normalDirection, gemViewDirection)); @@ -212,6 +226,13 @@ float invnv = 1-nv1; ln = dot(lightDirection, normalDirection); + //------------------------------------------------------------------------------------------------------------------------------ + // Anisotropy + BEFORE_ANISOTROPY + #if defined(LIL_FEATURE_ANISOTROPY) + OVERRIDE_ANISOTROPY + #endif + //------------------------------------------------------------------------------------------------------------------------------ // AudioLink (https://github.com/llealloo/vrc-udon-audio-link) BEFORE_AUDIOLINK @@ -247,10 +268,10 @@ //------------------------------------------------------------------------------------------------------------------------------ // Reflection - float smoothness = _Smoothness; + smoothness = _Smoothness; if(Exists_SmoothnessTex) smoothness *= LIL_SAMPLE_2D(_SmoothnessTex, sampler_MainTex, uvMain).r; - float perceptualRoughness = 1.0 - smoothness; - float roughness = perceptualRoughness * perceptualRoughness; + perceptualRoughness = perceptualRoughness - smoothness * perceptualRoughness; + roughness = perceptualRoughness * perceptualRoughness; float3 normalDirectionR = normalDirection; float3 normalDirectionG = facing < 0.0 ? normalize(normalDirection + viewDirection * invnv * _GemChromaticAberration) : normalDirection; @@ -319,6 +340,10 @@ BEFORE_BLEND_EMISSION OVERRIDE_BLEND_EMISSION + //------------------------------------------------------------------------------------------------------------------------------ + // Fix Color + LIL_HDRP_DEEXPOSURE(col); + float4 fogColor = float4(0,0,0,0); BEFORE_FOG OVERRIDE_FOG diff --git a/Assets/lilToon/Shader/Includes/lil_pass_forward_lite.hlsl b/Assets/lilToon/Shader/Includes/lil_pass_forward_lite.hlsl index 53c3fc98..177f9b3f 100644 --- a/Assets/lilToon/Shader/Includes/lil_pass_forward_lite.hlsl +++ b/Assets/lilToon/Shader/Includes/lil_pass_forward_lite.hlsl @@ -104,7 +104,13 @@ float4 frag(v2f input LIL_VFACE(facing)) : SV_Target float3 albedo = 1.0; float3 emissionColor = 0.0; + float anisotropy = 0.0; + float3 anisoTangentWS = 0.0; + float3 anisoBitangentWS = 0.0; float3 normalDirection = 0.0; + float3 reflectionNormalDirection = 0.0; + float3 matcapNormalDirection = 0.0; + float3 matcap2ndNormalDirection = 0.0; float3 viewDirection = 0.0; float3 headDirection = 0.0; float3x3 tbnWS = 0.0; @@ -112,6 +118,10 @@ float4 frag(v2f input LIL_VFACE(facing)) : SV_Target float3 parallaxViewDirection = 0.0; float2 parallaxOffset = 0.0; + float smoothness = 1.0; + float roughness = 1.0; + float perceptualRoughness = 1.0; + float vl = 0.0; float hl = 0.0; float ln = 0.0; @@ -137,7 +147,7 @@ float4 frag(v2f input LIL_VFACE(facing)) : SV_Target //------------------------------------------------------------------------------------------------------------------------------ // View Direction #if defined(LIL_V2F_POSITION_WS) - depth = length(lilViewDirection(input.positionWS)); + depth = length(lilHeadDirection(input.positionWS)); viewDirection = normalize(lilViewDirection(input.positionWS)); headDirection = normalize(lilHeadDirection(input.positionWS)); vl = dot(viewDirection, lightDirection); @@ -255,6 +265,10 @@ float4 frag(v2f input LIL_VFACE(facing)) : SV_Target #endif #endif + //------------------------------------------------------------------------------------------------------------------------------ + // Fix Color + LIL_HDRP_DEEXPOSURE(col); + //------------------------------------------------------------------------------------------------------------------------------ // Fog BEFORE_FOG diff --git a/Assets/lilToon/Shader/Includes/lil_pass_forward_normal.hlsl b/Assets/lilToon/Shader/Includes/lil_pass_forward_normal.hlsl index c67fc77a..e5850640 100644 --- a/Assets/lilToon/Shader/Includes/lil_pass_forward_normal.hlsl +++ b/Assets/lilToon/Shader/Includes/lil_pass_forward_normal.hlsl @@ -190,7 +190,13 @@ float4 frag(v2f input LIL_VFACE(facing)) : SV_Target float3 albedo = 1.0; float3 emissionColor = 0.0; + float anisotropy = 0.0; + float3 anisoTangentWS = 0.0; + float3 anisoBitangentWS = 0.0; float3 normalDirection = 0.0; + float3 reflectionNormalDirection = 0.0; + float3 matcapNormalDirection = 0.0; + float3 matcap2ndNormalDirection = 0.0; float3 viewDirection = 0.0; float3 headDirection = 0.0; float3x3 tbnWS = 0.0; @@ -198,6 +204,10 @@ float4 frag(v2f input LIL_VFACE(facing)) : SV_Target float3 parallaxViewDirection = 0.0; float2 parallaxOffset = 0.0; + float smoothness = 1.0; + float roughness = 1.0; + float perceptualRoughness = 1.0; + float vl = 0.0; float hl = 0.0; float ln = 0.0; @@ -223,7 +233,7 @@ float4 frag(v2f input LIL_VFACE(facing)) : SV_Target //------------------------------------------------------------------------------------------------------------------------------ // View Direction #if defined(LIL_V2F_POSITION_WS) - depth = length(lilViewDirection(input.positionWS)); + depth = length(lilHeadDirection(input.positionWS)); viewDirection = normalize(lilViewDirection(input.positionWS)); headDirection = normalize(lilHeadDirection(input.positionWS)); vl = dot(viewDirection, lightDirection); @@ -415,6 +425,16 @@ float4 frag(v2f input LIL_VFACE(facing)) : SV_Target nvabs = abs(dot(normalDirection, viewDirection)); #endif #endif + reflectionNormalDirection = normalDirection; + matcapNormalDirection = normalDirection; + matcap2ndNormalDirection = normalDirection; + + //------------------------------------------------------------------------------------------------------------------------------ + // Anisotropy + BEFORE_ANISOTROPY + #if defined(LIL_FEATURE_ANISOTROPY) + OVERRIDE_ANISOTROPY + #endif //------------------------------------------------------------------------------------------------------------------------------ // AudioLink (https://github.com/llealloo/vrc-udon-audio-link) @@ -502,10 +522,10 @@ float4 frag(v2f input LIL_VFACE(facing)) : SV_Target BEFORE_REFRACTION #if defined(LIL_REFRACTION) && !defined(LIL_PASS_FORWARDADD) #if defined(LIL_REFRACTION_BLUR2) && defined(LIL_FEATURE_REFLECTION) - float smoothness = _Smoothness; + smoothness = _Smoothness; if(Exists_SmoothnessTex) smoothness *= LIL_SAMPLE_2D(_SmoothnessTex, sampler_MainTex, uvMain).r; - float perceptualRoughness = 1.0 - smoothness; - float roughness = perceptualRoughness * perceptualRoughness; + perceptualRoughness = perceptualRoughness - smoothness * perceptualRoughness; + roughness = perceptualRoughness * perceptualRoughness; #endif OVERRIDE_REFRACTION #endif @@ -584,6 +604,10 @@ float4 frag(v2f input LIL_VFACE(facing)) : SV_Target OVERRIDE_DISTANCE_FADE #endif + //------------------------------------------------------------------------------------------------------------------------------ + // Fix Color + LIL_HDRP_DEEXPOSURE(col); + //------------------------------------------------------------------------------------------------------------------------------ // Fog BEFORE_FOG diff --git a/Assets/lilToon/Shader/Includes/lil_replace_keywords.hlsl b/Assets/lilToon/Shader/Includes/lil_replace_keywords.hlsl index 89c5d79e..c056a24b 100644 --- a/Assets/lilToon/Shader/Includes/lil_replace_keywords.hlsl +++ b/Assets/lilToon/Shader/Includes/lil_replace_keywords.hlsl @@ -100,6 +100,11 @@ #undef EFFECT_BUMP #endif +#if defined(SOURCE_GBUFFER) + #define LIL_FEATURE_ANISOTROPY + #undef SOURCE_GBUFFER +#endif + #if defined(_GLOSSYREFLECTIONS_OFF) #define LIL_FEATURE_REFLECTION #undef _GLOSSYREFLECTIONS_OFF diff --git a/Assets/lilToon/Shader/lts.shader b/Assets/lilToon/Shader/lts.shader index b0ab6b25..d410f987 100644 --- a/Assets/lilToon/Shader/lts.shader +++ b/Assets/lilToon/Shader/lts.shader @@ -54,7 +54,7 @@ Shader "lilToon" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "lilToon" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "lilToon" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "lilToon" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "lilToon" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "lilToon" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "lilToon" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "lilToon" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "lilToon" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "lilToon" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -363,6 +394,12 @@ Shader "lilToon" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_cutout.shader b/Assets/lilToon/Shader/lts_cutout.shader index 5a0ef9be..d533edb3 100644 --- a/Assets/lilToon/Shader/lts_cutout.shader +++ b/Assets/lilToon/Shader/lts_cutout.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonCutout" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonCutout" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonCutout" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonCutout" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonCutout" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonCutout" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonCutout" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonCutout" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonCutout" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonCutout" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -363,6 +394,12 @@ Shader "Hidden/lilToonCutout" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 1 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_cutout_o.shader b/Assets/lilToon/Shader/lts_cutout_o.shader index 2b56d0d4..53f4975b 100644 --- a/Assets/lilToon/Shader/lts_cutout_o.shader +++ b/Assets/lilToon/Shader/lts_cutout_o.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonCutoutOutline" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonCutoutOutline" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonCutoutOutline" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonCutoutOutline" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonCutoutOutline" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonCutoutOutline" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonCutoutOutline" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonCutoutOutline" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonCutoutOutline" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonCutoutOutline" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -404,6 +435,12 @@ Shader "Hidden/lilToonCutoutOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 1 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_fakeshadow.shader b/Assets/lilToon/Shader/lts_fakeshadow.shader index e558968a..50750944 100644 --- a/Assets/lilToon/Shader/lts_fakeshadow.shader +++ b/Assets/lilToon/Shader/lts_fakeshadow.shader @@ -39,6 +39,12 @@ Shader "_lil/[Optional] lilToonFakeShadow" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } HLSLINCLUDE ENDHLSL diff --git a/Assets/lilToon/Shader/lts_fur.shader b/Assets/lilToon/Shader/lts_fur.shader index 15675b7b..5b911bb1 100644 --- a/Assets/lilToon/Shader/lts_fur.shader +++ b/Assets/lilToon/Shader/lts_fur.shader @@ -50,7 +50,7 @@ Shader "Hidden/lilToonFur" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Encryption @@ -128,6 +128,12 @@ Shader "Hidden/lilToonFur" _FurOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _FurColorMask ("Color Mask", Int) = 15 [lilToggle] _FurAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } HLSLINCLUDE #pragma require geometry diff --git a/Assets/lilToon/Shader/lts_fur_cutout.shader b/Assets/lilToon/Shader/lts_fur_cutout.shader index ebd83de6..8cfd674a 100644 --- a/Assets/lilToon/Shader/lts_fur_cutout.shader +++ b/Assets/lilToon/Shader/lts_fur_cutout.shader @@ -50,7 +50,7 @@ Shader "Hidden/lilToonFurCutout" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Encryption @@ -128,6 +128,12 @@ Shader "Hidden/lilToonFurCutout" _FurOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _FurColorMask ("Color Mask", Int) = 15 [lilToggle] _FurAlphaToMask ("AlphaToMask", Int) = 1 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } HLSLINCLUDE #pragma require geometry diff --git a/Assets/lilToon/Shader/lts_gem.shader b/Assets/lilToon/Shader/lts_gem.shader index 46e7e6fb..a97f26b8 100644 --- a/Assets/lilToon/Shader/lts_gem.shader +++ b/Assets/lilToon/Shader/lts_gem.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonGem" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonGem" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonGem" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Shadow [lilToggleLeft] _UseShadow ("Use Shadow", Int) = 0 @@ -136,9 +157,10 @@ Shader "Hidden/lilToonGem" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -146,15 +168,18 @@ Shader "Hidden/lilToonGem" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -163,15 +188,18 @@ Shader "Hidden/lilToonGem" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -186,6 +214,7 @@ Shader "Hidden/lilToonGem" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -205,6 +234,7 @@ Shader "Hidden/lilToonGem" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -288,7 +318,7 @@ Shader "Hidden/lilToonGem" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -360,6 +390,12 @@ Shader "Hidden/lilToonGem" _GemParticleLoop ("Particle Loop", Float) = 8 [lilHDR] _GemParticleColor ("Particle Color", Color) = (4,4,4,1) _GemVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } HLSLINCLUDE #define LIL_RENDER 2 diff --git a/Assets/lilToon/Shader/lts_o.shader b/Assets/lilToon/Shader/lts_o.shader index a9ee4007..8ab40d4b 100644 --- a/Assets/lilToon/Shader/lts_o.shader +++ b/Assets/lilToon/Shader/lts_o.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonOutline" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonOutline" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonOutline" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonOutline" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonOutline" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonOutline" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonOutline" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonOutline" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonOutline" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonOutline" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -404,6 +435,12 @@ Shader "Hidden/lilToonOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_onetrans.shader b/Assets/lilToon/Shader/lts_onetrans.shader index d574b3eb..e7eab3ba 100644 --- a/Assets/lilToon/Shader/lts_onetrans.shader +++ b/Assets/lilToon/Shader/lts_onetrans.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonOnePassTransparent" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonOnePassTransparent" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonOnePassTransparent" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonOnePassTransparent" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonOnePassTransparent" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonOnePassTransparent" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonOnePassTransparent" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonOnePassTransparent" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonOnePassTransparent" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonOnePassTransparent" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -363,6 +394,12 @@ Shader "Hidden/lilToonOnePassTransparent" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_onetrans_o.shader b/Assets/lilToon/Shader/lts_onetrans_o.shader index 5b83c9b3..f25d92d4 100644 --- a/Assets/lilToon/Shader/lts_onetrans_o.shader +++ b/Assets/lilToon/Shader/lts_onetrans_o.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonOnePassTransparentOutline" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonOnePassTransparentOutline" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonOnePassTransparentOutline" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonOnePassTransparentOutline" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonOnePassTransparentOutline" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonOnePassTransparentOutline" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonOnePassTransparentOutline" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonOnePassTransparentOutline" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonOnePassTransparentOutline" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonOnePassTransparentOutline" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -404,6 +435,12 @@ Shader "Hidden/lilToonOnePassTransparentOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_overlay.shader b/Assets/lilToon/Shader/lts_overlay.shader index 439eefda..9e413c2e 100644 --- a/Assets/lilToon/Shader/lts_overlay.shader +++ b/Assets/lilToon/Shader/lts_overlay.shader @@ -54,7 +54,7 @@ Shader "_lil/[Optional] lilToonOverlay" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "_lil/[Optional] lilToonOverlay" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "_lil/[Optional] lilToonOverlay" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "_lil/[Optional] lilToonOverlay" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "_lil/[Optional] lilToonOverlay" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "_lil/[Optional] lilToonOverlay" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "_lil/[Optional] lilToonOverlay" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "_lil/[Optional] lilToonOverlay" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "_lil/[Optional] lilToonOverlay" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "_lil/[Optional] lilToonOverlay" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -363,6 +394,12 @@ Shader "_lil/[Optional] lilToonOverlay" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_overlay_one.shader b/Assets/lilToon/Shader/lts_overlay_one.shader index c4029931..3e2069c2 100644 --- a/Assets/lilToon/Shader/lts_overlay_one.shader +++ b/Assets/lilToon/Shader/lts_overlay_one.shader @@ -54,7 +54,7 @@ Shader "_lil/[Optional] lilToonOverlayOnePass" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "_lil/[Optional] lilToonOverlayOnePass" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "_lil/[Optional] lilToonOverlayOnePass" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "_lil/[Optional] lilToonOverlayOnePass" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "_lil/[Optional] lilToonOverlayOnePass" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "_lil/[Optional] lilToonOverlayOnePass" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "_lil/[Optional] lilToonOverlayOnePass" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "_lil/[Optional] lilToonOverlayOnePass" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "_lil/[Optional] lilToonOverlayOnePass" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "_lil/[Optional] lilToonOverlayOnePass" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -363,6 +394,12 @@ Shader "_lil/[Optional] lilToonOverlayOnePass" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_ref.shader b/Assets/lilToon/Shader/lts_ref.shader index 29079e3c..fbc9837b 100644 --- a/Assets/lilToon/Shader/lts_ref.shader +++ b/Assets/lilToon/Shader/lts_ref.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonRefraction" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonRefraction" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonRefraction" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonRefraction" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonRefraction" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonRefraction" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonRefraction" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonRefraction" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonRefraction" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonRefraction" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -370,6 +401,12 @@ Shader "Hidden/lilToonRefraction" [PowerSlider(3.0)]_RefractionFresnelPower ("Fresnel Power", Range(0.01, 10)) = 0.5 [lilToggle] _RefractionColorFromMain ("RefractionColorFromMain", Int) = 0 _RefractionColor ("Color", Color) = (1,1,1,1) + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } HLSLINCLUDE #define LIL_RENDER 2 diff --git a/Assets/lilToon/Shader/lts_ref_blur.shader b/Assets/lilToon/Shader/lts_ref_blur.shader index 2607a0f7..333fdaae 100644 --- a/Assets/lilToon/Shader/lts_ref_blur.shader +++ b/Assets/lilToon/Shader/lts_ref_blur.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonRefractionBlur" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonRefractionBlur" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonRefractionBlur" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonRefractionBlur" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonRefractionBlur" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonRefractionBlur" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonRefractionBlur" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonRefractionBlur" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonRefractionBlur" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonRefractionBlur" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -370,6 +401,12 @@ Shader "Hidden/lilToonRefractionBlur" [PowerSlider(3.0)]_RefractionFresnelPower ("Fresnel Power", Range(0.01, 10)) = 0.5 [lilToggle] _RefractionColorFromMain ("RefractionColorFromMain", Int) = 0 _RefractionColor ("Color", Color) = (1,1,1,1) + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } HLSLINCLUDE #define LIL_RENDER 2 diff --git a/Assets/lilToon/Shader/lts_tess.shader b/Assets/lilToon/Shader/lts_tess.shader index 18346fc3..c879a720 100644 --- a/Assets/lilToon/Shader/lts_tess.shader +++ b/Assets/lilToon/Shader/lts_tess.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTessellation" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTessellation" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTessellation" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTessellation" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTessellation" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTessellation" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTessellation" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTessellation" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTessellation" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTessellation" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -370,6 +401,12 @@ Shader "Hidden/lilToonTessellation" _TessStrength ("Tessellation Strength", Range(0, 1)) = 0.5 _TessShrink ("Tessellation Shrink", Range(0, 1)) = 0.0 [IntRange] _TessFactorMax ("Tessellation Max", Range(1, 8)) = 3 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_tess_cutout.shader b/Assets/lilToon/Shader/lts_tess_cutout.shader index 2da31342..cd74ad03 100644 --- a/Assets/lilToon/Shader/lts_tess_cutout.shader +++ b/Assets/lilToon/Shader/lts_tess_cutout.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTessellationCutout" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTessellationCutout" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTessellationCutout" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTessellationCutout" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTessellationCutout" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTessellationCutout" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTessellationCutout" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTessellationCutout" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTessellationCutout" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTessellationCutout" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -370,6 +401,12 @@ Shader "Hidden/lilToonTessellationCutout" _TessStrength ("Tessellation Strength", Range(0, 1)) = 0.5 _TessShrink ("Tessellation Shrink", Range(0, 1)) = 0.0 [IntRange] _TessFactorMax ("Tessellation Max", Range(1, 8)) = 3 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_tess_cutout_o.shader b/Assets/lilToon/Shader/lts_tess_cutout_o.shader index a30375de..1fa80835 100644 --- a/Assets/lilToon/Shader/lts_tess_cutout_o.shader +++ b/Assets/lilToon/Shader/lts_tess_cutout_o.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTessellationCutoutOutline" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTessellationCutoutOutline" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTessellationCutoutOutline" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTessellationCutoutOutline" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTessellationCutoutOutline" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTessellationCutoutOutline" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTessellationCutoutOutline" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTessellationCutoutOutline" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTessellationCutoutOutline" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTessellationCutoutOutline" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -411,6 +442,12 @@ Shader "Hidden/lilToonTessellationCutoutOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 1 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_tess_o.shader b/Assets/lilToon/Shader/lts_tess_o.shader index 9393b40e..bfb50fb0 100644 --- a/Assets/lilToon/Shader/lts_tess_o.shader +++ b/Assets/lilToon/Shader/lts_tess_o.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTessellationOutline" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTessellationOutline" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTessellationOutline" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTessellationOutline" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTessellationOutline" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTessellationOutline" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTessellationOutline" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTessellationOutline" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTessellationOutline" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTessellationOutline" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -411,6 +442,12 @@ Shader "Hidden/lilToonTessellationOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_tess_onetrans.shader b/Assets/lilToon/Shader/lts_tess_onetrans.shader index 3fe2312b..5a4df97c 100644 --- a/Assets/lilToon/Shader/lts_tess_onetrans.shader +++ b/Assets/lilToon/Shader/lts_tess_onetrans.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTessellationOnePassTransparent" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTessellationOnePassTransparent" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTessellationOnePassTransparent" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTessellationOnePassTransparent" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTessellationOnePassTransparent" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTessellationOnePassTransparent" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTessellationOnePassTransparent" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTessellationOnePassTransparent" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTessellationOnePassTransparent" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTessellationOnePassTransparent" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -370,6 +401,12 @@ Shader "Hidden/lilToonTessellationOnePassTransparent" _TessStrength ("Tessellation Strength", Range(0, 1)) = 0.5 _TessShrink ("Tessellation Shrink", Range(0, 1)) = 0.0 [IntRange] _TessFactorMax ("Tessellation Max", Range(1, 8)) = 3 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_tess_onetrans_o.shader b/Assets/lilToon/Shader/lts_tess_onetrans_o.shader index 240e259f..12432fae 100644 --- a/Assets/lilToon/Shader/lts_tess_onetrans_o.shader +++ b/Assets/lilToon/Shader/lts_tess_onetrans_o.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTessellationOnePassTransparentOutline" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTessellationOnePassTransparentOutline" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTessellationOnePassTransparentOutline" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTessellationOnePassTransparentOutline" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTessellationOnePassTransparentOutline" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTessellationOnePassTransparentOutline" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTessellationOnePassTransparentOutline" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTessellationOnePassTransparentOutline" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTessellationOnePassTransparentOutline" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTessellationOnePassTransparentOutline" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -411,6 +442,12 @@ Shader "Hidden/lilToonTessellationOnePassTransparentOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_tess_trans.shader b/Assets/lilToon/Shader/lts_tess_trans.shader index 1a2608ce..fdf1f4ca 100644 --- a/Assets/lilToon/Shader/lts_tess_trans.shader +++ b/Assets/lilToon/Shader/lts_tess_trans.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTessellationTransparent" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTessellationTransparent" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTessellationTransparent" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTessellationTransparent" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTessellationTransparent" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTessellationTransparent" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTessellationTransparent" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTessellationTransparent" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTessellationTransparent" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTessellationTransparent" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -370,6 +401,12 @@ Shader "Hidden/lilToonTessellationTransparent" _TessStrength ("Tessellation Strength", Range(0, 1)) = 0.5 _TessShrink ("Tessellation Shrink", Range(0, 1)) = 0.0 [IntRange] _TessFactorMax ("Tessellation Max", Range(1, 8)) = 3 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_tess_trans_o.shader b/Assets/lilToon/Shader/lts_tess_trans_o.shader index 1aa78dab..26748e86 100644 --- a/Assets/lilToon/Shader/lts_tess_trans_o.shader +++ b/Assets/lilToon/Shader/lts_tess_trans_o.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTessellationTransparentOutline" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTessellationTransparentOutline" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTessellationTransparentOutline" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTessellationTransparentOutline" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTessellationTransparentOutline" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTessellationTransparentOutline" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTessellationTransparentOutline" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTessellationTransparentOutline" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTessellationTransparentOutline" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTessellationTransparentOutline" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -411,6 +442,12 @@ Shader "Hidden/lilToonTessellationTransparentOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_tess_twotrans.shader b/Assets/lilToon/Shader/lts_tess_twotrans.shader index 5715c054..3b3314f3 100644 --- a/Assets/lilToon/Shader/lts_tess_twotrans.shader +++ b/Assets/lilToon/Shader/lts_tess_twotrans.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTessellationTwoPassTransparent" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTessellationTwoPassTransparent" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTessellationTwoPassTransparent" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTessellationTwoPassTransparent" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTessellationTwoPassTransparent" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTessellationTwoPassTransparent" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTessellationTwoPassTransparent" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTessellationTwoPassTransparent" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTessellationTwoPassTransparent" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTessellationTwoPassTransparent" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -370,6 +401,12 @@ Shader "Hidden/lilToonTessellationTwoPassTransparent" _TessStrength ("Tessellation Strength", Range(0, 1)) = 0.5 _TessShrink ("Tessellation Shrink", Range(0, 1)) = 0.0 [IntRange] _TessFactorMax ("Tessellation Max", Range(1, 8)) = 3 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_tess_twotrans_o.shader b/Assets/lilToon/Shader/lts_tess_twotrans_o.shader index 5b4038df..7130eea8 100644 --- a/Assets/lilToon/Shader/lts_tess_twotrans_o.shader +++ b/Assets/lilToon/Shader/lts_tess_twotrans_o.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTessellationTwoPassTransparentOutline" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTessellationTwoPassTransparentOutline" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTessellationTwoPassTransparentOutline" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTessellationTwoPassTransparentOutline" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTessellationTwoPassTransparentOutline" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTessellationTwoPassTransparentOutline" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTessellationTwoPassTransparentOutline" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTessellationTwoPassTransparentOutline" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTessellationTwoPassTransparentOutline" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTessellationTwoPassTransparentOutline" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -411,6 +442,12 @@ Shader "Hidden/lilToonTessellationTwoPassTransparentOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_trans.shader b/Assets/lilToon/Shader/lts_trans.shader index 9fb9e377..bf664281 100644 --- a/Assets/lilToon/Shader/lts_trans.shader +++ b/Assets/lilToon/Shader/lts_trans.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTransparent" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTransparent" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTransparent" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTransparent" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTransparent" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTransparent" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTransparent" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTransparent" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTransparent" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTransparent" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -363,6 +394,12 @@ Shader "Hidden/lilToonTransparent" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_trans_o.shader b/Assets/lilToon/Shader/lts_trans_o.shader index e619be39..eb86abc1 100644 --- a/Assets/lilToon/Shader/lts_trans_o.shader +++ b/Assets/lilToon/Shader/lts_trans_o.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTransparentOutline" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTransparentOutline" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTransparentOutline" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTransparentOutline" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTransparentOutline" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTransparentOutline" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTransparentOutline" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTransparentOutline" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTransparentOutline" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTransparentOutline" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -404,6 +435,12 @@ Shader "Hidden/lilToonTransparentOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_twotrans.shader b/Assets/lilToon/Shader/lts_twotrans.shader index 37e49eba..7dc2fc28 100644 --- a/Assets/lilToon/Shader/lts_twotrans.shader +++ b/Assets/lilToon/Shader/lts_twotrans.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTwoPassTransparent" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTwoPassTransparent" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTwoPassTransparent" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTwoPassTransparent" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTwoPassTransparent" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTwoPassTransparent" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTwoPassTransparent" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTwoPassTransparent" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTwoPassTransparent" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTwoPassTransparent" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -363,6 +394,12 @@ Shader "Hidden/lilToonTwoPassTransparent" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/lts_twotrans_o.shader b/Assets/lilToon/Shader/lts_twotrans_o.shader index 53475dac..b5f7da92 100644 --- a/Assets/lilToon/Shader/lts_twotrans_o.shader +++ b/Assets/lilToon/Shader/lts_twotrans_o.shader @@ -54,7 +54,7 @@ Shader "Hidden/lilToonTwoPassTransparentOutline" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -81,7 +81,7 @@ Shader "Hidden/lilToonTwoPassTransparentOutline" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -102,6 +102,27 @@ Shader "Hidden/lilToonTwoPassTransparentOutline" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -112,6 +133,7 @@ Shader "Hidden/lilToonTwoPassTransparentOutline" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -147,9 +169,10 @@ Shader "Hidden/lilToonTwoPassTransparentOutline" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -157,15 +180,18 @@ Shader "Hidden/lilToonTwoPassTransparentOutline" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -174,15 +200,18 @@ Shader "Hidden/lilToonTwoPassTransparentOutline" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -197,6 +226,7 @@ Shader "Hidden/lilToonTwoPassTransparentOutline" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -216,6 +246,7 @@ Shader "Hidden/lilToonTwoPassTransparentOutline" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -299,7 +330,7 @@ Shader "Hidden/lilToonTwoPassTransparentOutline" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -404,6 +435,12 @@ Shader "Hidden/lilToonTwoPassTransparentOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsl.shader b/Assets/lilToon/Shader/ltsl.shader index aca39963..0743fa1c 100644 --- a/Assets/lilToon/Shader/ltsl.shader +++ b/Assets/lilToon/Shader/ltsl.shader @@ -42,10 +42,12 @@ Shader "Hidden/lilToonLite" //---------------------------------------------------------------------------------------------------------------------- // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 [lilToggle] _MatCapMul ("Multiply", Int) = 0 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Rim @@ -92,6 +94,12 @@ Shader "Hidden/lilToonLite" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsl_cutout.shader b/Assets/lilToon/Shader/ltsl_cutout.shader index db94e402..bc6d1f84 100644 --- a/Assets/lilToon/Shader/ltsl_cutout.shader +++ b/Assets/lilToon/Shader/ltsl_cutout.shader @@ -42,10 +42,12 @@ Shader "Hidden/lilToonLiteCutout" //---------------------------------------------------------------------------------------------------------------------- // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 [lilToggle] _MatCapMul ("Multiply", Int) = 0 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Rim @@ -92,6 +94,12 @@ Shader "Hidden/lilToonLiteCutout" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 1 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsl_cutout_o.shader b/Assets/lilToon/Shader/ltsl_cutout_o.shader index 50cfa52b..a67943e2 100644 --- a/Assets/lilToon/Shader/ltsl_cutout_o.shader +++ b/Assets/lilToon/Shader/ltsl_cutout_o.shader @@ -42,10 +42,12 @@ Shader "Hidden/lilToonLiteCutoutOutline" //---------------------------------------------------------------------------------------------------------------------- // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 [lilToggle] _MatCapMul ("Multiply", Int) = 0 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Rim @@ -132,6 +134,12 @@ Shader "Hidden/lilToonLiteCutoutOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 1 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsl_o.shader b/Assets/lilToon/Shader/ltsl_o.shader index b9dffef7..b502afe2 100644 --- a/Assets/lilToon/Shader/ltsl_o.shader +++ b/Assets/lilToon/Shader/ltsl_o.shader @@ -42,10 +42,12 @@ Shader "Hidden/lilToonLiteOutline" //---------------------------------------------------------------------------------------------------------------------- // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 [lilToggle] _MatCapMul ("Multiply", Int) = 0 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Rim @@ -132,6 +134,12 @@ Shader "Hidden/lilToonLiteOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsl_onetrans.shader b/Assets/lilToon/Shader/ltsl_onetrans.shader index 5007248d..fac49713 100644 --- a/Assets/lilToon/Shader/ltsl_onetrans.shader +++ b/Assets/lilToon/Shader/ltsl_onetrans.shader @@ -42,10 +42,12 @@ Shader "Hidden/lilToonLiteOnePassTransparent" //---------------------------------------------------------------------------------------------------------------------- // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 [lilToggle] _MatCapMul ("Multiply", Int) = 0 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Rim @@ -92,6 +94,12 @@ Shader "Hidden/lilToonLiteOnePassTransparent" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsl_onetrans_o.shader b/Assets/lilToon/Shader/ltsl_onetrans_o.shader index 9c866fbb..0a028f5c 100644 --- a/Assets/lilToon/Shader/ltsl_onetrans_o.shader +++ b/Assets/lilToon/Shader/ltsl_onetrans_o.shader @@ -42,10 +42,12 @@ Shader "Hidden/lilToonLiteOnePassTransparentOutline" //---------------------------------------------------------------------------------------------------------------------- // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 [lilToggle] _MatCapMul ("Multiply", Int) = 0 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Rim @@ -132,6 +134,12 @@ Shader "Hidden/lilToonLiteOnePassTransparentOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsl_overlay.shader b/Assets/lilToon/Shader/ltsl_overlay.shader index 952b330d..6090e6a6 100644 --- a/Assets/lilToon/Shader/ltsl_overlay.shader +++ b/Assets/lilToon/Shader/ltsl_overlay.shader @@ -42,10 +42,12 @@ Shader "_lil/[Optional] lilToonLiteOverlay" //---------------------------------------------------------------------------------------------------------------------- // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 [lilToggle] _MatCapMul ("Multiply", Int) = 0 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Rim @@ -92,6 +94,12 @@ Shader "_lil/[Optional] lilToonLiteOverlay" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsl_overlay_one.shader b/Assets/lilToon/Shader/ltsl_overlay_one.shader index 84fe7438..e08251d0 100644 --- a/Assets/lilToon/Shader/ltsl_overlay_one.shader +++ b/Assets/lilToon/Shader/ltsl_overlay_one.shader @@ -42,10 +42,12 @@ Shader "_lil/[Optional] lilToonLiteOverlayOnePass" //---------------------------------------------------------------------------------------------------------------------- // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 [lilToggle] _MatCapMul ("Multiply", Int) = 0 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Rim @@ -92,6 +94,12 @@ Shader "_lil/[Optional] lilToonLiteOverlayOnePass" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsl_trans.shader b/Assets/lilToon/Shader/ltsl_trans.shader index 9e0bb342..fb9bbde6 100644 --- a/Assets/lilToon/Shader/ltsl_trans.shader +++ b/Assets/lilToon/Shader/ltsl_trans.shader @@ -42,10 +42,12 @@ Shader "Hidden/lilToonLiteTransparent" //---------------------------------------------------------------------------------------------------------------------- // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 [lilToggle] _MatCapMul ("Multiply", Int) = 0 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Rim @@ -92,6 +94,12 @@ Shader "Hidden/lilToonLiteTransparent" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsl_trans_o.shader b/Assets/lilToon/Shader/ltsl_trans_o.shader index 833eabdf..263b342e 100644 --- a/Assets/lilToon/Shader/ltsl_trans_o.shader +++ b/Assets/lilToon/Shader/ltsl_trans_o.shader @@ -42,10 +42,12 @@ Shader "Hidden/lilToonLiteTransparentOutline" //---------------------------------------------------------------------------------------------------------------------- // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 [lilToggle] _MatCapMul ("Multiply", Int) = 0 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Rim @@ -132,6 +134,12 @@ Shader "Hidden/lilToonLiteTransparentOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsl_twotrans.shader b/Assets/lilToon/Shader/ltsl_twotrans.shader index 5a2964fd..cd69844b 100644 --- a/Assets/lilToon/Shader/ltsl_twotrans.shader +++ b/Assets/lilToon/Shader/ltsl_twotrans.shader @@ -42,10 +42,12 @@ Shader "Hidden/lilToonLiteTwoPassTransparent" //---------------------------------------------------------------------------------------------------------------------- // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 [lilToggle] _MatCapMul ("Multiply", Int) = 0 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Rim @@ -92,6 +94,12 @@ Shader "Hidden/lilToonLiteTwoPassTransparent" _OffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _ColorMask ("Color Mask", Int) = 15 [lilToggle] _AlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsl_twotrans_o.shader b/Assets/lilToon/Shader/ltsl_twotrans_o.shader index af818b39..6d6ef2a8 100644 --- a/Assets/lilToon/Shader/ltsl_twotrans_o.shader +++ b/Assets/lilToon/Shader/ltsl_twotrans_o.shader @@ -42,10 +42,12 @@ Shader "Hidden/lilToonLiteTwoPassTransparentOutline" //---------------------------------------------------------------------------------------------------------------------- // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 [lilToggle] _MatCapMul ("Multiply", Int) = 0 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Rim @@ -132,6 +134,12 @@ Shader "Hidden/lilToonLiteTwoPassTransparentOutline" _OutlineOffsetUnits ("Offset Units", Float) = 0 [lilColorMask] _OutlineColorMask ("Color Mask", Int) = 15 [lilToggle] _OutlineAlphaToMask ("AlphaToMask", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } //---------------------------------------------------------------------------------------------------------------------- diff --git a/Assets/lilToon/Shader/ltsmulti.shader b/Assets/lilToon/Shader/ltsmulti.shader index 44fbfe68..8dee9ce2 100644 --- a/Assets/lilToon/Shader/ltsmulti.shader +++ b/Assets/lilToon/Shader/ltsmulti.shader @@ -2,7 +2,6 @@ Shader "_lil/lilToonMulti" { // Memo // If you are using Unity 2018 or earlier, you need to replace `shader_feature_local` with` shader_feature`. - // Also, if you need to include all variations in mod development etc., you may need to replace "shader_feature_local" with "multi_compile_local". // If there are too many variants, you should also replace them with #define. Properties @@ -59,7 +58,7 @@ Shader "_lil/lilToonMulti" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -86,7 +85,7 @@ Shader "_lil/lilToonMulti" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -107,6 +106,27 @@ Shader "_lil/lilToonMulti" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -117,6 +137,7 @@ Shader "_lil/lilToonMulti" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -152,9 +173,10 @@ Shader "_lil/lilToonMulti" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -162,15 +184,18 @@ Shader "_lil/lilToonMulti" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -179,15 +204,18 @@ Shader "_lil/lilToonMulti" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -202,6 +230,7 @@ Shader "_lil/lilToonMulti" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -221,6 +250,7 @@ Shader "_lil/lilToonMulti" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -304,7 +334,7 @@ Shader "_lil/lilToonMulti" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -417,6 +447,12 @@ Shader "_lil/lilToonMulti" [lilToggle] _UsePOM ("Use POM", Int) = 0 [lilToggle] _UseClippingCanceller ("Use Clipping Canceller", Int) = 0 [lilToggle] _AsOverlay ("As Overlay", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } HLSLINCLUDE @@ -431,6 +467,7 @@ Shader "_lil/lilToonMulti" #define LIL_MULTI_INPUTS_EMISSION_2ND #define LIL_MULTI_INPUTS_NORMAL #define LIL_MULTI_INPUTS_NORMAL_2ND + #define LIL_MULTI_INPUTS_ANISOTROPY #define LIL_MULTI_INPUTS_REFLECTION #define LIL_MULTI_INPUTS_MATCAP #define LIL_MULTI_INPUTS_MATCAP_2ND @@ -510,6 +547,7 @@ Shader "_lil/lilToonMulti" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF @@ -653,6 +691,7 @@ Shader "_lil/lilToonMulti" #pragma shader_feature_local GEOM_TYPE_FROND #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF @@ -824,6 +863,7 @@ Shader "_lil/lilToonMulti" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF @@ -1091,6 +1131,7 @@ Shader "_lil/lilToonMulti" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF @@ -1361,6 +1402,7 @@ Shader "_lil/lilToonMulti" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF @@ -1701,6 +1743,7 @@ Shader "_lil/lilToonMulti" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF @@ -2043,6 +2086,7 @@ Shader "_lil/lilToonMulti" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF diff --git a/Assets/lilToon/Shader/ltsmulti_fur.shader b/Assets/lilToon/Shader/ltsmulti_fur.shader index 70ed1c36..e2daea1b 100644 --- a/Assets/lilToon/Shader/ltsmulti_fur.shader +++ b/Assets/lilToon/Shader/ltsmulti_fur.shader @@ -1,5 +1,9 @@ Shader "Hidden/lilToonMultiFur" { + // Memo + // If you are using Unity 2018 or earlier, you need to replace `shader_feature_local` with` shader_feature`. + // If there are too many variants, you should also replace them with #define. + Properties { //---------------------------------------------------------------------------------------------------------------------- @@ -50,7 +54,7 @@ Shader "Hidden/lilToonMultiFur" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Encryption @@ -136,6 +140,12 @@ Shader "Hidden/lilToonMultiFur" [lilToggle] _UsePOM ("Use POM", Int) = 0 [lilToggle] _UseClippingCanceller ("Use Clipping Canceller", Int) = 0 [lilToggle] _AsOverlay ("As Overlay", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } HLSLINCLUDE #pragma require geometry diff --git a/Assets/lilToon/Shader/ltsmulti_gem.shader b/Assets/lilToon/Shader/ltsmulti_gem.shader index 693c20cd..e3c0fba9 100644 --- a/Assets/lilToon/Shader/ltsmulti_gem.shader +++ b/Assets/lilToon/Shader/ltsmulti_gem.shader @@ -2,7 +2,6 @@ Shader "Hidden/lilToonMultiGem" { // Memo // If you are using Unity 2018 or earlier, you need to replace `shader_feature_local` with` shader_feature`. - // Also, if you need to include all variations in mod development etc., you may need to replace "shader_feature_local" with "multi_compile_local". // If there are too many variants, you should also replace them with #define. Properties @@ -59,7 +58,7 @@ Shader "Hidden/lilToonMultiGem" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -86,7 +85,7 @@ Shader "Hidden/lilToonMultiGem" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -107,6 +106,27 @@ Shader "Hidden/lilToonMultiGem" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Shadow [lilToggleLeft] _UseShadow ("Use Shadow", Int) = 0 @@ -141,9 +161,10 @@ Shader "Hidden/lilToonMultiGem" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -151,15 +172,18 @@ Shader "Hidden/lilToonMultiGem" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -168,15 +192,18 @@ Shader "Hidden/lilToonMultiGem" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -191,6 +218,7 @@ Shader "Hidden/lilToonMultiGem" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -210,6 +238,7 @@ Shader "Hidden/lilToonMultiGem" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -293,7 +322,7 @@ Shader "Hidden/lilToonMultiGem" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -373,6 +402,12 @@ Shader "Hidden/lilToonMultiGem" [lilToggle] _UsePOM ("Use POM", Int) = 0 [lilToggle] _UseClippingCanceller ("Use Clipping Canceller", Int) = 0 [lilToggle] _AsOverlay ("As Overlay", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } HLSLINCLUDE @@ -382,6 +417,7 @@ Shader "Hidden/lilToonMultiGem" #define LIL_MULTI_INPUTS_EMISSION_2ND #define LIL_MULTI_INPUTS_NORMAL #define LIL_MULTI_INPUTS_NORMAL_2ND + #define LIL_MULTI_INPUTS_ANISOTROPY #define LIL_MULTI_INPUTS_MATCAP #define LIL_MULTI_INPUTS_MATCAP_2ND #define LIL_MULTI_INPUTS_RIM @@ -485,6 +521,7 @@ Shader "Hidden/lilToonMultiGem" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF #pragma shader_feature_local GEOM_TYPE_MESH @@ -669,6 +706,7 @@ Shader "Hidden/lilToonMultiGem" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF #pragma shader_feature_local GEOM_TYPE_MESH @@ -876,6 +914,7 @@ Shader "Hidden/lilToonMultiGem" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF #pragma shader_feature_local GEOM_TYPE_MESH @@ -1090,6 +1129,7 @@ Shader "Hidden/lilToonMultiGem" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF #pragma shader_feature_local GEOM_TYPE_MESH @@ -1367,6 +1407,7 @@ Shader "Hidden/lilToonMultiGem" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF #pragma shader_feature_local GEOM_TYPE_MESH @@ -1650,6 +1691,7 @@ Shader "Hidden/lilToonMultiGem" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF #pragma shader_feature_local GEOM_TYPE_MESH diff --git a/Assets/lilToon/Shader/ltsmulti_ref.shader b/Assets/lilToon/Shader/ltsmulti_ref.shader index f5583299..8973da9c 100644 --- a/Assets/lilToon/Shader/ltsmulti_ref.shader +++ b/Assets/lilToon/Shader/ltsmulti_ref.shader @@ -2,7 +2,6 @@ Shader "Hidden/lilToonMultiRefraction" { // Memo // If you are using Unity 2018 or earlier, you need to replace `shader_feature_local` with` shader_feature`. - // Also, if you need to include all variations in mod development etc., you may need to replace "shader_feature_local" with "multi_compile_local". // If there are too many variants, you should also replace them with #define. Properties @@ -59,7 +58,7 @@ Shader "Hidden/lilToonMultiRefraction" [lilHDR] _Main2ndDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main2ndDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main2ndDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main2ndDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main2ndDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Main3rd @@ -86,7 +85,7 @@ Shader "Hidden/lilToonMultiRefraction" [lilHDR] _Main3rdDissolveColor ("Dissolve Color", Color) = (1,1,1,1) [lilDissolve] _Main3rdDissolveParams ("Dissolve Mode|None|Alpha|UV|Position|Dissolve Shape|Point|Line|Border|Blur", Vector) = (0,0,0.5,0.1) [lilDissolveP] _Main3rdDissolvePos ("Dissolve Position", Vector) = (0,0,0,0) - [lil3Param] _Main3rdDistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _Main3rdDistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // Alpha Mask @@ -107,6 +106,27 @@ Shader "Hidden/lilToonMultiRefraction" _Bump2ndScale ("Scale", Range(-10,10)) = 1 [NoScaleOffset] _Bump2ndScaleMask ("Mask", 2D) = "white" {} + //---------------------------------------------------------------------------------------------------------------------- + // Anisotropy + [lilToggleLeft] _UseAnisotropy ("Use Anisotropy", Int) = 0 + [Normal] _AnisotropyTangentMap ("Tangent Map", 2D) = "bump" {} + _AnisotropyScale ("Scale", Range(-1,1)) = 1 + [NoScaleOffset] _AnisotropyScaleMask ("Scale Mask", 2D) = "white" {} + _AnisotropyTangentWidth ("Tangent Width", Range(0,10)) = 1 + _AnisotropyBitangentWidth ("Bitangent Width", Range(0,10)) = 1 + _AnisotropyShift ("Shift", Range(-10,10)) = 0 + _AnisotropyShiftNoiseScale ("Shift Noise Scale", Range(-1,1)) = 0 + _AnisotropySpecularStrength ("Specular Strength", Range(0,10)) = 1 + _Anisotropy2ndTangentWidth ("2nd Tangent Width", Range(0,10)) = 1 + _Anisotropy2ndBitangentWidth ("2nd Bitangent Width", Range(0,10)) = 1 + _Anisotropy2ndShift ("2nd Shift", Range(-10,10)) = 0 + _Anisotropy2ndShiftNoiseScale ("2nd Shift Noise Scale", Range(-1,1)) = 0 + _Anisotropy2ndSpecularStrength ("2nd Specular Strength", Range(0,10)) = 0 + _AnisotropyShiftNoiseMask ("Shift Noise Mask", 2D) = "white" {} + [lilToggle] _Anisotropy2Reflection ("Reflection", Int) = 0 + [lilToggle] _Anisotropy2MatCap ("MatCap", Int) = 0 + [lilToggle] _Anisotropy2MatCap2nd ("MatCap 2nd", Int) = 0 + //---------------------------------------------------------------------------------------------------------------------- // Backlight [lilToggleLeft] _UseBacklight ("Use Backlight", Int) = 0 @@ -117,6 +137,7 @@ Shader "Hidden/lilToonMultiRefraction" _BacklightDirectivity ("Directivity", Float) = 5.0 _BacklightViewStrength ("View direction strength", Range(0, 1)) = 1 [lilToggle] _BacklightReceiveShadow ("Receive Shadow", Int) = 1 + [lilToggle] _BacklightBackfaceMask ("Backface Mask", Int) = 1 //---------------------------------------------------------------------------------------------------------------------- // Shadow @@ -152,9 +173,10 @@ Shader "Hidden/lilToonMultiRefraction" [Gamma] _Reflectance ("Reflectance", Range(0, 1)) = 0.04 // Reflection [lilToggle] _ApplySpecular ("Apply Specular", Int) = 1 + [lilToggle] _ApplySpecularFA ("Apply Specular in ForwardAdd", Int) = 1 [lilToggle] _SpecularToon ("Specular Toon", Int) = 1 [lilToggle] _ApplyReflection ("Apply Reflection", Int) = 0 - _ReflectionColor ("Color", Color) = (1,1,1,1) + [lilHDR] _ReflectionColor ("Color", Color) = (1,1,1,1) [NoScaleOffset] _ReflectionColorTex ("Color", 2D) = "white" {} [lilToggle] _ReflectionApplyTransparency ("Apply Transparency", Int) = 1 @@ -162,15 +184,18 @@ Shader "Hidden/lilToonMultiRefraction" // MatCap [lilToggleLeft] _UseMatCap ("Use MatCap", Int) = 0 [lilHDR] _MatCapColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCapTex ("Texture", 2D) = "white" {} + _MatCapTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCapBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCapPerspective ("Fix Perspective", Int) = 1 + _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCapBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCapBlendMask ("Mask", 2D) = "white" {} _MatCapEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCapShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCapVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCapBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCapBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCapApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCapZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCapCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCapBumpMap ("Normal Map", 2D) = "bump" {} _MatCapBumpScale ("Scale", Range(-10,10)) = 1 @@ -179,15 +204,18 @@ Shader "Hidden/lilToonMultiRefraction" // MatCap 2nd [lilToggleLeft] _UseMatCap2nd ("Use MatCap 2nd", Int) = 0 [lilHDR] _MatCap2ndColor ("Color", Color) = (1,1,1,1) - [NoScaleOffset] _MatCap2ndTex ("Texture", 2D) = "white" {} + _MatCap2ndTex ("Texture", 2D) = "white" {} + [lilVec2R] _MatCap2ndBlendUV1 ("Blend UV1", Vector) = (0,0,0,0) + [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 + [lilToggle] _MatCap2ndPerspective ("Fix Perspective", Int) = 1 + _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 _MatCap2ndBlend ("Blend", Range(0, 1)) = 1 [NoScaleOffset] _MatCap2ndBlendMask ("Mask", 2D) = "white" {} _MatCap2ndEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _MatCap2ndShadowMask ("Shadow Mask", Range(0, 1)) = 0 - _MatCap2ndVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 + [lilToggle] _MatCap2ndBackfaceMask ("Backface Mask", Int) = 0 [lilEnum] _MatCap2ndBlendMode ("Blend Mode|Normal|Add|Screen|Multiply", Int) = 1 [lilToggle] _MatCap2ndApplyTransparency ("Apply Transparency", Int) = 1 - [lilToggle] _MatCap2ndZRotCancel ("Z-axis rotation cancellation", Int) = 1 [lilToggle] _MatCap2ndCustomNormal ("MatCap Custom Normal Map", Int) = 0 [Normal] _MatCap2ndBumpMap ("Normal Map", 2D) = "bump" {} _MatCap2ndBumpScale ("Scale", Range(-10,10)) = 1 @@ -202,6 +230,7 @@ Shader "Hidden/lilToonMultiRefraction" [PowerSlider(3.0)]_RimFresnelPower ("Fresnel Power", Range(0.01, 50)) = 3.0 _RimEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _RimShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _RimBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _RimApplyTransparency ("Apply Transparency", Int) = 1 _RimDirStrength ("Light direction strength", Range(0, 1)) = 0 _RimDirRange ("Direction range", Range(-1, 1)) = 0 @@ -221,6 +250,7 @@ Shader "Hidden/lilToonMultiRefraction" [lilGlitParam2] _GlitterParams2 ("Blink Speed|Angle|Blend Light Direction|Color Randomness", Vector) = (0.25,0,0,0) _GlitterEnableLighting ("Enable Lighting", Range(0, 1)) = 1 _GlitterShadowMask ("Shadow Mask", Range(0, 1)) = 0 + [lilToggle] _GlitterBackfaceMask ("Backface Mask", Int) = 0 [lilToggle] _GlitterApplyTransparency ("Apply Transparency", Int) = 1 _GlitterVRParallaxStrength ("VR Parallax Strength", Range(0, 1)) = 1 @@ -304,7 +334,7 @@ Shader "Hidden/lilToonMultiRefraction" //---------------------------------------------------------------------------------------------------------------------- // Distance Fade [lilHDR] _DistanceFadeColor ("Color", Color) = (0,0,0,1) - [lil3Param] _DistanceFade ("Start|End|Strength", Vector) = (0.1,0.01,0,0) + [lilFFFB] _DistanceFade ("Start|End|Strength|Fix backface", Vector) = (0.1,0.01,0,0) //---------------------------------------------------------------------------------------------------------------------- // AudioLink @@ -383,6 +413,12 @@ Shader "Hidden/lilToonMultiRefraction" [lilToggle] _UsePOM ("Use POM", Int) = 0 [lilToggle] _UseClippingCanceller ("Use Clipping Canceller", Int) = 0 [lilToggle] _AsOverlay ("As Overlay", Int) = 0 + + //---------------------------------------------------------------------------------------------------------------------- + // Save (Unused) + [HideInInspector] [MainColor] _BaseColor ("Color", Color) = (1,1,1,1) + [HideInInspector] [MainTexture] _BaseMap ("Texture", 2D) = "white" {} + [HideInInspector] _BaseColorMap ("Texture", 2D) = "white" {} } HLSLINCLUDE @@ -398,6 +434,7 @@ Shader "Hidden/lilToonMultiRefraction" #define LIL_MULTI_INPUTS_EMISSION_2ND #define LIL_MULTI_INPUTS_NORMAL #define LIL_MULTI_INPUTS_NORMAL_2ND + #define LIL_MULTI_INPUTS_ANISOTROPY #define LIL_MULTI_INPUTS_REFLECTION #define LIL_MULTI_INPUTS_MATCAP #define LIL_MULTI_INPUTS_MATCAP_2ND @@ -475,6 +512,7 @@ Shader "Hidden/lilToonMultiRefraction" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF @@ -553,6 +591,7 @@ Shader "Hidden/lilToonMultiRefraction" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF @@ -716,6 +755,7 @@ Shader "Hidden/lilToonMultiRefraction" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF @@ -903,6 +943,7 @@ Shader "Hidden/lilToonMultiRefraction" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF @@ -1094,6 +1135,7 @@ Shader "Hidden/lilToonMultiRefraction" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF @@ -1350,6 +1392,7 @@ Shader "Hidden/lilToonMultiRefraction" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF @@ -1609,6 +1652,7 @@ Shader "Hidden/lilToonMultiRefraction" #pragma shader_feature_local _SUNDISK_SIMPLE #pragma shader_feature_local _NORMALMAP #pragma shader_feature_local EFFECT_BUMP + #pragma shader_feature_local SOURCE_GBUFFER #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF diff --git a/Assets/lilToon/Texture/lil_tangent.png b/Assets/lilToon/Texture/lil_tangent.png new file mode 100644 index 00000000..89ce1142 --- /dev/null +++ b/Assets/lilToon/Texture/lil_tangent.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2858e3ed3ceb4aef33dd35e45446d904894153c7ae830ae063105c807ab7ff8c +size 163 diff --git a/Assets/lilToon/Texture/lil_tangent.png.meta b/Assets/lilToon/Texture/lil_tangent.png.meta new file mode 100644 index 00000000..003ad549 --- /dev/null +++ b/Assets/lilToon/Texture/lil_tangent.png.meta @@ -0,0 +1,180 @@ +fileFormatVersion: 2 +guid: 8704ec8533a146d4daf20c45658e92ab +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Lumin + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: tvOS + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/lilToon/Third Party Notices.md b/Assets/lilToon/Third Party Notices.md index a7c851fc..b1ec42fa 100644 --- a/Assets/lilToon/Third Party Notices.md +++ b/Assets/lilToon/Third Party Notices.md @@ -143,6 +143,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## Article +- [Physically Based Rendering in Filament](https://google.github.io/filament/Filament.html) - [Optimized inverse trigonometric function (seblagarde)](https://seblagarde.wordpress.com/2014/12/01/inverse-trigonometric-functions-gpu-optimization-for-amd-gcn-architecture/) - [視差オクルージョンマッピング(parallax occlution mapping) (コポコポ)](https://coposuke.hateblo.jp/entry/2019/01/20/043042) -- [sRGB Approximations for HLSL](http://chilliant.blogspot.com/2012/08/srgb-approximations-for-hlsl.html?m=1) \ No newline at end of file +- [sRGB Approximations for HLSL](http://chilliant.blogspot.com/2012/08/srgb-approximations-for-hlsl.html?m=1) +- [『崩壊3rd』開発者が語るアニメ風レンダリングの極意](https://learning.unity3d.jp/570/) \ No newline at end of file diff --git a/version.json b/version.json index d5e2729a..ecab874c 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{"latest_vertion_name": "1.2.2", "latest_vertion_value": 15} \ No newline at end of file +{"latest_vertion_name": "1.2.3", "latest_vertion_value": 16} \ No newline at end of file