diff --git a/_PoiyomiShaders/Scripts/ThryEditor/Editor/Config.cs b/_PoiyomiShaders/Scripts/ThryEditor/Editor/Config.cs
index fdc1454..cfec4c3 100644
--- a/_PoiyomiShaders/Scripts/ThryEditor/Editor/Config.cs
+++ b/_PoiyomiShaders/Scripts/ThryEditor/Editor/Config.cs
@@ -16,7 +16,7 @@ public class Config
{
// consts
private const string PATH_CONFIG_FILE = "Thry/Config.json";
- private const string VERSION = "2.30.0";
+ private const string VERSION = "2.30.5";
// static
private static Config config;
diff --git a/_PoiyomiShaders/Scripts/ThryEditor/Editor/Drawers.cs b/_PoiyomiShaders/Scripts/ThryEditor/Editor/Drawers.cs
index ea842d5..fc0a25f 100644
--- a/_PoiyomiShaders/Scripts/ThryEditor/Editor/Drawers.cs
+++ b/_PoiyomiShaders/Scripts/ThryEditor/Editor/Drawers.cs
@@ -240,7 +240,7 @@ public override float GetPropertyHeight(MaterialProperty prop, string label, Mat
public class ThryRGBAPackerDrawer : MaterialPropertyDrawer
{
-
+ // TODO : Load lacale by property name in the future: propname_r, propname_g, propname_b, propname_a
class ThryRGBAPackerData
{
public Texture _previousTexture;
@@ -306,7 +306,10 @@ public ThryRGBAPackerDrawer(string label1, string label2, string label3, string
_defaultLabel2 = label2;
_defaultLabel3 = label3;
_defaultLabel4 = label4;
- LoadLabels();
+ _label1 = label1;
+ _label2 = label2;
+ _label3 = label3;
+ _label4 = label4;
_makeSRGB = sRGB == 1;
}
@@ -923,11 +926,13 @@ public ThryToggleDrawer(string keyword, string left)
protected void SetKeyword(MaterialProperty prop, bool on)
{
+ if(ShaderOptimizer.IsMaterialLocked(prop.targets[0] as Material)) return;
SetKeywordInternal(prop, on, "_ON");
}
protected void CheckKeyword(MaterialProperty prop)
{
+ if(ShaderEditor.Active != null && ShaderOptimizer.IsMaterialLocked(prop.targets[0] as Material)) return;
if (prop.hasMixedValue)
{
foreach (Material m in prop.targets)
@@ -1655,10 +1660,11 @@ public override float GetPropertyHeight(MaterialProperty prop, string label, Mat
// Adapted from Unity interal MaterialEnumDrawer https://github.com/Unity-Technologies/UnityCsReference/
public class ThryWideEnumDrawer : MaterialPropertyDrawer
{
+ // TODO: Consider Load locale by property name in the future (maybe, could have drawbacks)
private GUIContent[] names;
private readonly string[] defaultNames;
private readonly float[] values;
- private int _reloadCount;
+ private int _reloadCount = -1;
private static int _reloadCountStatic;
// internal Unity AssemblyHelper can't be accessed
@@ -1725,7 +1731,11 @@ public ThryWideEnumDrawer(string n1, float v1, string n2, float v2, string n3, f
public ThryWideEnumDrawer(string[] enumNames, float[] vals)
{
defaultNames = enumNames;
- LoadNames();
+
+ // Init without Locale to prevent errors
+ names = new GUIContent[enumNames.Length];
+ for (int i = 0; i < enumNames.Length; ++i)
+ names[i] = new GUIContent(enumNames[i]);
values = new float[vals.Length];
for (int i = 0; i < vals.Length; ++i)
@@ -1740,7 +1750,6 @@ void LoadNames()
names[i] = new GUIContent(ShaderEditor.Active.Locale.Get(defaultNames[i], defaultNames[i]));
}
}
-
public static void Reload()
{
_reloadCountStatic++;
diff --git a/_PoiyomiShaders/Scripts/ThryEditor/Editor/Localization.cs b/_PoiyomiShaders/Scripts/ThryEditor/Editor/Localization.cs
index 78c555f..e08c51a 100644
--- a/_PoiyomiShaders/Scripts/ThryEditor/Editor/Localization.cs
+++ b/_PoiyomiShaders/Scripts/ThryEditor/Editor/Localization.cs
@@ -176,6 +176,15 @@ void Save()
AssetDatabase.SaveAssets();
}
+ void Clear()
+ {
+ _defaultKeys = new string[0];
+ _defaultValues = new string[0];
+ _keys = new string[0];
+ _values = new string[0];
+ Languages = new string[0];
+ }
+
[MenuItem("Assets/Thry/Shaders/Create Locale File", false)]
static void CreateLocale()
{
@@ -222,6 +231,71 @@ public class LocaleEditor : Editor
string _translateByValueOut = "";
string _autoTranslateLanguageShortCode = "EN";
+ string ToCSVString(string s)
+ {
+ return "\"" + s.Replace("\"", "“") + "\"";
+ }
+
+ string FromCSVString(string s)
+ {
+ return s.Trim('"').Replace("“", "\"");
+ }
+
+ void ExportAsCSV(Localization locale)
+ {
+ string path = EditorUtility.SaveFilePanel("Export as CSV", "", locale.name, "csv");
+ if (string.IsNullOrEmpty(path) == false)
+ {
+ System.Text.StringBuilder sb = new System.Text.StringBuilder();
+ foreach (string language in locale.Languages)
+ {
+ sb.Append("," + ToCSVString(language));
+ }
+ sb.AppendLine();
+ for(int i = 0;i < locale._keys.Length; i++)
+ {
+ sb.Append(ToCSVString(locale._keys[i]));
+ for(int j = 0; j < locale.Languages.Length; j++)
+ {
+ sb.Append("," + ToCSVString(locale._values[i * locale.Languages.Length + j]));
+ }
+ sb.AppendLine();
+ }
+ File.WriteAllText(path, sb.ToString());
+ }
+ }
+
+ void LoadFromCSV(Localization locale)
+ {
+ string path = EditorUtility.OpenFilePanel("Load from CSV", "", "csv");
+ if (string.IsNullOrEmpty(path) == false)
+ {
+ string[] lines = File.ReadAllLines(path);
+ if (lines.Length > 0)
+ {
+ locale.Clear();
+ string[] languages = lines[0].Split(',');
+ for (int i = 1; i < languages.Length; i++)
+ {
+ locale.AddLanguage(FromCSVString(languages[i]));
+ }
+ for (int i = 1; i < lines.Length; i++)
+ {
+ string[] values = lines[i].Split(',');
+ if (values.Length > 0)
+ {
+ string key = FromCSVString(values[0]);
+ for (int j = 1; j < values.Length; j++)
+ {
+ locale._values[(i - 1) * (languages.Length - 1) + j - 1] = FromCSVString(values[j]);
+ }
+ }
+ }
+ locale.Save();
+ }
+ }
+ }
+
void UpdateMissing(Localization locale)
{
_missingKeys.Clear();
@@ -336,8 +410,16 @@ public override void OnInspectorGUI()
UpdateData(locale);
}
+ EditorGUILayout.Space(20);
+ EditorGUILayout.LabelField("Import / Export", EditorStyles.boldLabel);
+ if(GUILayout.Button("Import from CSV"))
+ LoadFromCSV(locale);
+
if(locale.Languages.Length == 0) return;
+ if(GUILayout.Button("Export to CSV"))
+ ExportAsCSV(locale);
+
EditorGUILayout.Space(20);
EditorGUILayout.LabelField("Missing Entries", EditorStyles.boldLabel);
int count = 0;
@@ -376,6 +458,10 @@ public override void OnInspectorGUI()
EditorGUILayout.LabelField("Automatic Translation using Google", EditorStyles.boldLabel);
_autoTranslateLanguageShortCode = EditorGUILayout.TextField("Language Short Code", _autoTranslateLanguageShortCode);
EditorGUILayout.HelpBox("Short code must be valid short code. See https://cloud.google.com/translate/docs/languages for a list of valid short codes.", MessageType.Info);
+ if(Event.current.type == EventType.MouseDown && GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition))
+ {
+ Application.OpenURL("https://cloud.google.com/translate/docs/languages");
+ }
if(GUILayout.Button("Auto Translate"))
{
int _missingKeysCount = _missingKeys.Count;
diff --git a/_PoiyomiShaders/Scripts/ThryEditor/Editor/ShaderOptimizer.cs b/_PoiyomiShaders/Scripts/ThryEditor/Editor/ShaderOptimizer.cs
index 5043b46..d518501 100644
--- a/_PoiyomiShaders/Scripts/ThryEditor/Editor/ShaderOptimizer.cs
+++ b/_PoiyomiShaders/Scripts/ThryEditor/Editor/ShaderOptimizer.cs
@@ -842,6 +842,7 @@ private static bool LockApplyShader(ApplyStruct applyStruct)
material.SetOverrideTag("RenderType", renderType);
material.renderQueue = renderQueue;
+ material.SetOverrideTag("OriginalKeywords", string.Join(" ", material.shaderKeywords));
// Remove ALL keywords
foreach (string keyword in material.shaderKeywords)
if(material.IsKeywordEnabled(keyword)) material.DisableKeyword(keyword);
@@ -1628,6 +1629,7 @@ private static UnlockSuccess UnlockConcrete (Material material)
material.shader = orignalShader;
material.SetOverrideTag("RenderType", renderType);
material.renderQueue = renderQueue;
+ material.shaderKeywords = material.GetTag("OriginalKeywords", false, string.Join(" ", material.shaderKeywords)).Split(' ');
// Delete the variants folder and all files in it, as to not orhpan files and inflate Unity project
diff --git a/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi Early Outline.shader b/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi Early Outline.shader
index 5dfc378..2160b9b 100644
--- a/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi Early Outline.shader
+++ b/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi Early Outline.shader
@@ -2,7 +2,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
{
Properties
{
- [HideInInspector] shader_master_label ("Poiyomi 8.1.156", Float) = 0
+ [HideInInspector] shader_master_label ("Poiyomi 8.1.160", Float) = 0
[HideInInspector] shader_is_using_thry_editor ("", Float) = 0
[HideInInspector] shader_locale ("0db0b86376c3dca4b9a6828ef8615fe0", Float) = 0
[HideInInspector] footer_youtube ("{texture:{name:icon-youtube,height:16},action:{type:URL,data:https://www.youtube.com/poiyomi},hover:YOUTUBE}", Float) = 0
@@ -1340,10 +1340,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
[HideInInspector][ThryToggle(POI_MATCAP0)]_MatcapEnable ("Enable Matcap", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _MatcapUVMode ("UV Mode", Int) = 1
_MatcapColor ("Color--{reference_property:_MatcapColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _MatcapBaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _MatcapColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap ("Matcap", 2D) = "white" { }
_MatcapBorder ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_MatcapMask ("Mask--{reference_properties:[_MatcapMaskPan, _MatcapMaskUV, _MatcapMaskChannel, _MatcapMaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_MatcapMask ("Mask--{reference_properties:[_MatcapMaskPan, _MatcapMaskUV, _MatcapMaskChannel, _MatcapMaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_MatcapMaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _MatcapMaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_MatcapMaskChannel ("Channel", Float) = 0
@@ -1368,6 +1369,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
[ThryToggleUI(true)] _MatcapHueShiftEnabled (" Hue Shift", Float) = 0
_MatcapHueShiftSpeed ("Shift Speed--{condition_showS:(_MatcapHueShiftEnabled==1)}", Float) = 0
_MatcapHueShift ("Hue Shift--{condition_showS:(_MatcapHueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _MatcapSmoothnessEnabled (" Blur", Float) = 0
+ _MatcapSmoothness ("Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_MatcapMaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_MatcapMaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_MatcapTPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _MatcapTPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_MatcapTPSMaskStrength ("TPS Mask Strength--{condition_showS:(_MatcapTPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1381,10 +1386,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
[HideInInspector][ThryToggle(COLOR_GRADING_HDR_3D)]_Matcap2Enable ("Enable Matcap 2", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap2UVMode ("UV Mode", Int) = 1
_Matcap2Color ("Color--{reference_property:_Matcap2ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap2BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap2ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap2 ("Matcap", 2D) = "white" { }
_Matcap2Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap2Mask ("Mask--{reference_properties:[_Matcap2MaskPan, _Matcap2MaskUV, _Matcap2MaskChannel, _Matcap2MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap2Mask ("Mask--{reference_properties:[_Matcap2MaskPan, _Matcap2MaskUV, _Matcap2MaskChannel, _Matcap2MaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_Matcap2MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap2MaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap2MaskChannel ("Channel", Float) = 0
@@ -1410,6 +1416,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
[ThryToggleUI(true)] _Matcap2HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap2HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap2HueShiftEnabled==1)}", Float) = 0
_Matcap2HueShift ("Hue Shift--{condition_showS:(_Matcap2HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap2SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap2Smoothness ("Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap2MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap2MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap2TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap2TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap2TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap2TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1423,10 +1433,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
[HideInInspector][ThryToggle(POI_MATCAP2)]_Matcap3Enable ("Enable Matcap 2", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap3UVMode ("UV Mode", Int) = 1
_Matcap3Color ("Color--{reference_property:_Matcap3ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap3BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap3ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap3 ("Matcap", 2D) = "white" { }
_Matcap3Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap3Mask ("Mask--{reference_properties:[_Matcap3MaskPan, _Matcap3MaskUV, _Matcap3MaskChannel, _Matcap3MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap3Mask ("Mask--{reference_properties:[_Matcap3MaskPan, _Matcap3MaskUV, _Matcap3MaskChannel, _Matcap3MaskInvert]}", 2D) = "white" { }
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap3MaskChannel ("Channel", Float) = 0
[HideInInspector][Vector2]_Matcap3MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap3MaskUV ("UV", Int) = 0
@@ -1452,6 +1463,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
[ThryToggleUI(true)] _Matcap3HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap3HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap3HueShiftEnabled==1)}", Float) = 0
_Matcap3HueShift ("Hue Shift--{condition_showS:(_Matcap3HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap3SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap3Smoothness ("Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap3MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap3MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap3TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap3TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap3TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap3TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1465,10 +1480,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
[HideInInspector][ThryToggle(POI_MATCAP3)]_Matcap4Enable ("Enable Matcap 3", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap4UVMode ("UV Mode", Int) = 1
_Matcap4Color ("Color--{reference_property:_Matcap4ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap4BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap4ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap4 ("Matcap", 2D) = "white" { }
_Matcap4Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap4Mask ("Mask--{reference_properties:[_Matcap4MaskPan, _Matcap4MaskUV, _Matcap4MaskChannel, _Matcap4MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap4Mask ("Mask--{reference_properties:[_Matcap4MaskPan, _Matcap4MaskUV, _Matcap4MaskChannel, _Matcap4MaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_Matcap4MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap4MaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap4MaskChannel ("Channel", Float) = 0
@@ -1494,6 +1510,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
[ThryToggleUI(true)] _Matcap4HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap4HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap4HueShiftEnabled==1)}", Float) = 0
_Matcap4HueShift ("Hue Shift--{condition_showS:(_Matcap4HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap4SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap4Smoothness ("Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap4MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap4MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap4TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap4TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap4TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap4TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -11609,6 +11629,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap;
float4 _Matcap_ST;
+ float4 _Matcap_TexelSize;
float2 _MatcapPan;
float _MatcapUV;
#endif
@@ -11633,7 +11654,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
float _MatcapMaskGlobalMask;
float _MatcapMaskGlobalMaskBlendType;
float _MatcapBorder;
+ float _MatcapSmoothnessEnabled;
+ float _MatcapSmoothness;
+ float _MatcapMaskSmoothnessChannel;
+ float _MatcapMaskSmoothnessApply;
float4 _MatcapColor;
+ float _MatcapBaseColorMix;
float _MatcapColorThemeIndex;
float _MatcapIntensity;
float _MatcapReplace;
@@ -11658,6 +11684,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap2;
float4 _Matcap2_ST;
+ float4 _Matcap2_TexelSize;
float2 _Matcap2Pan;
float _Matcap2UV;
#endif
@@ -11682,7 +11709,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
float _Matcap2MaskGlobalMask;
float _Matcap2MaskGlobalMaskBlendType;
float _Matcap2Border;
+ float _Matcap2SmoothnessEnabled;
+ float _Matcap2Smoothness;
+ float _Matcap2MaskSmoothnessChannel;
+ float _Matcap2MaskSmoothnessApply;
float4 _Matcap2Color;
+ float _Matcap2BaseColorMix;
float _Matcap2ColorThemeIndex;
float _Matcap2Intensity;
float _Matcap2Replace;
@@ -11708,6 +11740,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap3;
float4 _Matcap3_ST;
+ float4 _Matcap3_TexelSize;
float2 _Matcap3Pan;
float _Matcap3UV;
#endif
@@ -11732,7 +11765,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
float _Matcap3MaskGlobalMask;
float _Matcap3MaskGlobalMaskBlendType;
float _Matcap3Border;
+ float _Matcap3SmoothnessEnabled;
+ float _Matcap3Smoothness;
+ float _Matcap3MaskSmoothnessChannel;
+ float _Matcap3MaskSmoothnessApply;
float4 _Matcap3Color;
+ float _Matcap3BaseColorMix;
float _Matcap3ColorThemeIndex;
float _Matcap3Intensity;
float _Matcap3Replace;
@@ -11758,6 +11796,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap4;
float4 _Matcap4_ST;
+ float4 _Matcap4_TexelSize;
float2 _Matcap4Pan;
float _Matcap4UV;
#endif
@@ -11782,7 +11821,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
float _Matcap4MaskGlobalMask;
float _Matcap4MaskGlobalMaskBlendType;
float _Matcap4Border;
+ float _Matcap4SmoothnessEnabled;
+ float _Matcap4Smoothness;
+ float _Matcap4MaskSmoothnessChannel;
+ float _Matcap4MaskSmoothnessApply;
float4 _Matcap4Color;
+ float _Matcap4BaseColorMix;
float _Matcap4ColorThemeIndex;
float _Matcap4Intensity;
float _Matcap4Replace;
@@ -18312,7 +18356,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
}
if (globalMaskIndex > 0)
{
- matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex-1], globalMaskBlendType);
+ matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex - 1], globalMaskBlendType);
}
poiFragData.baseColor.rgb = lerp(poiFragData.baseColor.rgb, matcapColor.rgb, replace * matcapMask * matcapColor.a * .999999);
@@ -18383,13 +18427,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcapSmoothness;
+ float mipCount0 = 9;
+ if (_MatcapSmoothnessEnabled)
+ {
+ if (_Matcap_TexelSize.z == 8192) mipCount0 = 13;
+ if (_Matcap_TexelSize.z == 4096) mipCount0 = 12;
+ if (_Matcap_TexelSize.z == 2048) mipCount0 = 11;
+ if (_Matcap_TexelSize.z == 1024) mipCount0 = 10;
+ if (_Matcap_TexelSize.z == 512) mipCount0 = 9;
+ if (_Matcap_TexelSize.z == 256) mipCount0 = 8;
+ if (_Matcap_TexelSize.z == 128) mipCount0 = 7;
+ if (_Matcap_TexelSize.z == 64) mipCount0 = 6;
+ if (_Matcap_TexelSize.z == 32) mipCount0 = 5;
+
+ matcapSmoothness = _MatcapSmoothness;
+
+ if (_MatcapMaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
+ matcapSmoothness *= POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskSmoothnessChannel];
+ #endif
+ }
+ matcapSmoothness = (1 - matcapSmoothness) * mipCount0;
+ }
+
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
- matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ if (_MatcapSmoothnessEnabled)
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap), matcapSmoothness) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
+ else
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
#else
matcap = float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
#endif
matcap.rgb *= _MatcapIntensity;
+ matcap.rgb = lerp(matcap.rgb, matcap.rgb * poiFragData.baseColor.rgb, _MatcapBaseColorMix);
+
#if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
matcapMask = POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskChannel];
#else
@@ -18467,12 +18545,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap2Smoothness;
+ float mipCount2 = 9;
+ if (_Matcap2SmoothnessEnabled)
+ {
+ if (_Matcap2_TexelSize.z == 8192) mipCount2 = 13;
+ if (_Matcap2_TexelSize.z == 4096) mipCount2 = 12;
+ if (_Matcap2_TexelSize.z == 2048) mipCount2 = 11;
+ if (_Matcap2_TexelSize.z == 1024) mipCount2 = 10;
+ if (_Matcap2_TexelSize.z == 512) mipCount2 = 9;
+ if (_Matcap2_TexelSize.z == 256) mipCount2 = 8;
+ if (_Matcap2_TexelSize.z == 128) mipCount2 = 7;
+ if (_Matcap2_TexelSize.z == 64) mipCount2 = 6;
+ if (_Matcap2_TexelSize.z == 32) mipCount2 = 5;
+
+ matcap2Smoothness = _Matcap2Smoothness;
+
+ if (_Matcap2MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap2Smoothness *= POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskSmoothnessChannel];
+ #endif
+ }
+ matcap2Smoothness = (1 - matcap2Smoothness) * mipCount2;
+ }
+
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
- matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ if (_Matcap2SmoothnessEnabled)
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2), matcap2Smoothness) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
+ else
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
#else
matcap2 = float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
#endif
+
matcap2.rgb *= _Matcap2Intensity;
+ matcap2.rgb = lerp(matcap2.rgb, matcap2.rgb * poiFragData.baseColor.rgb, _Matcap2BaseColorMix);
+
#if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
matcap2Mask = POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskChannel];
#else
@@ -18549,12 +18662,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap3Smoothness;
+ float mipCount3 = 9;
+ if (_Matcap3SmoothnessEnabled)
+ {
+ if (_Matcap3_TexelSize.z == 8192) mipCount3 = 13;
+ if (_Matcap3_TexelSize.z == 4096) mipCount3 = 12;
+ if (_Matcap3_TexelSize.z == 2048) mipCount3 = 11;
+ if (_Matcap3_TexelSize.z == 1024) mipCount3 = 10;
+ if (_Matcap3_TexelSize.z == 512) mipCount3 = 9;
+ if (_Matcap3_TexelSize.z == 256) mipCount3 = 8;
+ if (_Matcap3_TexelSize.z == 128) mipCount3 = 7;
+ if (_Matcap3_TexelSize.z == 64) mipCount3 = 6;
+ if (_Matcap3_TexelSize.z == 32) mipCount3 = 5;
+
+ matcap3Smoothness = _Matcap3Smoothness;
+
+ if (_Matcap3MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap3Smoothness *= POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskSmoothnessChannel];
+ #endif
+ }
+ matcap3Smoothness = (1 - matcap3Smoothness) * mipCount3;
+ }
+
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
- matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ if (_Matcap3SmoothnessEnabled)
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3), matcap3Smoothness) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
+ else
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
#else
matcap3 = float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
#endif
+
matcap3.rgb *= _Matcap3Intensity;
+ matcap3.rgb = lerp(matcap3.rgb, matcap3.rgb * poiFragData.baseColor.rgb, _Matcap3BaseColorMix);
+
#if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
matcap3Mask = POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskChannel];
#else
@@ -18631,12 +18779,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap4Smoothness;
+ float mipCount4 = 9;
+ if (_Matcap4SmoothnessEnabled)
+ {
+ if (_Matcap4_TexelSize.z == 8192) mipCount4 = 13;
+ if (_Matcap4_TexelSize.z == 4096) mipCount4 = 12;
+ if (_Matcap4_TexelSize.z == 2048) mipCount4 = 11;
+ if (_Matcap4_TexelSize.z == 1024) mipCount4 = 10;
+ if (_Matcap4_TexelSize.z == 512) mipCount4 = 9;
+ if (_Matcap4_TexelSize.z == 256) mipCount4 = 8;
+ if (_Matcap4_TexelSize.z == 128) mipCount4 = 7;
+ if (_Matcap4_TexelSize.z == 64) mipCount4 = 6;
+ if (_Matcap4_TexelSize.z == 32) mipCount4 = 5;
+
+ matcap4Smoothness = _Matcap4Smoothness;
+
+ if (_Matcap4MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap4Smoothness *= POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskSmoothnessChannel];
+ #endif
+ }
+ matcap4Smoothness = (1 - matcap4Smoothness) * mipCount4;
+ }
+
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
- matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ if (_Matcap4SmoothnessEnabled)
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4), matcap4Smoothness) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
+ else
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
#else
matcap4 = float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
#endif
+
matcap4.rgb *= _Matcap4Intensity;
+ matcap4.rgb = lerp(matcap4.rgb, matcap4.rgb * poiFragData.baseColor.rgb, _Matcap4BaseColorMix);
+
#if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
matcap4Mask = POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskChannel];
#else
@@ -18666,6 +18849,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
#endif
//endex
//ifex _MatcapEnable==0 && _Matcap2Enable==0 && _Matcap3Enable==0 && _Matcap4Enable==0
+
}
#endif
//endex
@@ -24605,6 +24789,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap;
float4 _Matcap_ST;
+ float4 _Matcap_TexelSize;
float2 _MatcapPan;
float _MatcapUV;
#endif
@@ -24629,7 +24814,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
float _MatcapMaskGlobalMask;
float _MatcapMaskGlobalMaskBlendType;
float _MatcapBorder;
+ float _MatcapSmoothnessEnabled;
+ float _MatcapSmoothness;
+ float _MatcapMaskSmoothnessChannel;
+ float _MatcapMaskSmoothnessApply;
float4 _MatcapColor;
+ float _MatcapBaseColorMix;
float _MatcapColorThemeIndex;
float _MatcapIntensity;
float _MatcapReplace;
@@ -24654,6 +24844,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap2;
float4 _Matcap2_ST;
+ float4 _Matcap2_TexelSize;
float2 _Matcap2Pan;
float _Matcap2UV;
#endif
@@ -24678,7 +24869,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
float _Matcap2MaskGlobalMask;
float _Matcap2MaskGlobalMaskBlendType;
float _Matcap2Border;
+ float _Matcap2SmoothnessEnabled;
+ float _Matcap2Smoothness;
+ float _Matcap2MaskSmoothnessChannel;
+ float _Matcap2MaskSmoothnessApply;
float4 _Matcap2Color;
+ float _Matcap2BaseColorMix;
float _Matcap2ColorThemeIndex;
float _Matcap2Intensity;
float _Matcap2Replace;
@@ -24704,6 +24900,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap3;
float4 _Matcap3_ST;
+ float4 _Matcap3_TexelSize;
float2 _Matcap3Pan;
float _Matcap3UV;
#endif
@@ -24728,7 +24925,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
float _Matcap3MaskGlobalMask;
float _Matcap3MaskGlobalMaskBlendType;
float _Matcap3Border;
+ float _Matcap3SmoothnessEnabled;
+ float _Matcap3Smoothness;
+ float _Matcap3MaskSmoothnessChannel;
+ float _Matcap3MaskSmoothnessApply;
float4 _Matcap3Color;
+ float _Matcap3BaseColorMix;
float _Matcap3ColorThemeIndex;
float _Matcap3Intensity;
float _Matcap3Replace;
@@ -24754,6 +24956,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap4;
float4 _Matcap4_ST;
+ float4 _Matcap4_TexelSize;
float2 _Matcap4Pan;
float _Matcap4UV;
#endif
@@ -24778,7 +24981,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
float _Matcap4MaskGlobalMask;
float _Matcap4MaskGlobalMaskBlendType;
float _Matcap4Border;
+ float _Matcap4SmoothnessEnabled;
+ float _Matcap4Smoothness;
+ float _Matcap4MaskSmoothnessChannel;
+ float _Matcap4MaskSmoothnessApply;
float4 _Matcap4Color;
+ float _Matcap4BaseColorMix;
float _Matcap4ColorThemeIndex;
float _Matcap4Intensity;
float _Matcap4Replace;
@@ -30999,7 +31207,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
}
if (globalMaskIndex > 0)
{
- matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex-1], globalMaskBlendType);
+ matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex - 1], globalMaskBlendType);
}
poiFragData.baseColor.rgb = lerp(poiFragData.baseColor.rgb, matcapColor.rgb, replace * matcapMask * matcapColor.a * .999999);
@@ -31070,13 +31278,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcapSmoothness;
+ float mipCount0 = 9;
+ if (_MatcapSmoothnessEnabled)
+ {
+ if (_Matcap_TexelSize.z == 8192) mipCount0 = 13;
+ if (_Matcap_TexelSize.z == 4096) mipCount0 = 12;
+ if (_Matcap_TexelSize.z == 2048) mipCount0 = 11;
+ if (_Matcap_TexelSize.z == 1024) mipCount0 = 10;
+ if (_Matcap_TexelSize.z == 512) mipCount0 = 9;
+ if (_Matcap_TexelSize.z == 256) mipCount0 = 8;
+ if (_Matcap_TexelSize.z == 128) mipCount0 = 7;
+ if (_Matcap_TexelSize.z == 64) mipCount0 = 6;
+ if (_Matcap_TexelSize.z == 32) mipCount0 = 5;
+
+ matcapSmoothness = _MatcapSmoothness;
+
+ if (_MatcapMaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
+ matcapSmoothness *= POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskSmoothnessChannel];
+ #endif
+ }
+ matcapSmoothness = (1 - matcapSmoothness) * mipCount0;
+ }
+
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
- matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ if (_MatcapSmoothnessEnabled)
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap), matcapSmoothness) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
+ else
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
#else
matcap = float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
#endif
matcap.rgb *= _MatcapIntensity;
+ matcap.rgb = lerp(matcap.rgb, matcap.rgb * poiFragData.baseColor.rgb, _MatcapBaseColorMix);
+
#if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
matcapMask = POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskChannel];
#else
@@ -31154,12 +31396,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap2Smoothness;
+ float mipCount2 = 9;
+ if (_Matcap2SmoothnessEnabled)
+ {
+ if (_Matcap2_TexelSize.z == 8192) mipCount2 = 13;
+ if (_Matcap2_TexelSize.z == 4096) mipCount2 = 12;
+ if (_Matcap2_TexelSize.z == 2048) mipCount2 = 11;
+ if (_Matcap2_TexelSize.z == 1024) mipCount2 = 10;
+ if (_Matcap2_TexelSize.z == 512) mipCount2 = 9;
+ if (_Matcap2_TexelSize.z == 256) mipCount2 = 8;
+ if (_Matcap2_TexelSize.z == 128) mipCount2 = 7;
+ if (_Matcap2_TexelSize.z == 64) mipCount2 = 6;
+ if (_Matcap2_TexelSize.z == 32) mipCount2 = 5;
+
+ matcap2Smoothness = _Matcap2Smoothness;
+
+ if (_Matcap2MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap2Smoothness *= POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskSmoothnessChannel];
+ #endif
+ }
+ matcap2Smoothness = (1 - matcap2Smoothness) * mipCount2;
+ }
+
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
- matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ if (_Matcap2SmoothnessEnabled)
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2), matcap2Smoothness) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
+ else
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
#else
matcap2 = float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
#endif
+
matcap2.rgb *= _Matcap2Intensity;
+ matcap2.rgb = lerp(matcap2.rgb, matcap2.rgb * poiFragData.baseColor.rgb, _Matcap2BaseColorMix);
+
#if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
matcap2Mask = POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskChannel];
#else
@@ -31236,12 +31513,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap3Smoothness;
+ float mipCount3 = 9;
+ if (_Matcap3SmoothnessEnabled)
+ {
+ if (_Matcap3_TexelSize.z == 8192) mipCount3 = 13;
+ if (_Matcap3_TexelSize.z == 4096) mipCount3 = 12;
+ if (_Matcap3_TexelSize.z == 2048) mipCount3 = 11;
+ if (_Matcap3_TexelSize.z == 1024) mipCount3 = 10;
+ if (_Matcap3_TexelSize.z == 512) mipCount3 = 9;
+ if (_Matcap3_TexelSize.z == 256) mipCount3 = 8;
+ if (_Matcap3_TexelSize.z == 128) mipCount3 = 7;
+ if (_Matcap3_TexelSize.z == 64) mipCount3 = 6;
+ if (_Matcap3_TexelSize.z == 32) mipCount3 = 5;
+
+ matcap3Smoothness = _Matcap3Smoothness;
+
+ if (_Matcap3MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap3Smoothness *= POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskSmoothnessChannel];
+ #endif
+ }
+ matcap3Smoothness = (1 - matcap3Smoothness) * mipCount3;
+ }
+
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
- matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ if (_Matcap3SmoothnessEnabled)
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3), matcap3Smoothness) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
+ else
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
#else
matcap3 = float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
#endif
+
matcap3.rgb *= _Matcap3Intensity;
+ matcap3.rgb = lerp(matcap3.rgb, matcap3.rgb * poiFragData.baseColor.rgb, _Matcap3BaseColorMix);
+
#if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
matcap3Mask = POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskChannel];
#else
@@ -31318,12 +31630,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap4Smoothness;
+ float mipCount4 = 9;
+ if (_Matcap4SmoothnessEnabled)
+ {
+ if (_Matcap4_TexelSize.z == 8192) mipCount4 = 13;
+ if (_Matcap4_TexelSize.z == 4096) mipCount4 = 12;
+ if (_Matcap4_TexelSize.z == 2048) mipCount4 = 11;
+ if (_Matcap4_TexelSize.z == 1024) mipCount4 = 10;
+ if (_Matcap4_TexelSize.z == 512) mipCount4 = 9;
+ if (_Matcap4_TexelSize.z == 256) mipCount4 = 8;
+ if (_Matcap4_TexelSize.z == 128) mipCount4 = 7;
+ if (_Matcap4_TexelSize.z == 64) mipCount4 = 6;
+ if (_Matcap4_TexelSize.z == 32) mipCount4 = 5;
+
+ matcap4Smoothness = _Matcap4Smoothness;
+
+ if (_Matcap4MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap4Smoothness *= POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskSmoothnessChannel];
+ #endif
+ }
+ matcap4Smoothness = (1 - matcap4Smoothness) * mipCount4;
+ }
+
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
- matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ if (_Matcap4SmoothnessEnabled)
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4), matcap4Smoothness) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
+ else
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
#else
matcap4 = float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
#endif
+
matcap4.rgb *= _Matcap4Intensity;
+ matcap4.rgb = lerp(matcap4.rgb, matcap4.rgb * poiFragData.baseColor.rgb, _Matcap4BaseColorMix);
+
#if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
matcap4Mask = POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskChannel];
#else
@@ -31353,6 +31700,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline Early"
#endif
//endex
//ifex _MatcapEnable==0 && _Matcap2Enable==0 && _Matcap3Enable==0 && _Matcap4Enable==0
+
}
#endif
//endex
diff --git a/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi Early Z.shader b/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi Early Z.shader
index 24c8cda..9021f23 100644
--- a/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi Early Z.shader
+++ b/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi Early Z.shader
@@ -2,7 +2,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
{
Properties
{
- [HideInInspector] shader_master_label ("Poiyomi 8.1.156", Float) = 0
+ [HideInInspector] shader_master_label ("Poiyomi 8.1.160", Float) = 0
[HideInInspector] shader_is_using_thry_editor ("", Float) = 0
[HideInInspector] shader_locale ("0db0b86376c3dca4b9a6828ef8615fe0", Float) = 0
[HideInInspector] footer_youtube ("{texture:{name:icon-youtube,height:16},action:{type:URL,data:https://www.youtube.com/poiyomi},hover:YOUTUBE}", Float) = 0
@@ -1340,10 +1340,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
[HideInInspector][ThryToggle(POI_MATCAP0)]_MatcapEnable ("Enable Matcap", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _MatcapUVMode ("UV Mode", Int) = 1
_MatcapColor ("Color--{reference_property:_MatcapColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _MatcapBaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _MatcapColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap ("Matcap", 2D) = "white" { }
_MatcapBorder ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_MatcapMask ("Mask--{reference_properties:[_MatcapMaskPan, _MatcapMaskUV, _MatcapMaskChannel, _MatcapMaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_MatcapMask ("Mask--{reference_properties:[_MatcapMaskPan, _MatcapMaskUV, _MatcapMaskChannel, _MatcapMaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_MatcapMaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _MatcapMaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_MatcapMaskChannel ("Channel", Float) = 0
@@ -1368,6 +1369,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
[ThryToggleUI(true)] _MatcapHueShiftEnabled (" Hue Shift", Float) = 0
_MatcapHueShiftSpeed ("Shift Speed--{condition_showS:(_MatcapHueShiftEnabled==1)}", Float) = 0
_MatcapHueShift ("Hue Shift--{condition_showS:(_MatcapHueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _MatcapSmoothnessEnabled (" Blur", Float) = 0
+ _MatcapSmoothness ("Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_MatcapMaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_MatcapMaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_MatcapTPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _MatcapTPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_MatcapTPSMaskStrength ("TPS Mask Strength--{condition_showS:(_MatcapTPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1381,10 +1386,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
[HideInInspector][ThryToggle(COLOR_GRADING_HDR_3D)]_Matcap2Enable ("Enable Matcap 2", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap2UVMode ("UV Mode", Int) = 1
_Matcap2Color ("Color--{reference_property:_Matcap2ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap2BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap2ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap2 ("Matcap", 2D) = "white" { }
_Matcap2Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap2Mask ("Mask--{reference_properties:[_Matcap2MaskPan, _Matcap2MaskUV, _Matcap2MaskChannel, _Matcap2MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap2Mask ("Mask--{reference_properties:[_Matcap2MaskPan, _Matcap2MaskUV, _Matcap2MaskChannel, _Matcap2MaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_Matcap2MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap2MaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap2MaskChannel ("Channel", Float) = 0
@@ -1410,6 +1416,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
[ThryToggleUI(true)] _Matcap2HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap2HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap2HueShiftEnabled==1)}", Float) = 0
_Matcap2HueShift ("Hue Shift--{condition_showS:(_Matcap2HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap2SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap2Smoothness ("Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap2MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap2MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap2TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap2TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap2TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap2TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1423,10 +1433,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
[HideInInspector][ThryToggle(POI_MATCAP2)]_Matcap3Enable ("Enable Matcap 2", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap3UVMode ("UV Mode", Int) = 1
_Matcap3Color ("Color--{reference_property:_Matcap3ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap3BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap3ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap3 ("Matcap", 2D) = "white" { }
_Matcap3Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap3Mask ("Mask--{reference_properties:[_Matcap3MaskPan, _Matcap3MaskUV, _Matcap3MaskChannel, _Matcap3MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap3Mask ("Mask--{reference_properties:[_Matcap3MaskPan, _Matcap3MaskUV, _Matcap3MaskChannel, _Matcap3MaskInvert]}", 2D) = "white" { }
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap3MaskChannel ("Channel", Float) = 0
[HideInInspector][Vector2]_Matcap3MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap3MaskUV ("UV", Int) = 0
@@ -1452,6 +1463,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
[ThryToggleUI(true)] _Matcap3HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap3HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap3HueShiftEnabled==1)}", Float) = 0
_Matcap3HueShift ("Hue Shift--{condition_showS:(_Matcap3HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap3SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap3Smoothness ("Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap3MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap3MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap3TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap3TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap3TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap3TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1465,10 +1480,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
[HideInInspector][ThryToggle(POI_MATCAP3)]_Matcap4Enable ("Enable Matcap 3", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap4UVMode ("UV Mode", Int) = 1
_Matcap4Color ("Color--{reference_property:_Matcap4ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap4BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap4ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap4 ("Matcap", 2D) = "white" { }
_Matcap4Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap4Mask ("Mask--{reference_properties:[_Matcap4MaskPan, _Matcap4MaskUV, _Matcap4MaskChannel, _Matcap4MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap4Mask ("Mask--{reference_properties:[_Matcap4MaskPan, _Matcap4MaskUV, _Matcap4MaskChannel, _Matcap4MaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_Matcap4MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap4MaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap4MaskChannel ("Channel", Float) = 0
@@ -1494,6 +1510,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
[ThryToggleUI(true)] _Matcap4HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap4HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap4HueShiftEnabled==1)}", Float) = 0
_Matcap4HueShift ("Hue Shift--{condition_showS:(_Matcap4HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap4SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap4Smoothness ("Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap4MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap4MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap4TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap4TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap4TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap4TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -7590,6 +7610,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap;
float4 _Matcap_ST;
+ float4 _Matcap_TexelSize;
float2 _MatcapPan;
float _MatcapUV;
#endif
@@ -7614,7 +7635,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
float _MatcapMaskGlobalMask;
float _MatcapMaskGlobalMaskBlendType;
float _MatcapBorder;
+ float _MatcapSmoothnessEnabled;
+ float _MatcapSmoothness;
+ float _MatcapMaskSmoothnessChannel;
+ float _MatcapMaskSmoothnessApply;
float4 _MatcapColor;
+ float _MatcapBaseColorMix;
float _MatcapColorThemeIndex;
float _MatcapIntensity;
float _MatcapReplace;
@@ -7639,6 +7665,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap2;
float4 _Matcap2_ST;
+ float4 _Matcap2_TexelSize;
float2 _Matcap2Pan;
float _Matcap2UV;
#endif
@@ -7663,7 +7690,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
float _Matcap2MaskGlobalMask;
float _Matcap2MaskGlobalMaskBlendType;
float _Matcap2Border;
+ float _Matcap2SmoothnessEnabled;
+ float _Matcap2Smoothness;
+ float _Matcap2MaskSmoothnessChannel;
+ float _Matcap2MaskSmoothnessApply;
float4 _Matcap2Color;
+ float _Matcap2BaseColorMix;
float _Matcap2ColorThemeIndex;
float _Matcap2Intensity;
float _Matcap2Replace;
@@ -7689,6 +7721,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap3;
float4 _Matcap3_ST;
+ float4 _Matcap3_TexelSize;
float2 _Matcap3Pan;
float _Matcap3UV;
#endif
@@ -7713,7 +7746,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
float _Matcap3MaskGlobalMask;
float _Matcap3MaskGlobalMaskBlendType;
float _Matcap3Border;
+ float _Matcap3SmoothnessEnabled;
+ float _Matcap3Smoothness;
+ float _Matcap3MaskSmoothnessChannel;
+ float _Matcap3MaskSmoothnessApply;
float4 _Matcap3Color;
+ float _Matcap3BaseColorMix;
float _Matcap3ColorThemeIndex;
float _Matcap3Intensity;
float _Matcap3Replace;
@@ -7739,6 +7777,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap4;
float4 _Matcap4_ST;
+ float4 _Matcap4_TexelSize;
float2 _Matcap4Pan;
float _Matcap4UV;
#endif
@@ -7763,7 +7802,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
float _Matcap4MaskGlobalMask;
float _Matcap4MaskGlobalMaskBlendType;
float _Matcap4Border;
+ float _Matcap4SmoothnessEnabled;
+ float _Matcap4Smoothness;
+ float _Matcap4MaskSmoothnessChannel;
+ float _Matcap4MaskSmoothnessApply;
float4 _Matcap4Color;
+ float _Matcap4BaseColorMix;
float _Matcap4ColorThemeIndex;
float _Matcap4Intensity;
float _Matcap4Replace;
@@ -14226,7 +14270,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
}
if (globalMaskIndex > 0)
{
- matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex-1], globalMaskBlendType);
+ matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex - 1], globalMaskBlendType);
}
poiFragData.baseColor.rgb = lerp(poiFragData.baseColor.rgb, matcapColor.rgb, replace * matcapMask * matcapColor.a * .999999);
@@ -14297,13 +14341,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcapSmoothness;
+ float mipCount0 = 9;
+ if (_MatcapSmoothnessEnabled)
+ {
+ if (_Matcap_TexelSize.z == 8192) mipCount0 = 13;
+ if (_Matcap_TexelSize.z == 4096) mipCount0 = 12;
+ if (_Matcap_TexelSize.z == 2048) mipCount0 = 11;
+ if (_Matcap_TexelSize.z == 1024) mipCount0 = 10;
+ if (_Matcap_TexelSize.z == 512) mipCount0 = 9;
+ if (_Matcap_TexelSize.z == 256) mipCount0 = 8;
+ if (_Matcap_TexelSize.z == 128) mipCount0 = 7;
+ if (_Matcap_TexelSize.z == 64) mipCount0 = 6;
+ if (_Matcap_TexelSize.z == 32) mipCount0 = 5;
+
+ matcapSmoothness = _MatcapSmoothness;
+
+ if (_MatcapMaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
+ matcapSmoothness *= POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskSmoothnessChannel];
+ #endif
+ }
+ matcapSmoothness = (1 - matcapSmoothness) * mipCount0;
+ }
+
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
- matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ if (_MatcapSmoothnessEnabled)
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap), matcapSmoothness) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
+ else
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
#else
matcap = float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
#endif
matcap.rgb *= _MatcapIntensity;
+ matcap.rgb = lerp(matcap.rgb, matcap.rgb * poiFragData.baseColor.rgb, _MatcapBaseColorMix);
+
#if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
matcapMask = POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskChannel];
#else
@@ -14381,12 +14459,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap2Smoothness;
+ float mipCount2 = 9;
+ if (_Matcap2SmoothnessEnabled)
+ {
+ if (_Matcap2_TexelSize.z == 8192) mipCount2 = 13;
+ if (_Matcap2_TexelSize.z == 4096) mipCount2 = 12;
+ if (_Matcap2_TexelSize.z == 2048) mipCount2 = 11;
+ if (_Matcap2_TexelSize.z == 1024) mipCount2 = 10;
+ if (_Matcap2_TexelSize.z == 512) mipCount2 = 9;
+ if (_Matcap2_TexelSize.z == 256) mipCount2 = 8;
+ if (_Matcap2_TexelSize.z == 128) mipCount2 = 7;
+ if (_Matcap2_TexelSize.z == 64) mipCount2 = 6;
+ if (_Matcap2_TexelSize.z == 32) mipCount2 = 5;
+
+ matcap2Smoothness = _Matcap2Smoothness;
+
+ if (_Matcap2MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap2Smoothness *= POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskSmoothnessChannel];
+ #endif
+ }
+ matcap2Smoothness = (1 - matcap2Smoothness) * mipCount2;
+ }
+
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
- matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ if (_Matcap2SmoothnessEnabled)
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2), matcap2Smoothness) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
+ else
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
#else
matcap2 = float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
#endif
+
matcap2.rgb *= _Matcap2Intensity;
+ matcap2.rgb = lerp(matcap2.rgb, matcap2.rgb * poiFragData.baseColor.rgb, _Matcap2BaseColorMix);
+
#if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
matcap2Mask = POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskChannel];
#else
@@ -14463,12 +14576,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap3Smoothness;
+ float mipCount3 = 9;
+ if (_Matcap3SmoothnessEnabled)
+ {
+ if (_Matcap3_TexelSize.z == 8192) mipCount3 = 13;
+ if (_Matcap3_TexelSize.z == 4096) mipCount3 = 12;
+ if (_Matcap3_TexelSize.z == 2048) mipCount3 = 11;
+ if (_Matcap3_TexelSize.z == 1024) mipCount3 = 10;
+ if (_Matcap3_TexelSize.z == 512) mipCount3 = 9;
+ if (_Matcap3_TexelSize.z == 256) mipCount3 = 8;
+ if (_Matcap3_TexelSize.z == 128) mipCount3 = 7;
+ if (_Matcap3_TexelSize.z == 64) mipCount3 = 6;
+ if (_Matcap3_TexelSize.z == 32) mipCount3 = 5;
+
+ matcap3Smoothness = _Matcap3Smoothness;
+
+ if (_Matcap3MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap3Smoothness *= POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskSmoothnessChannel];
+ #endif
+ }
+ matcap3Smoothness = (1 - matcap3Smoothness) * mipCount3;
+ }
+
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
- matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ if (_Matcap3SmoothnessEnabled)
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3), matcap3Smoothness) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
+ else
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
#else
matcap3 = float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
#endif
+
matcap3.rgb *= _Matcap3Intensity;
+ matcap3.rgb = lerp(matcap3.rgb, matcap3.rgb * poiFragData.baseColor.rgb, _Matcap3BaseColorMix);
+
#if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
matcap3Mask = POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskChannel];
#else
@@ -14545,12 +14693,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap4Smoothness;
+ float mipCount4 = 9;
+ if (_Matcap4SmoothnessEnabled)
+ {
+ if (_Matcap4_TexelSize.z == 8192) mipCount4 = 13;
+ if (_Matcap4_TexelSize.z == 4096) mipCount4 = 12;
+ if (_Matcap4_TexelSize.z == 2048) mipCount4 = 11;
+ if (_Matcap4_TexelSize.z == 1024) mipCount4 = 10;
+ if (_Matcap4_TexelSize.z == 512) mipCount4 = 9;
+ if (_Matcap4_TexelSize.z == 256) mipCount4 = 8;
+ if (_Matcap4_TexelSize.z == 128) mipCount4 = 7;
+ if (_Matcap4_TexelSize.z == 64) mipCount4 = 6;
+ if (_Matcap4_TexelSize.z == 32) mipCount4 = 5;
+
+ matcap4Smoothness = _Matcap4Smoothness;
+
+ if (_Matcap4MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap4Smoothness *= POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskSmoothnessChannel];
+ #endif
+ }
+ matcap4Smoothness = (1 - matcap4Smoothness) * mipCount4;
+ }
+
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
- matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ if (_Matcap4SmoothnessEnabled)
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4), matcap4Smoothness) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
+ else
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
#else
matcap4 = float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
#endif
+
matcap4.rgb *= _Matcap4Intensity;
+ matcap4.rgb = lerp(matcap4.rgb, matcap4.rgb * poiFragData.baseColor.rgb, _Matcap4BaseColorMix);
+
#if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
matcap4Mask = POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskChannel];
#else
@@ -14580,6 +14763,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
#endif
//endex
//ifex _MatcapEnable==0 && _Matcap2Enable==0 && _Matcap3Enable==0 && _Matcap4Enable==0
+
}
#endif
//endex
@@ -20491,6 +20675,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap;
float4 _Matcap_ST;
+ float4 _Matcap_TexelSize;
float2 _MatcapPan;
float _MatcapUV;
#endif
@@ -20515,7 +20700,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
float _MatcapMaskGlobalMask;
float _MatcapMaskGlobalMaskBlendType;
float _MatcapBorder;
+ float _MatcapSmoothnessEnabled;
+ float _MatcapSmoothness;
+ float _MatcapMaskSmoothnessChannel;
+ float _MatcapMaskSmoothnessApply;
float4 _MatcapColor;
+ float _MatcapBaseColorMix;
float _MatcapColorThemeIndex;
float _MatcapIntensity;
float _MatcapReplace;
@@ -20540,6 +20730,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap2;
float4 _Matcap2_ST;
+ float4 _Matcap2_TexelSize;
float2 _Matcap2Pan;
float _Matcap2UV;
#endif
@@ -20564,7 +20755,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
float _Matcap2MaskGlobalMask;
float _Matcap2MaskGlobalMaskBlendType;
float _Matcap2Border;
+ float _Matcap2SmoothnessEnabled;
+ float _Matcap2Smoothness;
+ float _Matcap2MaskSmoothnessChannel;
+ float _Matcap2MaskSmoothnessApply;
float4 _Matcap2Color;
+ float _Matcap2BaseColorMix;
float _Matcap2ColorThemeIndex;
float _Matcap2Intensity;
float _Matcap2Replace;
@@ -20590,6 +20786,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap3;
float4 _Matcap3_ST;
+ float4 _Matcap3_TexelSize;
float2 _Matcap3Pan;
float _Matcap3UV;
#endif
@@ -20614,7 +20811,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
float _Matcap3MaskGlobalMask;
float _Matcap3MaskGlobalMaskBlendType;
float _Matcap3Border;
+ float _Matcap3SmoothnessEnabled;
+ float _Matcap3Smoothness;
+ float _Matcap3MaskSmoothnessChannel;
+ float _Matcap3MaskSmoothnessApply;
float4 _Matcap3Color;
+ float _Matcap3BaseColorMix;
float _Matcap3ColorThemeIndex;
float _Matcap3Intensity;
float _Matcap3Replace;
@@ -20640,6 +20842,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap4;
float4 _Matcap4_ST;
+ float4 _Matcap4_TexelSize;
float2 _Matcap4Pan;
float _Matcap4UV;
#endif
@@ -20664,7 +20867,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
float _Matcap4MaskGlobalMask;
float _Matcap4MaskGlobalMaskBlendType;
float _Matcap4Border;
+ float _Matcap4SmoothnessEnabled;
+ float _Matcap4Smoothness;
+ float _Matcap4MaskSmoothnessChannel;
+ float _Matcap4MaskSmoothnessApply;
float4 _Matcap4Color;
+ float _Matcap4BaseColorMix;
float _Matcap4ColorThemeIndex;
float _Matcap4Intensity;
float _Matcap4Replace;
@@ -26818,7 +27026,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
}
if (globalMaskIndex > 0)
{
- matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex-1], globalMaskBlendType);
+ matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex - 1], globalMaskBlendType);
}
poiFragData.baseColor.rgb = lerp(poiFragData.baseColor.rgb, matcapColor.rgb, replace * matcapMask * matcapColor.a * .999999);
@@ -26889,13 +27097,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcapSmoothness;
+ float mipCount0 = 9;
+ if (_MatcapSmoothnessEnabled)
+ {
+ if (_Matcap_TexelSize.z == 8192) mipCount0 = 13;
+ if (_Matcap_TexelSize.z == 4096) mipCount0 = 12;
+ if (_Matcap_TexelSize.z == 2048) mipCount0 = 11;
+ if (_Matcap_TexelSize.z == 1024) mipCount0 = 10;
+ if (_Matcap_TexelSize.z == 512) mipCount0 = 9;
+ if (_Matcap_TexelSize.z == 256) mipCount0 = 8;
+ if (_Matcap_TexelSize.z == 128) mipCount0 = 7;
+ if (_Matcap_TexelSize.z == 64) mipCount0 = 6;
+ if (_Matcap_TexelSize.z == 32) mipCount0 = 5;
+
+ matcapSmoothness = _MatcapSmoothness;
+
+ if (_MatcapMaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
+ matcapSmoothness *= POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskSmoothnessChannel];
+ #endif
+ }
+ matcapSmoothness = (1 - matcapSmoothness) * mipCount0;
+ }
+
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
- matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ if (_MatcapSmoothnessEnabled)
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap), matcapSmoothness) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
+ else
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
#else
matcap = float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
#endif
matcap.rgb *= _MatcapIntensity;
+ matcap.rgb = lerp(matcap.rgb, matcap.rgb * poiFragData.baseColor.rgb, _MatcapBaseColorMix);
+
#if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
matcapMask = POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskChannel];
#else
@@ -26973,12 +27215,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap2Smoothness;
+ float mipCount2 = 9;
+ if (_Matcap2SmoothnessEnabled)
+ {
+ if (_Matcap2_TexelSize.z == 8192) mipCount2 = 13;
+ if (_Matcap2_TexelSize.z == 4096) mipCount2 = 12;
+ if (_Matcap2_TexelSize.z == 2048) mipCount2 = 11;
+ if (_Matcap2_TexelSize.z == 1024) mipCount2 = 10;
+ if (_Matcap2_TexelSize.z == 512) mipCount2 = 9;
+ if (_Matcap2_TexelSize.z == 256) mipCount2 = 8;
+ if (_Matcap2_TexelSize.z == 128) mipCount2 = 7;
+ if (_Matcap2_TexelSize.z == 64) mipCount2 = 6;
+ if (_Matcap2_TexelSize.z == 32) mipCount2 = 5;
+
+ matcap2Smoothness = _Matcap2Smoothness;
+
+ if (_Matcap2MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap2Smoothness *= POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskSmoothnessChannel];
+ #endif
+ }
+ matcap2Smoothness = (1 - matcap2Smoothness) * mipCount2;
+ }
+
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
- matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ if (_Matcap2SmoothnessEnabled)
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2), matcap2Smoothness) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
+ else
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
#else
matcap2 = float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
#endif
+
matcap2.rgb *= _Matcap2Intensity;
+ matcap2.rgb = lerp(matcap2.rgb, matcap2.rgb * poiFragData.baseColor.rgb, _Matcap2BaseColorMix);
+
#if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
matcap2Mask = POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskChannel];
#else
@@ -27055,12 +27332,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap3Smoothness;
+ float mipCount3 = 9;
+ if (_Matcap3SmoothnessEnabled)
+ {
+ if (_Matcap3_TexelSize.z == 8192) mipCount3 = 13;
+ if (_Matcap3_TexelSize.z == 4096) mipCount3 = 12;
+ if (_Matcap3_TexelSize.z == 2048) mipCount3 = 11;
+ if (_Matcap3_TexelSize.z == 1024) mipCount3 = 10;
+ if (_Matcap3_TexelSize.z == 512) mipCount3 = 9;
+ if (_Matcap3_TexelSize.z == 256) mipCount3 = 8;
+ if (_Matcap3_TexelSize.z == 128) mipCount3 = 7;
+ if (_Matcap3_TexelSize.z == 64) mipCount3 = 6;
+ if (_Matcap3_TexelSize.z == 32) mipCount3 = 5;
+
+ matcap3Smoothness = _Matcap3Smoothness;
+
+ if (_Matcap3MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap3Smoothness *= POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskSmoothnessChannel];
+ #endif
+ }
+ matcap3Smoothness = (1 - matcap3Smoothness) * mipCount3;
+ }
+
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
- matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ if (_Matcap3SmoothnessEnabled)
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3), matcap3Smoothness) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
+ else
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
#else
matcap3 = float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
#endif
+
matcap3.rgb *= _Matcap3Intensity;
+ matcap3.rgb = lerp(matcap3.rgb, matcap3.rgb * poiFragData.baseColor.rgb, _Matcap3BaseColorMix);
+
#if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
matcap3Mask = POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskChannel];
#else
@@ -27137,12 +27449,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap4Smoothness;
+ float mipCount4 = 9;
+ if (_Matcap4SmoothnessEnabled)
+ {
+ if (_Matcap4_TexelSize.z == 8192) mipCount4 = 13;
+ if (_Matcap4_TexelSize.z == 4096) mipCount4 = 12;
+ if (_Matcap4_TexelSize.z == 2048) mipCount4 = 11;
+ if (_Matcap4_TexelSize.z == 1024) mipCount4 = 10;
+ if (_Matcap4_TexelSize.z == 512) mipCount4 = 9;
+ if (_Matcap4_TexelSize.z == 256) mipCount4 = 8;
+ if (_Matcap4_TexelSize.z == 128) mipCount4 = 7;
+ if (_Matcap4_TexelSize.z == 64) mipCount4 = 6;
+ if (_Matcap4_TexelSize.z == 32) mipCount4 = 5;
+
+ matcap4Smoothness = _Matcap4Smoothness;
+
+ if (_Matcap4MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap4Smoothness *= POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskSmoothnessChannel];
+ #endif
+ }
+ matcap4Smoothness = (1 - matcap4Smoothness) * mipCount4;
+ }
+
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
- matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ if (_Matcap4SmoothnessEnabled)
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4), matcap4Smoothness) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
+ else
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
#else
matcap4 = float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
#endif
+
matcap4.rgb *= _Matcap4Intensity;
+ matcap4.rgb = lerp(matcap4.rgb, matcap4.rgb * poiFragData.baseColor.rgb, _Matcap4BaseColorMix);
+
#if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
matcap4Mask = POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskChannel];
#else
@@ -27172,6 +27519,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Early Z"
#endif
//endex
//ifex _MatcapEnable==0 && _Matcap2Enable==0 && _Matcap3Enable==0 && _Matcap4Enable==0
+
}
#endif
//endex
diff --git a/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi Outline.shader b/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi Outline.shader
index 63dca1b..9278d8e 100644
--- a/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi Outline.shader
+++ b/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi Outline.shader
@@ -2,7 +2,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
{
Properties
{
- [HideInInspector] shader_master_label ("Poiyomi 8.1.156", Float) = 0
+ [HideInInspector] shader_master_label ("Poiyomi 8.1.160", Float) = 0
[HideInInspector] shader_is_using_thry_editor ("", Float) = 0
[HideInInspector] shader_locale ("0db0b86376c3dca4b9a6828ef8615fe0", Float) = 0
[HideInInspector] footer_youtube ("{texture:{name:icon-youtube,height:16},action:{type:URL,data:https://www.youtube.com/poiyomi},hover:YOUTUBE}", Float) = 0
@@ -1340,10 +1340,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
[HideInInspector][ThryToggle(POI_MATCAP0)]_MatcapEnable ("Enable Matcap", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _MatcapUVMode ("UV Mode", Int) = 1
_MatcapColor ("Color--{reference_property:_MatcapColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _MatcapBaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _MatcapColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap ("Matcap", 2D) = "white" { }
_MatcapBorder ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_MatcapMask ("Mask--{reference_properties:[_MatcapMaskPan, _MatcapMaskUV, _MatcapMaskChannel, _MatcapMaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_MatcapMask ("Mask--{reference_properties:[_MatcapMaskPan, _MatcapMaskUV, _MatcapMaskChannel, _MatcapMaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_MatcapMaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _MatcapMaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_MatcapMaskChannel ("Channel", Float) = 0
@@ -1368,6 +1369,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
[ThryToggleUI(true)] _MatcapHueShiftEnabled (" Hue Shift", Float) = 0
_MatcapHueShiftSpeed ("Shift Speed--{condition_showS:(_MatcapHueShiftEnabled==1)}", Float) = 0
_MatcapHueShift ("Hue Shift--{condition_showS:(_MatcapHueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _MatcapSmoothnessEnabled (" Blur", Float) = 0
+ _MatcapSmoothness ("Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_MatcapMaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_MatcapMaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_MatcapTPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _MatcapTPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_MatcapTPSMaskStrength ("TPS Mask Strength--{condition_showS:(_MatcapTPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1381,10 +1386,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
[HideInInspector][ThryToggle(COLOR_GRADING_HDR_3D)]_Matcap2Enable ("Enable Matcap 2", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap2UVMode ("UV Mode", Int) = 1
_Matcap2Color ("Color--{reference_property:_Matcap2ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap2BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap2ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap2 ("Matcap", 2D) = "white" { }
_Matcap2Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap2Mask ("Mask--{reference_properties:[_Matcap2MaskPan, _Matcap2MaskUV, _Matcap2MaskChannel, _Matcap2MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap2Mask ("Mask--{reference_properties:[_Matcap2MaskPan, _Matcap2MaskUV, _Matcap2MaskChannel, _Matcap2MaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_Matcap2MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap2MaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap2MaskChannel ("Channel", Float) = 0
@@ -1410,6 +1416,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
[ThryToggleUI(true)] _Matcap2HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap2HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap2HueShiftEnabled==1)}", Float) = 0
_Matcap2HueShift ("Hue Shift--{condition_showS:(_Matcap2HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap2SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap2Smoothness ("Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap2MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap2MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap2TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap2TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap2TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap2TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1423,10 +1433,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
[HideInInspector][ThryToggle(POI_MATCAP2)]_Matcap3Enable ("Enable Matcap 2", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap3UVMode ("UV Mode", Int) = 1
_Matcap3Color ("Color--{reference_property:_Matcap3ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap3BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap3ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap3 ("Matcap", 2D) = "white" { }
_Matcap3Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap3Mask ("Mask--{reference_properties:[_Matcap3MaskPan, _Matcap3MaskUV, _Matcap3MaskChannel, _Matcap3MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap3Mask ("Mask--{reference_properties:[_Matcap3MaskPan, _Matcap3MaskUV, _Matcap3MaskChannel, _Matcap3MaskInvert]}", 2D) = "white" { }
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap3MaskChannel ("Channel", Float) = 0
[HideInInspector][Vector2]_Matcap3MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap3MaskUV ("UV", Int) = 0
@@ -1452,6 +1463,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
[ThryToggleUI(true)] _Matcap3HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap3HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap3HueShiftEnabled==1)}", Float) = 0
_Matcap3HueShift ("Hue Shift--{condition_showS:(_Matcap3HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap3SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap3Smoothness ("Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap3MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap3MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap3TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap3TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap3TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap3TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1465,10 +1480,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
[HideInInspector][ThryToggle(POI_MATCAP3)]_Matcap4Enable ("Enable Matcap 3", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap4UVMode ("UV Mode", Int) = 1
_Matcap4Color ("Color--{reference_property:_Matcap4ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap4BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap4ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap4 ("Matcap", 2D) = "white" { }
_Matcap4Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap4Mask ("Mask--{reference_properties:[_Matcap4MaskPan, _Matcap4MaskUV, _Matcap4MaskChannel, _Matcap4MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap4Mask ("Mask--{reference_properties:[_Matcap4MaskPan, _Matcap4MaskUV, _Matcap4MaskChannel, _Matcap4MaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_Matcap4MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap4MaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap4MaskChannel ("Channel", Float) = 0
@@ -1494,6 +1510,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
[ThryToggleUI(true)] _Matcap4HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap4HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap4HueShiftEnabled==1)}", Float) = 0
_Matcap4HueShift ("Hue Shift--{condition_showS:(_Matcap4HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap4SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap4Smoothness ("Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap4MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap4MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap4TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap4TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap4TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap4TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -5243,6 +5263,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap;
float4 _Matcap_ST;
+ float4 _Matcap_TexelSize;
float2 _MatcapPan;
float _MatcapUV;
#endif
@@ -5267,7 +5288,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
float _MatcapMaskGlobalMask;
float _MatcapMaskGlobalMaskBlendType;
float _MatcapBorder;
+ float _MatcapSmoothnessEnabled;
+ float _MatcapSmoothness;
+ float _MatcapMaskSmoothnessChannel;
+ float _MatcapMaskSmoothnessApply;
float4 _MatcapColor;
+ float _MatcapBaseColorMix;
float _MatcapColorThemeIndex;
float _MatcapIntensity;
float _MatcapReplace;
@@ -5292,6 +5318,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap2;
float4 _Matcap2_ST;
+ float4 _Matcap2_TexelSize;
float2 _Matcap2Pan;
float _Matcap2UV;
#endif
@@ -5316,7 +5343,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
float _Matcap2MaskGlobalMask;
float _Matcap2MaskGlobalMaskBlendType;
float _Matcap2Border;
+ float _Matcap2SmoothnessEnabled;
+ float _Matcap2Smoothness;
+ float _Matcap2MaskSmoothnessChannel;
+ float _Matcap2MaskSmoothnessApply;
float4 _Matcap2Color;
+ float _Matcap2BaseColorMix;
float _Matcap2ColorThemeIndex;
float _Matcap2Intensity;
float _Matcap2Replace;
@@ -5342,6 +5374,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap3;
float4 _Matcap3_ST;
+ float4 _Matcap3_TexelSize;
float2 _Matcap3Pan;
float _Matcap3UV;
#endif
@@ -5366,7 +5399,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
float _Matcap3MaskGlobalMask;
float _Matcap3MaskGlobalMaskBlendType;
float _Matcap3Border;
+ float _Matcap3SmoothnessEnabled;
+ float _Matcap3Smoothness;
+ float _Matcap3MaskSmoothnessChannel;
+ float _Matcap3MaskSmoothnessApply;
float4 _Matcap3Color;
+ float _Matcap3BaseColorMix;
float _Matcap3ColorThemeIndex;
float _Matcap3Intensity;
float _Matcap3Replace;
@@ -5392,6 +5430,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap4;
float4 _Matcap4_ST;
+ float4 _Matcap4_TexelSize;
float2 _Matcap4Pan;
float _Matcap4UV;
#endif
@@ -5416,7 +5455,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
float _Matcap4MaskGlobalMask;
float _Matcap4MaskGlobalMaskBlendType;
float _Matcap4Border;
+ float _Matcap4SmoothnessEnabled;
+ float _Matcap4Smoothness;
+ float _Matcap4MaskSmoothnessChannel;
+ float _Matcap4MaskSmoothnessApply;
float4 _Matcap4Color;
+ float _Matcap4BaseColorMix;
float _Matcap4ColorThemeIndex;
float _Matcap4Intensity;
float _Matcap4Replace;
@@ -11946,7 +11990,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
}
if (globalMaskIndex > 0)
{
- matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex-1], globalMaskBlendType);
+ matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex - 1], globalMaskBlendType);
}
poiFragData.baseColor.rgb = lerp(poiFragData.baseColor.rgb, matcapColor.rgb, replace * matcapMask * matcapColor.a * .999999);
@@ -12017,13 +12061,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcapSmoothness;
+ float mipCount0 = 9;
+ if (_MatcapSmoothnessEnabled)
+ {
+ if (_Matcap_TexelSize.z == 8192) mipCount0 = 13;
+ if (_Matcap_TexelSize.z == 4096) mipCount0 = 12;
+ if (_Matcap_TexelSize.z == 2048) mipCount0 = 11;
+ if (_Matcap_TexelSize.z == 1024) mipCount0 = 10;
+ if (_Matcap_TexelSize.z == 512) mipCount0 = 9;
+ if (_Matcap_TexelSize.z == 256) mipCount0 = 8;
+ if (_Matcap_TexelSize.z == 128) mipCount0 = 7;
+ if (_Matcap_TexelSize.z == 64) mipCount0 = 6;
+ if (_Matcap_TexelSize.z == 32) mipCount0 = 5;
+
+ matcapSmoothness = _MatcapSmoothness;
+
+ if (_MatcapMaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
+ matcapSmoothness *= POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskSmoothnessChannel];
+ #endif
+ }
+ matcapSmoothness = (1 - matcapSmoothness) * mipCount0;
+ }
+
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
- matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ if (_MatcapSmoothnessEnabled)
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap), matcapSmoothness) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
+ else
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
#else
matcap = float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
#endif
matcap.rgb *= _MatcapIntensity;
+ matcap.rgb = lerp(matcap.rgb, matcap.rgb * poiFragData.baseColor.rgb, _MatcapBaseColorMix);
+
#if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
matcapMask = POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskChannel];
#else
@@ -12101,12 +12179,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap2Smoothness;
+ float mipCount2 = 9;
+ if (_Matcap2SmoothnessEnabled)
+ {
+ if (_Matcap2_TexelSize.z == 8192) mipCount2 = 13;
+ if (_Matcap2_TexelSize.z == 4096) mipCount2 = 12;
+ if (_Matcap2_TexelSize.z == 2048) mipCount2 = 11;
+ if (_Matcap2_TexelSize.z == 1024) mipCount2 = 10;
+ if (_Matcap2_TexelSize.z == 512) mipCount2 = 9;
+ if (_Matcap2_TexelSize.z == 256) mipCount2 = 8;
+ if (_Matcap2_TexelSize.z == 128) mipCount2 = 7;
+ if (_Matcap2_TexelSize.z == 64) mipCount2 = 6;
+ if (_Matcap2_TexelSize.z == 32) mipCount2 = 5;
+
+ matcap2Smoothness = _Matcap2Smoothness;
+
+ if (_Matcap2MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap2Smoothness *= POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskSmoothnessChannel];
+ #endif
+ }
+ matcap2Smoothness = (1 - matcap2Smoothness) * mipCount2;
+ }
+
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
- matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ if (_Matcap2SmoothnessEnabled)
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2), matcap2Smoothness) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
+ else
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
#else
matcap2 = float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
#endif
+
matcap2.rgb *= _Matcap2Intensity;
+ matcap2.rgb = lerp(matcap2.rgb, matcap2.rgb * poiFragData.baseColor.rgb, _Matcap2BaseColorMix);
+
#if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
matcap2Mask = POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskChannel];
#else
@@ -12183,12 +12296,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap3Smoothness;
+ float mipCount3 = 9;
+ if (_Matcap3SmoothnessEnabled)
+ {
+ if (_Matcap3_TexelSize.z == 8192) mipCount3 = 13;
+ if (_Matcap3_TexelSize.z == 4096) mipCount3 = 12;
+ if (_Matcap3_TexelSize.z == 2048) mipCount3 = 11;
+ if (_Matcap3_TexelSize.z == 1024) mipCount3 = 10;
+ if (_Matcap3_TexelSize.z == 512) mipCount3 = 9;
+ if (_Matcap3_TexelSize.z == 256) mipCount3 = 8;
+ if (_Matcap3_TexelSize.z == 128) mipCount3 = 7;
+ if (_Matcap3_TexelSize.z == 64) mipCount3 = 6;
+ if (_Matcap3_TexelSize.z == 32) mipCount3 = 5;
+
+ matcap3Smoothness = _Matcap3Smoothness;
+
+ if (_Matcap3MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap3Smoothness *= POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskSmoothnessChannel];
+ #endif
+ }
+ matcap3Smoothness = (1 - matcap3Smoothness) * mipCount3;
+ }
+
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
- matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ if (_Matcap3SmoothnessEnabled)
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3), matcap3Smoothness) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
+ else
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
#else
matcap3 = float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
#endif
+
matcap3.rgb *= _Matcap3Intensity;
+ matcap3.rgb = lerp(matcap3.rgb, matcap3.rgb * poiFragData.baseColor.rgb, _Matcap3BaseColorMix);
+
#if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
matcap3Mask = POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskChannel];
#else
@@ -12265,12 +12413,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap4Smoothness;
+ float mipCount4 = 9;
+ if (_Matcap4SmoothnessEnabled)
+ {
+ if (_Matcap4_TexelSize.z == 8192) mipCount4 = 13;
+ if (_Matcap4_TexelSize.z == 4096) mipCount4 = 12;
+ if (_Matcap4_TexelSize.z == 2048) mipCount4 = 11;
+ if (_Matcap4_TexelSize.z == 1024) mipCount4 = 10;
+ if (_Matcap4_TexelSize.z == 512) mipCount4 = 9;
+ if (_Matcap4_TexelSize.z == 256) mipCount4 = 8;
+ if (_Matcap4_TexelSize.z == 128) mipCount4 = 7;
+ if (_Matcap4_TexelSize.z == 64) mipCount4 = 6;
+ if (_Matcap4_TexelSize.z == 32) mipCount4 = 5;
+
+ matcap4Smoothness = _Matcap4Smoothness;
+
+ if (_Matcap4MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap4Smoothness *= POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskSmoothnessChannel];
+ #endif
+ }
+ matcap4Smoothness = (1 - matcap4Smoothness) * mipCount4;
+ }
+
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
- matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ if (_Matcap4SmoothnessEnabled)
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4), matcap4Smoothness) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
+ else
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
#else
matcap4 = float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
#endif
+
matcap4.rgb *= _Matcap4Intensity;
+ matcap4.rgb = lerp(matcap4.rgb, matcap4.rgb * poiFragData.baseColor.rgb, _Matcap4BaseColorMix);
+
#if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
matcap4Mask = POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskChannel];
#else
@@ -12300,6 +12483,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
#endif
//endex
//ifex _MatcapEnable==0 && _Matcap2Enable==0 && _Matcap3Enable==0 && _Matcap4Enable==0
+
}
#endif
//endex
@@ -24605,6 +24789,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap;
float4 _Matcap_ST;
+ float4 _Matcap_TexelSize;
float2 _MatcapPan;
float _MatcapUV;
#endif
@@ -24629,7 +24814,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
float _MatcapMaskGlobalMask;
float _MatcapMaskGlobalMaskBlendType;
float _MatcapBorder;
+ float _MatcapSmoothnessEnabled;
+ float _MatcapSmoothness;
+ float _MatcapMaskSmoothnessChannel;
+ float _MatcapMaskSmoothnessApply;
float4 _MatcapColor;
+ float _MatcapBaseColorMix;
float _MatcapColorThemeIndex;
float _MatcapIntensity;
float _MatcapReplace;
@@ -24654,6 +24844,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap2;
float4 _Matcap2_ST;
+ float4 _Matcap2_TexelSize;
float2 _Matcap2Pan;
float _Matcap2UV;
#endif
@@ -24678,7 +24869,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
float _Matcap2MaskGlobalMask;
float _Matcap2MaskGlobalMaskBlendType;
float _Matcap2Border;
+ float _Matcap2SmoothnessEnabled;
+ float _Matcap2Smoothness;
+ float _Matcap2MaskSmoothnessChannel;
+ float _Matcap2MaskSmoothnessApply;
float4 _Matcap2Color;
+ float _Matcap2BaseColorMix;
float _Matcap2ColorThemeIndex;
float _Matcap2Intensity;
float _Matcap2Replace;
@@ -24704,6 +24900,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap3;
float4 _Matcap3_ST;
+ float4 _Matcap3_TexelSize;
float2 _Matcap3Pan;
float _Matcap3UV;
#endif
@@ -24728,7 +24925,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
float _Matcap3MaskGlobalMask;
float _Matcap3MaskGlobalMaskBlendType;
float _Matcap3Border;
+ float _Matcap3SmoothnessEnabled;
+ float _Matcap3Smoothness;
+ float _Matcap3MaskSmoothnessChannel;
+ float _Matcap3MaskSmoothnessApply;
float4 _Matcap3Color;
+ float _Matcap3BaseColorMix;
float _Matcap3ColorThemeIndex;
float _Matcap3Intensity;
float _Matcap3Replace;
@@ -24754,6 +24956,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap4;
float4 _Matcap4_ST;
+ float4 _Matcap4_TexelSize;
float2 _Matcap4Pan;
float _Matcap4UV;
#endif
@@ -24778,7 +24981,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
float _Matcap4MaskGlobalMask;
float _Matcap4MaskGlobalMaskBlendType;
float _Matcap4Border;
+ float _Matcap4SmoothnessEnabled;
+ float _Matcap4Smoothness;
+ float _Matcap4MaskSmoothnessChannel;
+ float _Matcap4MaskSmoothnessApply;
float4 _Matcap4Color;
+ float _Matcap4BaseColorMix;
float _Matcap4ColorThemeIndex;
float _Matcap4Intensity;
float _Matcap4Replace;
@@ -30999,7 +31207,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
}
if (globalMaskIndex > 0)
{
- matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex-1], globalMaskBlendType);
+ matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex - 1], globalMaskBlendType);
}
poiFragData.baseColor.rgb = lerp(poiFragData.baseColor.rgb, matcapColor.rgb, replace * matcapMask * matcapColor.a * .999999);
@@ -31070,13 +31278,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcapSmoothness;
+ float mipCount0 = 9;
+ if (_MatcapSmoothnessEnabled)
+ {
+ if (_Matcap_TexelSize.z == 8192) mipCount0 = 13;
+ if (_Matcap_TexelSize.z == 4096) mipCount0 = 12;
+ if (_Matcap_TexelSize.z == 2048) mipCount0 = 11;
+ if (_Matcap_TexelSize.z == 1024) mipCount0 = 10;
+ if (_Matcap_TexelSize.z == 512) mipCount0 = 9;
+ if (_Matcap_TexelSize.z == 256) mipCount0 = 8;
+ if (_Matcap_TexelSize.z == 128) mipCount0 = 7;
+ if (_Matcap_TexelSize.z == 64) mipCount0 = 6;
+ if (_Matcap_TexelSize.z == 32) mipCount0 = 5;
+
+ matcapSmoothness = _MatcapSmoothness;
+
+ if (_MatcapMaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
+ matcapSmoothness *= POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskSmoothnessChannel];
+ #endif
+ }
+ matcapSmoothness = (1 - matcapSmoothness) * mipCount0;
+ }
+
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
- matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ if (_MatcapSmoothnessEnabled)
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap), matcapSmoothness) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
+ else
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
#else
matcap = float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
#endif
matcap.rgb *= _MatcapIntensity;
+ matcap.rgb = lerp(matcap.rgb, matcap.rgb * poiFragData.baseColor.rgb, _MatcapBaseColorMix);
+
#if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
matcapMask = POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskChannel];
#else
@@ -31154,12 +31396,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap2Smoothness;
+ float mipCount2 = 9;
+ if (_Matcap2SmoothnessEnabled)
+ {
+ if (_Matcap2_TexelSize.z == 8192) mipCount2 = 13;
+ if (_Matcap2_TexelSize.z == 4096) mipCount2 = 12;
+ if (_Matcap2_TexelSize.z == 2048) mipCount2 = 11;
+ if (_Matcap2_TexelSize.z == 1024) mipCount2 = 10;
+ if (_Matcap2_TexelSize.z == 512) mipCount2 = 9;
+ if (_Matcap2_TexelSize.z == 256) mipCount2 = 8;
+ if (_Matcap2_TexelSize.z == 128) mipCount2 = 7;
+ if (_Matcap2_TexelSize.z == 64) mipCount2 = 6;
+ if (_Matcap2_TexelSize.z == 32) mipCount2 = 5;
+
+ matcap2Smoothness = _Matcap2Smoothness;
+
+ if (_Matcap2MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap2Smoothness *= POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskSmoothnessChannel];
+ #endif
+ }
+ matcap2Smoothness = (1 - matcap2Smoothness) * mipCount2;
+ }
+
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
- matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ if (_Matcap2SmoothnessEnabled)
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2), matcap2Smoothness) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
+ else
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
#else
matcap2 = float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
#endif
+
matcap2.rgb *= _Matcap2Intensity;
+ matcap2.rgb = lerp(matcap2.rgb, matcap2.rgb * poiFragData.baseColor.rgb, _Matcap2BaseColorMix);
+
#if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
matcap2Mask = POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskChannel];
#else
@@ -31236,12 +31513,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap3Smoothness;
+ float mipCount3 = 9;
+ if (_Matcap3SmoothnessEnabled)
+ {
+ if (_Matcap3_TexelSize.z == 8192) mipCount3 = 13;
+ if (_Matcap3_TexelSize.z == 4096) mipCount3 = 12;
+ if (_Matcap3_TexelSize.z == 2048) mipCount3 = 11;
+ if (_Matcap3_TexelSize.z == 1024) mipCount3 = 10;
+ if (_Matcap3_TexelSize.z == 512) mipCount3 = 9;
+ if (_Matcap3_TexelSize.z == 256) mipCount3 = 8;
+ if (_Matcap3_TexelSize.z == 128) mipCount3 = 7;
+ if (_Matcap3_TexelSize.z == 64) mipCount3 = 6;
+ if (_Matcap3_TexelSize.z == 32) mipCount3 = 5;
+
+ matcap3Smoothness = _Matcap3Smoothness;
+
+ if (_Matcap3MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap3Smoothness *= POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskSmoothnessChannel];
+ #endif
+ }
+ matcap3Smoothness = (1 - matcap3Smoothness) * mipCount3;
+ }
+
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
- matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ if (_Matcap3SmoothnessEnabled)
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3), matcap3Smoothness) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
+ else
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
#else
matcap3 = float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
#endif
+
matcap3.rgb *= _Matcap3Intensity;
+ matcap3.rgb = lerp(matcap3.rgb, matcap3.rgb * poiFragData.baseColor.rgb, _Matcap3BaseColorMix);
+
#if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
matcap3Mask = POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskChannel];
#else
@@ -31318,12 +31630,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap4Smoothness;
+ float mipCount4 = 9;
+ if (_Matcap4SmoothnessEnabled)
+ {
+ if (_Matcap4_TexelSize.z == 8192) mipCount4 = 13;
+ if (_Matcap4_TexelSize.z == 4096) mipCount4 = 12;
+ if (_Matcap4_TexelSize.z == 2048) mipCount4 = 11;
+ if (_Matcap4_TexelSize.z == 1024) mipCount4 = 10;
+ if (_Matcap4_TexelSize.z == 512) mipCount4 = 9;
+ if (_Matcap4_TexelSize.z == 256) mipCount4 = 8;
+ if (_Matcap4_TexelSize.z == 128) mipCount4 = 7;
+ if (_Matcap4_TexelSize.z == 64) mipCount4 = 6;
+ if (_Matcap4_TexelSize.z == 32) mipCount4 = 5;
+
+ matcap4Smoothness = _Matcap4Smoothness;
+
+ if (_Matcap4MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap4Smoothness *= POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskSmoothnessChannel];
+ #endif
+ }
+ matcap4Smoothness = (1 - matcap4Smoothness) * mipCount4;
+ }
+
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
- matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ if (_Matcap4SmoothnessEnabled)
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4), matcap4Smoothness) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
+ else
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
#else
matcap4 = float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
#endif
+
matcap4.rgb *= _Matcap4Intensity;
+ matcap4.rgb = lerp(matcap4.rgb, matcap4.rgb * poiFragData.baseColor.rgb, _Matcap4BaseColorMix);
+
#if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
matcap4Mask = POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskChannel];
#else
@@ -31353,6 +31700,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon Outline"
#endif
//endex
//ifex _MatcapEnable==0 && _Matcap2Enable==0 && _Matcap3Enable==0 && _Matcap4Enable==0
+
}
#endif
//endex
diff --git a/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi World.shader b/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi World.shader
index 1b8c369..868d182 100644
--- a/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi World.shader
+++ b/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi World.shader
@@ -2,7 +2,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
{
Properties
{
- [HideInInspector] shader_master_label ("Poiyomi 8.1.156", Float) = 0
+ [HideInInspector] shader_master_label ("Poiyomi 8.1.160", Float) = 0
[HideInInspector] shader_is_using_thry_editor ("", Float) = 0
[HideInInspector] shader_locale ("0db0b86376c3dca4b9a6828ef8615fe0", Float) = 0
[HideInInspector] footer_youtube ("{texture:{name:icon-youtube,height:16},action:{type:URL,data:https://www.youtube.com/poiyomi},hover:YOUTUBE}", Float) = 0
@@ -1348,10 +1348,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
[HideInInspector][ThryToggle(POI_MATCAP0)]_MatcapEnable ("Enable Matcap", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _MatcapUVMode ("UV Mode", Int) = 1
_MatcapColor ("Color--{reference_property:_MatcapColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _MatcapBaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _MatcapColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap ("Matcap", 2D) = "white" { }
_MatcapBorder ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_MatcapMask ("Mask--{reference_properties:[_MatcapMaskPan, _MatcapMaskUV, _MatcapMaskChannel, _MatcapMaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_MatcapMask ("Mask--{reference_properties:[_MatcapMaskPan, _MatcapMaskUV, _MatcapMaskChannel, _MatcapMaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_MatcapMaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _MatcapMaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_MatcapMaskChannel ("Channel", Float) = 0
@@ -1376,6 +1377,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
[ThryToggleUI(true)] _MatcapHueShiftEnabled (" Hue Shift", Float) = 0
_MatcapHueShiftSpeed ("Shift Speed--{condition_showS:(_MatcapHueShiftEnabled==1)}", Float) = 0
_MatcapHueShift ("Hue Shift--{condition_showS:(_MatcapHueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _MatcapSmoothnessEnabled (" Blur", Float) = 0
+ _MatcapSmoothness ("Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_MatcapMaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_MatcapMaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_MatcapTPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _MatcapTPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_MatcapTPSMaskStrength ("TPS Mask Strength--{condition_showS:(_MatcapTPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1389,10 +1394,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
[HideInInspector][ThryToggle(COLOR_GRADING_HDR_3D)]_Matcap2Enable ("Enable Matcap 2", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap2UVMode ("UV Mode", Int) = 1
_Matcap2Color ("Color--{reference_property:_Matcap2ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap2BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap2ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap2 ("Matcap", 2D) = "white" { }
_Matcap2Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap2Mask ("Mask--{reference_properties:[_Matcap2MaskPan, _Matcap2MaskUV, _Matcap2MaskChannel, _Matcap2MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap2Mask ("Mask--{reference_properties:[_Matcap2MaskPan, _Matcap2MaskUV, _Matcap2MaskChannel, _Matcap2MaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_Matcap2MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap2MaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap2MaskChannel ("Channel", Float) = 0
@@ -1418,6 +1424,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
[ThryToggleUI(true)] _Matcap2HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap2HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap2HueShiftEnabled==1)}", Float) = 0
_Matcap2HueShift ("Hue Shift--{condition_showS:(_Matcap2HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap2SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap2Smoothness ("Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap2MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap2MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap2TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap2TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap2TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap2TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1431,10 +1441,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
[HideInInspector][ThryToggle(POI_MATCAP2)]_Matcap3Enable ("Enable Matcap 2", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap3UVMode ("UV Mode", Int) = 1
_Matcap3Color ("Color--{reference_property:_Matcap3ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap3BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap3ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap3 ("Matcap", 2D) = "white" { }
_Matcap3Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap3Mask ("Mask--{reference_properties:[_Matcap3MaskPan, _Matcap3MaskUV, _Matcap3MaskChannel, _Matcap3MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap3Mask ("Mask--{reference_properties:[_Matcap3MaskPan, _Matcap3MaskUV, _Matcap3MaskChannel, _Matcap3MaskInvert]}", 2D) = "white" { }
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap3MaskChannel ("Channel", Float) = 0
[HideInInspector][Vector2]_Matcap3MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap3MaskUV ("UV", Int) = 0
@@ -1460,6 +1471,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
[ThryToggleUI(true)] _Matcap3HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap3HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap3HueShiftEnabled==1)}", Float) = 0
_Matcap3HueShift ("Hue Shift--{condition_showS:(_Matcap3HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap3SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap3Smoothness ("Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap3MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap3MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap3TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap3TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap3TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap3TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1473,10 +1488,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
[HideInInspector][ThryToggle(POI_MATCAP3)]_Matcap4Enable ("Enable Matcap 3", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap4UVMode ("UV Mode", Int) = 1
_Matcap4Color ("Color--{reference_property:_Matcap4ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap4BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap4ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap4 ("Matcap", 2D) = "white" { }
_Matcap4Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap4Mask ("Mask--{reference_properties:[_Matcap4MaskPan, _Matcap4MaskUV, _Matcap4MaskChannel, _Matcap4MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap4Mask ("Mask--{reference_properties:[_Matcap4MaskPan, _Matcap4MaskUV, _Matcap4MaskChannel, _Matcap4MaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_Matcap4MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap4MaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap4MaskChannel ("Channel", Float) = 0
@@ -1502,6 +1518,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
[ThryToggleUI(true)] _Matcap4HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap4HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap4HueShiftEnabled==1)}", Float) = 0
_Matcap4HueShift ("Hue Shift--{condition_showS:(_Matcap4HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap4SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap4Smoothness ("Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap4MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap4MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap4TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap4TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap4TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap4TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -5130,6 +5150,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap;
float4 _Matcap_ST;
+ float4 _Matcap_TexelSize;
float2 _MatcapPan;
float _MatcapUV;
#endif
@@ -5154,7 +5175,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
float _MatcapMaskGlobalMask;
float _MatcapMaskGlobalMaskBlendType;
float _MatcapBorder;
+ float _MatcapSmoothnessEnabled;
+ float _MatcapSmoothness;
+ float _MatcapMaskSmoothnessChannel;
+ float _MatcapMaskSmoothnessApply;
float4 _MatcapColor;
+ float _MatcapBaseColorMix;
float _MatcapColorThemeIndex;
float _MatcapIntensity;
float _MatcapReplace;
@@ -5179,6 +5205,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap2;
float4 _Matcap2_ST;
+ float4 _Matcap2_TexelSize;
float2 _Matcap2Pan;
float _Matcap2UV;
#endif
@@ -5203,7 +5230,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
float _Matcap2MaskGlobalMask;
float _Matcap2MaskGlobalMaskBlendType;
float _Matcap2Border;
+ float _Matcap2SmoothnessEnabled;
+ float _Matcap2Smoothness;
+ float _Matcap2MaskSmoothnessChannel;
+ float _Matcap2MaskSmoothnessApply;
float4 _Matcap2Color;
+ float _Matcap2BaseColorMix;
float _Matcap2ColorThemeIndex;
float _Matcap2Intensity;
float _Matcap2Replace;
@@ -5229,6 +5261,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap3;
float4 _Matcap3_ST;
+ float4 _Matcap3_TexelSize;
float2 _Matcap3Pan;
float _Matcap3UV;
#endif
@@ -5253,7 +5286,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
float _Matcap3MaskGlobalMask;
float _Matcap3MaskGlobalMaskBlendType;
float _Matcap3Border;
+ float _Matcap3SmoothnessEnabled;
+ float _Matcap3Smoothness;
+ float _Matcap3MaskSmoothnessChannel;
+ float _Matcap3MaskSmoothnessApply;
float4 _Matcap3Color;
+ float _Matcap3BaseColorMix;
float _Matcap3ColorThemeIndex;
float _Matcap3Intensity;
float _Matcap3Replace;
@@ -5279,6 +5317,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap4;
float4 _Matcap4_ST;
+ float4 _Matcap4_TexelSize;
float2 _Matcap4Pan;
float _Matcap4UV;
#endif
@@ -5303,7 +5342,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
float _Matcap4MaskGlobalMask;
float _Matcap4MaskGlobalMaskBlendType;
float _Matcap4Border;
+ float _Matcap4SmoothnessEnabled;
+ float _Matcap4Smoothness;
+ float _Matcap4MaskSmoothnessChannel;
+ float _Matcap4MaskSmoothnessApply;
float4 _Matcap4Color;
+ float _Matcap4BaseColorMix;
float _Matcap4ColorThemeIndex;
float _Matcap4Intensity;
float _Matcap4Replace;
@@ -11722,7 +11766,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
}
if (globalMaskIndex > 0)
{
- matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex-1], globalMaskBlendType);
+ matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex - 1], globalMaskBlendType);
}
poiFragData.baseColor.rgb = lerp(poiFragData.baseColor.rgb, matcapColor.rgb, replace * matcapMask * matcapColor.a * .999999);
@@ -11793,13 +11837,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcapSmoothness;
+ float mipCount0 = 9;
+ if (_MatcapSmoothnessEnabled)
+ {
+ if (_Matcap_TexelSize.z == 8192) mipCount0 = 13;
+ if (_Matcap_TexelSize.z == 4096) mipCount0 = 12;
+ if (_Matcap_TexelSize.z == 2048) mipCount0 = 11;
+ if (_Matcap_TexelSize.z == 1024) mipCount0 = 10;
+ if (_Matcap_TexelSize.z == 512) mipCount0 = 9;
+ if (_Matcap_TexelSize.z == 256) mipCount0 = 8;
+ if (_Matcap_TexelSize.z == 128) mipCount0 = 7;
+ if (_Matcap_TexelSize.z == 64) mipCount0 = 6;
+ if (_Matcap_TexelSize.z == 32) mipCount0 = 5;
+
+ matcapSmoothness = _MatcapSmoothness;
+
+ if (_MatcapMaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
+ matcapSmoothness *= POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskSmoothnessChannel];
+ #endif
+ }
+ matcapSmoothness = (1 - matcapSmoothness) * mipCount0;
+ }
+
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
- matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ if (_MatcapSmoothnessEnabled)
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap), matcapSmoothness) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
+ else
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
#else
matcap = float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
#endif
matcap.rgb *= _MatcapIntensity;
+ matcap.rgb = lerp(matcap.rgb, matcap.rgb * poiFragData.baseColor.rgb, _MatcapBaseColorMix);
+
#if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
matcapMask = POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskChannel];
#else
@@ -11877,12 +11955,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap2Smoothness;
+ float mipCount2 = 9;
+ if (_Matcap2SmoothnessEnabled)
+ {
+ if (_Matcap2_TexelSize.z == 8192) mipCount2 = 13;
+ if (_Matcap2_TexelSize.z == 4096) mipCount2 = 12;
+ if (_Matcap2_TexelSize.z == 2048) mipCount2 = 11;
+ if (_Matcap2_TexelSize.z == 1024) mipCount2 = 10;
+ if (_Matcap2_TexelSize.z == 512) mipCount2 = 9;
+ if (_Matcap2_TexelSize.z == 256) mipCount2 = 8;
+ if (_Matcap2_TexelSize.z == 128) mipCount2 = 7;
+ if (_Matcap2_TexelSize.z == 64) mipCount2 = 6;
+ if (_Matcap2_TexelSize.z == 32) mipCount2 = 5;
+
+ matcap2Smoothness = _Matcap2Smoothness;
+
+ if (_Matcap2MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap2Smoothness *= POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskSmoothnessChannel];
+ #endif
+ }
+ matcap2Smoothness = (1 - matcap2Smoothness) * mipCount2;
+ }
+
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
- matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ if (_Matcap2SmoothnessEnabled)
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2), matcap2Smoothness) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
+ else
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
#else
matcap2 = float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
#endif
+
matcap2.rgb *= _Matcap2Intensity;
+ matcap2.rgb = lerp(matcap2.rgb, matcap2.rgb * poiFragData.baseColor.rgb, _Matcap2BaseColorMix);
+
#if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
matcap2Mask = POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskChannel];
#else
@@ -11959,12 +12072,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap3Smoothness;
+ float mipCount3 = 9;
+ if (_Matcap3SmoothnessEnabled)
+ {
+ if (_Matcap3_TexelSize.z == 8192) mipCount3 = 13;
+ if (_Matcap3_TexelSize.z == 4096) mipCount3 = 12;
+ if (_Matcap3_TexelSize.z == 2048) mipCount3 = 11;
+ if (_Matcap3_TexelSize.z == 1024) mipCount3 = 10;
+ if (_Matcap3_TexelSize.z == 512) mipCount3 = 9;
+ if (_Matcap3_TexelSize.z == 256) mipCount3 = 8;
+ if (_Matcap3_TexelSize.z == 128) mipCount3 = 7;
+ if (_Matcap3_TexelSize.z == 64) mipCount3 = 6;
+ if (_Matcap3_TexelSize.z == 32) mipCount3 = 5;
+
+ matcap3Smoothness = _Matcap3Smoothness;
+
+ if (_Matcap3MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap3Smoothness *= POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskSmoothnessChannel];
+ #endif
+ }
+ matcap3Smoothness = (1 - matcap3Smoothness) * mipCount3;
+ }
+
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
- matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ if (_Matcap3SmoothnessEnabled)
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3), matcap3Smoothness) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
+ else
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
#else
matcap3 = float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
#endif
+
matcap3.rgb *= _Matcap3Intensity;
+ matcap3.rgb = lerp(matcap3.rgb, matcap3.rgb * poiFragData.baseColor.rgb, _Matcap3BaseColorMix);
+
#if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
matcap3Mask = POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskChannel];
#else
@@ -12041,12 +12189,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap4Smoothness;
+ float mipCount4 = 9;
+ if (_Matcap4SmoothnessEnabled)
+ {
+ if (_Matcap4_TexelSize.z == 8192) mipCount4 = 13;
+ if (_Matcap4_TexelSize.z == 4096) mipCount4 = 12;
+ if (_Matcap4_TexelSize.z == 2048) mipCount4 = 11;
+ if (_Matcap4_TexelSize.z == 1024) mipCount4 = 10;
+ if (_Matcap4_TexelSize.z == 512) mipCount4 = 9;
+ if (_Matcap4_TexelSize.z == 256) mipCount4 = 8;
+ if (_Matcap4_TexelSize.z == 128) mipCount4 = 7;
+ if (_Matcap4_TexelSize.z == 64) mipCount4 = 6;
+ if (_Matcap4_TexelSize.z == 32) mipCount4 = 5;
+
+ matcap4Smoothness = _Matcap4Smoothness;
+
+ if (_Matcap4MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap4Smoothness *= POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskSmoothnessChannel];
+ #endif
+ }
+ matcap4Smoothness = (1 - matcap4Smoothness) * mipCount4;
+ }
+
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
- matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ if (_Matcap4SmoothnessEnabled)
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4), matcap4Smoothness) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
+ else
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
#else
matcap4 = float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
#endif
+
matcap4.rgb *= _Matcap4Intensity;
+ matcap4.rgb = lerp(matcap4.rgb, matcap4.rgb * poiFragData.baseColor.rgb, _Matcap4BaseColorMix);
+
#if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
matcap4Mask = POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskChannel];
#else
@@ -12076,6 +12259,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
#endif
//endex
//ifex _MatcapEnable==0 && _Matcap2Enable==0 && _Matcap3Enable==0 && _Matcap4Enable==0
+
}
#endif
//endex
@@ -17972,6 +18156,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap;
float4 _Matcap_ST;
+ float4 _Matcap_TexelSize;
float2 _MatcapPan;
float _MatcapUV;
#endif
@@ -17996,7 +18181,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
float _MatcapMaskGlobalMask;
float _MatcapMaskGlobalMaskBlendType;
float _MatcapBorder;
+ float _MatcapSmoothnessEnabled;
+ float _MatcapSmoothness;
+ float _MatcapMaskSmoothnessChannel;
+ float _MatcapMaskSmoothnessApply;
float4 _MatcapColor;
+ float _MatcapBaseColorMix;
float _MatcapColorThemeIndex;
float _MatcapIntensity;
float _MatcapReplace;
@@ -18021,6 +18211,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap2;
float4 _Matcap2_ST;
+ float4 _Matcap2_TexelSize;
float2 _Matcap2Pan;
float _Matcap2UV;
#endif
@@ -18045,7 +18236,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
float _Matcap2MaskGlobalMask;
float _Matcap2MaskGlobalMaskBlendType;
float _Matcap2Border;
+ float _Matcap2SmoothnessEnabled;
+ float _Matcap2Smoothness;
+ float _Matcap2MaskSmoothnessChannel;
+ float _Matcap2MaskSmoothnessApply;
float4 _Matcap2Color;
+ float _Matcap2BaseColorMix;
float _Matcap2ColorThemeIndex;
float _Matcap2Intensity;
float _Matcap2Replace;
@@ -18071,6 +18267,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap3;
float4 _Matcap3_ST;
+ float4 _Matcap3_TexelSize;
float2 _Matcap3Pan;
float _Matcap3UV;
#endif
@@ -18095,7 +18292,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
float _Matcap3MaskGlobalMask;
float _Matcap3MaskGlobalMaskBlendType;
float _Matcap3Border;
+ float _Matcap3SmoothnessEnabled;
+ float _Matcap3Smoothness;
+ float _Matcap3MaskSmoothnessChannel;
+ float _Matcap3MaskSmoothnessApply;
float4 _Matcap3Color;
+ float _Matcap3BaseColorMix;
float _Matcap3ColorThemeIndex;
float _Matcap3Intensity;
float _Matcap3Replace;
@@ -18121,6 +18323,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap4;
float4 _Matcap4_ST;
+ float4 _Matcap4_TexelSize;
float2 _Matcap4Pan;
float _Matcap4UV;
#endif
@@ -18145,7 +18348,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
float _Matcap4MaskGlobalMask;
float _Matcap4MaskGlobalMaskBlendType;
float _Matcap4Border;
+ float _Matcap4SmoothnessEnabled;
+ float _Matcap4Smoothness;
+ float _Matcap4MaskSmoothnessChannel;
+ float _Matcap4MaskSmoothnessApply;
float4 _Matcap4Color;
+ float _Matcap4BaseColorMix;
float _Matcap4ColorThemeIndex;
float _Matcap4Intensity;
float _Matcap4Replace;
@@ -24255,7 +24463,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
}
if (globalMaskIndex > 0)
{
- matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex-1], globalMaskBlendType);
+ matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex - 1], globalMaskBlendType);
}
poiFragData.baseColor.rgb = lerp(poiFragData.baseColor.rgb, matcapColor.rgb, replace * matcapMask * matcapColor.a * .999999);
@@ -24326,13 +24534,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcapSmoothness;
+ float mipCount0 = 9;
+ if (_MatcapSmoothnessEnabled)
+ {
+ if (_Matcap_TexelSize.z == 8192) mipCount0 = 13;
+ if (_Matcap_TexelSize.z == 4096) mipCount0 = 12;
+ if (_Matcap_TexelSize.z == 2048) mipCount0 = 11;
+ if (_Matcap_TexelSize.z == 1024) mipCount0 = 10;
+ if (_Matcap_TexelSize.z == 512) mipCount0 = 9;
+ if (_Matcap_TexelSize.z == 256) mipCount0 = 8;
+ if (_Matcap_TexelSize.z == 128) mipCount0 = 7;
+ if (_Matcap_TexelSize.z == 64) mipCount0 = 6;
+ if (_Matcap_TexelSize.z == 32) mipCount0 = 5;
+
+ matcapSmoothness = _MatcapSmoothness;
+
+ if (_MatcapMaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
+ matcapSmoothness *= POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskSmoothnessChannel];
+ #endif
+ }
+ matcapSmoothness = (1 - matcapSmoothness) * mipCount0;
+ }
+
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
- matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ if (_MatcapSmoothnessEnabled)
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap), matcapSmoothness) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
+ else
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
#else
matcap = float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
#endif
matcap.rgb *= _MatcapIntensity;
+ matcap.rgb = lerp(matcap.rgb, matcap.rgb * poiFragData.baseColor.rgb, _MatcapBaseColorMix);
+
#if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
matcapMask = POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskChannel];
#else
@@ -24410,12 +24652,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap2Smoothness;
+ float mipCount2 = 9;
+ if (_Matcap2SmoothnessEnabled)
+ {
+ if (_Matcap2_TexelSize.z == 8192) mipCount2 = 13;
+ if (_Matcap2_TexelSize.z == 4096) mipCount2 = 12;
+ if (_Matcap2_TexelSize.z == 2048) mipCount2 = 11;
+ if (_Matcap2_TexelSize.z == 1024) mipCount2 = 10;
+ if (_Matcap2_TexelSize.z == 512) mipCount2 = 9;
+ if (_Matcap2_TexelSize.z == 256) mipCount2 = 8;
+ if (_Matcap2_TexelSize.z == 128) mipCount2 = 7;
+ if (_Matcap2_TexelSize.z == 64) mipCount2 = 6;
+ if (_Matcap2_TexelSize.z == 32) mipCount2 = 5;
+
+ matcap2Smoothness = _Matcap2Smoothness;
+
+ if (_Matcap2MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap2Smoothness *= POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskSmoothnessChannel];
+ #endif
+ }
+ matcap2Smoothness = (1 - matcap2Smoothness) * mipCount2;
+ }
+
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
- matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ if (_Matcap2SmoothnessEnabled)
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2), matcap2Smoothness) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
+ else
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
#else
matcap2 = float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
#endif
+
matcap2.rgb *= _Matcap2Intensity;
+ matcap2.rgb = lerp(matcap2.rgb, matcap2.rgb * poiFragData.baseColor.rgb, _Matcap2BaseColorMix);
+
#if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
matcap2Mask = POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskChannel];
#else
@@ -24492,12 +24769,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap3Smoothness;
+ float mipCount3 = 9;
+ if (_Matcap3SmoothnessEnabled)
+ {
+ if (_Matcap3_TexelSize.z == 8192) mipCount3 = 13;
+ if (_Matcap3_TexelSize.z == 4096) mipCount3 = 12;
+ if (_Matcap3_TexelSize.z == 2048) mipCount3 = 11;
+ if (_Matcap3_TexelSize.z == 1024) mipCount3 = 10;
+ if (_Matcap3_TexelSize.z == 512) mipCount3 = 9;
+ if (_Matcap3_TexelSize.z == 256) mipCount3 = 8;
+ if (_Matcap3_TexelSize.z == 128) mipCount3 = 7;
+ if (_Matcap3_TexelSize.z == 64) mipCount3 = 6;
+ if (_Matcap3_TexelSize.z == 32) mipCount3 = 5;
+
+ matcap3Smoothness = _Matcap3Smoothness;
+
+ if (_Matcap3MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap3Smoothness *= POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskSmoothnessChannel];
+ #endif
+ }
+ matcap3Smoothness = (1 - matcap3Smoothness) * mipCount3;
+ }
+
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
- matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ if (_Matcap3SmoothnessEnabled)
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3), matcap3Smoothness) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
+ else
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
#else
matcap3 = float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
#endif
+
matcap3.rgb *= _Matcap3Intensity;
+ matcap3.rgb = lerp(matcap3.rgb, matcap3.rgb * poiFragData.baseColor.rgb, _Matcap3BaseColorMix);
+
#if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
matcap3Mask = POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskChannel];
#else
@@ -24574,12 +24886,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap4Smoothness;
+ float mipCount4 = 9;
+ if (_Matcap4SmoothnessEnabled)
+ {
+ if (_Matcap4_TexelSize.z == 8192) mipCount4 = 13;
+ if (_Matcap4_TexelSize.z == 4096) mipCount4 = 12;
+ if (_Matcap4_TexelSize.z == 2048) mipCount4 = 11;
+ if (_Matcap4_TexelSize.z == 1024) mipCount4 = 10;
+ if (_Matcap4_TexelSize.z == 512) mipCount4 = 9;
+ if (_Matcap4_TexelSize.z == 256) mipCount4 = 8;
+ if (_Matcap4_TexelSize.z == 128) mipCount4 = 7;
+ if (_Matcap4_TexelSize.z == 64) mipCount4 = 6;
+ if (_Matcap4_TexelSize.z == 32) mipCount4 = 5;
+
+ matcap4Smoothness = _Matcap4Smoothness;
+
+ if (_Matcap4MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap4Smoothness *= POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskSmoothnessChannel];
+ #endif
+ }
+ matcap4Smoothness = (1 - matcap4Smoothness) * mipCount4;
+ }
+
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
- matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ if (_Matcap4SmoothnessEnabled)
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4), matcap4Smoothness) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
+ else
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
#else
matcap4 = float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
#endif
+
matcap4.rgb *= _Matcap4Intensity;
+ matcap4.rgb = lerp(matcap4.rgb, matcap4.rgb * poiFragData.baseColor.rgb, _Matcap4BaseColorMix);
+
#if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
matcap4Mask = POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskChannel];
#else
@@ -24609,6 +24956,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi World"
#endif
//endex
//ifex _MatcapEnable==0 && _Matcap2Enable==0 && _Matcap3Enable==0 && _Matcap4Enable==0
+
}
#endif
//endex
diff --git a/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi.shader b/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi.shader
index d04c44f..810b6ec 100644
--- a/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi.shader
+++ b/_PoiyomiShaders/Shaders/8.1/Toon/Poiyomi.shader
@@ -2,7 +2,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
{
Properties
{
- [HideInInspector] shader_master_label ("Poiyomi 8.1.156", Float) = 0
+ [HideInInspector] shader_master_label ("Poiyomi 8.1.160", Float) = 0
[HideInInspector] shader_is_using_thry_editor ("", Float) = 0
[HideInInspector] shader_locale ("0db0b86376c3dca4b9a6828ef8615fe0", Float) = 0
[HideInInspector] footer_youtube ("{texture:{name:icon-youtube,height:16},action:{type:URL,data:https://www.youtube.com/poiyomi},hover:YOUTUBE}", Float) = 0
@@ -1340,10 +1340,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
[HideInInspector][ThryToggle(POI_MATCAP0)]_MatcapEnable ("Enable Matcap", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _MatcapUVMode ("UV Mode", Int) = 1
_MatcapColor ("Color--{reference_property:_MatcapColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _MatcapBaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _MatcapColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap ("Matcap", 2D) = "white" { }
_MatcapBorder ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_MatcapMask ("Mask--{reference_properties:[_MatcapMaskPan, _MatcapMaskUV, _MatcapMaskChannel, _MatcapMaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_MatcapMask ("Mask--{reference_properties:[_MatcapMaskPan, _MatcapMaskUV, _MatcapMaskChannel, _MatcapMaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_MatcapMaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _MatcapMaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_MatcapMaskChannel ("Channel", Float) = 0
@@ -1368,6 +1369,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
[ThryToggleUI(true)] _MatcapHueShiftEnabled (" Hue Shift", Float) = 0
_MatcapHueShiftSpeed ("Shift Speed--{condition_showS:(_MatcapHueShiftEnabled==1)}", Float) = 0
_MatcapHueShift ("Hue Shift--{condition_showS:(_MatcapHueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _MatcapSmoothnessEnabled (" Blur", Float) = 0
+ _MatcapSmoothness ("Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_MatcapMaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_MatcapMaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_MatcapSmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_MatcapTPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _MatcapTPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_MatcapTPSMaskStrength ("TPS Mask Strength--{condition_showS:(_MatcapTPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1381,10 +1386,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
[HideInInspector][ThryToggle(COLOR_GRADING_HDR_3D)]_Matcap2Enable ("Enable Matcap 2", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap2UVMode ("UV Mode", Int) = 1
_Matcap2Color ("Color--{reference_property:_Matcap2ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap2BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap2ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap2 ("Matcap", 2D) = "white" { }
_Matcap2Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap2Mask ("Mask--{reference_properties:[_Matcap2MaskPan, _Matcap2MaskUV, _Matcap2MaskChannel, _Matcap2MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap2Mask ("Mask--{reference_properties:[_Matcap2MaskPan, _Matcap2MaskUV, _Matcap2MaskChannel, _Matcap2MaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_Matcap2MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap2MaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap2MaskChannel ("Channel", Float) = 0
@@ -1410,6 +1416,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
[ThryToggleUI(true)] _Matcap2HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap2HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap2HueShiftEnabled==1)}", Float) = 0
_Matcap2HueShift ("Hue Shift--{condition_showS:(_Matcap2HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap2SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap2Smoothness ("Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap2MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap2MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap2SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap2TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap2TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap2TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap2TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1423,10 +1433,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
[HideInInspector][ThryToggle(POI_MATCAP2)]_Matcap3Enable ("Enable Matcap 2", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap3UVMode ("UV Mode", Int) = 1
_Matcap3Color ("Color--{reference_property:_Matcap3ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap3BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap3ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap3 ("Matcap", 2D) = "white" { }
_Matcap3Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap3Mask ("Mask--{reference_properties:[_Matcap3MaskPan, _Matcap3MaskUV, _Matcap3MaskChannel, _Matcap3MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap3Mask ("Mask--{reference_properties:[_Matcap3MaskPan, _Matcap3MaskUV, _Matcap3MaskChannel, _Matcap3MaskInvert]}", 2D) = "white" { }
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap3MaskChannel ("Channel", Float) = 0
[HideInInspector][Vector2]_Matcap3MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap3MaskUV ("UV", Int) = 0
@@ -1452,6 +1463,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
[ThryToggleUI(true)] _Matcap3HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap3HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap3HueShiftEnabled==1)}", Float) = 0
_Matcap3HueShift ("Hue Shift--{condition_showS:(_Matcap3HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap3SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap3Smoothness ("Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap3MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap3MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap3SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap3TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap3TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap3TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap3TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -1465,10 +1480,11 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
[HideInInspector][ThryToggle(POI_MATCAP3)]_Matcap4Enable ("Enable Matcap 3", Float) = 0
[ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap4UVMode ("UV Mode", Int) = 1
_Matcap4Color ("Color--{reference_property:_Matcap4ColorThemeIndex}", Color) = (1, 1, 1, 1)
+ _Matcap4BaseColorMix ("Base Color Mix", Range(0, 1)) = 0
[HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap4ColorThemeIndex ("", Int) = 0
[sRGBWarning(true)][TextureNoSO]_Matcap4 ("Matcap", 2D) = "white" { }
_Matcap4Border ("Border", Range(0, .5)) = 0.43
- [sRGBWarning]_Matcap4Mask ("Mask--{reference_properties:[_Matcap4MaskPan, _Matcap4MaskUV, _Matcap4MaskChannel, _Matcap4MaskInvert]}", 2D) = "white" { }
+ [sRGBWarning][ThryRGBAPacker(R Mask, G Nothing, B Nothing, A Smoothness)]_Matcap4Mask ("Mask--{reference_properties:[_Matcap4MaskPan, _Matcap4MaskUV, _Matcap4MaskChannel, _Matcap4MaskInvert]}", 2D) = "white" { }
[HideInInspector][Vector2]_Matcap4MaskPan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap4MaskUV ("UV", Int) = 0
[HideInInspector][Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap4MaskChannel ("Channel", Float) = 0
@@ -1494,6 +1510,10 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
[ThryToggleUI(true)] _Matcap4HueShiftEnabled (" Hue Shift", Float) = 0
_Matcap4HueShiftSpeed ("Shift Speed--{condition_showS:(_Matcap4HueShiftEnabled==1)}", Float) = 0
_Matcap4HueShift ("Hue Shift--{condition_showS:(_Matcap4HueShiftEnabled==1)}", Range(0, 1)) = 0
+ [ThryToggleUI(true)] _Matcap4SmoothnessEnabled (" Blur", Float) = 0
+ _Matcap4Smoothness ("Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Range(0, 1)) = 1
+ [ToggleUI]_Matcap4MaskSmoothnessApply ("Apply Mask for Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Float) = 0
+ [Enum(R, 0, G, 1, B, 2, A, 3)]_Matcap4MaskSmoothnessChannel ("Mask Channel for Smoothness--{condition_showS:(_Matcap4SmoothnessEnabled==1)}", Int) = 3
[HideInInspector] g_start_Matcap4TPSMaskGroup ("--{condition_showS:(_TPSPenetratorEnabled==1)}", Float) = 0
[ThryToggleUI(true)] _Matcap4TPSDepthEnabled (" TPS Depth Mask Enabled", Float) = 0
_Matcap4TPSMaskStrength ("TPS Mask Strength--{condition_showS:(_Matcap4TPSDepthEnabled==1)}", Range(0, 1)) = 1
@@ -5168,6 +5188,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap;
float4 _Matcap_ST;
+ float4 _Matcap_TexelSize;
float2 _MatcapPan;
float _MatcapUV;
#endif
@@ -5192,7 +5213,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
float _MatcapMaskGlobalMask;
float _MatcapMaskGlobalMaskBlendType;
float _MatcapBorder;
+ float _MatcapSmoothnessEnabled;
+ float _MatcapSmoothness;
+ float _MatcapMaskSmoothnessChannel;
+ float _MatcapMaskSmoothnessApply;
float4 _MatcapColor;
+ float _MatcapBaseColorMix;
float _MatcapColorThemeIndex;
float _MatcapIntensity;
float _MatcapReplace;
@@ -5217,6 +5243,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap2;
float4 _Matcap2_ST;
+ float4 _Matcap2_TexelSize;
float2 _Matcap2Pan;
float _Matcap2UV;
#endif
@@ -5241,7 +5268,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
float _Matcap2MaskGlobalMask;
float _Matcap2MaskGlobalMaskBlendType;
float _Matcap2Border;
+ float _Matcap2SmoothnessEnabled;
+ float _Matcap2Smoothness;
+ float _Matcap2MaskSmoothnessChannel;
+ float _Matcap2MaskSmoothnessApply;
float4 _Matcap2Color;
+ float _Matcap2BaseColorMix;
float _Matcap2ColorThemeIndex;
float _Matcap2Intensity;
float _Matcap2Replace;
@@ -5267,6 +5299,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap3;
float4 _Matcap3_ST;
+ float4 _Matcap3_TexelSize;
float2 _Matcap3Pan;
float _Matcap3UV;
#endif
@@ -5291,7 +5324,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
float _Matcap3MaskGlobalMask;
float _Matcap3MaskGlobalMaskBlendType;
float _Matcap3Border;
+ float _Matcap3SmoothnessEnabled;
+ float _Matcap3Smoothness;
+ float _Matcap3MaskSmoothnessChannel;
+ float _Matcap3MaskSmoothnessApply;
float4 _Matcap3Color;
+ float _Matcap3BaseColorMix;
float _Matcap3ColorThemeIndex;
float _Matcap3Intensity;
float _Matcap3Replace;
@@ -5317,6 +5355,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap4;
float4 _Matcap4_ST;
+ float4 _Matcap4_TexelSize;
float2 _Matcap4Pan;
float _Matcap4UV;
#endif
@@ -5341,7 +5380,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
float _Matcap4MaskGlobalMask;
float _Matcap4MaskGlobalMaskBlendType;
float _Matcap4Border;
+ float _Matcap4SmoothnessEnabled;
+ float _Matcap4Smoothness;
+ float _Matcap4MaskSmoothnessChannel;
+ float _Matcap4MaskSmoothnessApply;
float4 _Matcap4Color;
+ float _Matcap4BaseColorMix;
float _Matcap4ColorThemeIndex;
float _Matcap4Intensity;
float _Matcap4Replace;
@@ -11804,7 +11848,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
}
if (globalMaskIndex > 0)
{
- matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex-1], globalMaskBlendType);
+ matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex - 1], globalMaskBlendType);
}
poiFragData.baseColor.rgb = lerp(poiFragData.baseColor.rgb, matcapColor.rgb, replace * matcapMask * matcapColor.a * .999999);
@@ -11875,13 +11919,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcapSmoothness;
+ float mipCount0 = 9;
+ if (_MatcapSmoothnessEnabled)
+ {
+ if (_Matcap_TexelSize.z == 8192) mipCount0 = 13;
+ if (_Matcap_TexelSize.z == 4096) mipCount0 = 12;
+ if (_Matcap_TexelSize.z == 2048) mipCount0 = 11;
+ if (_Matcap_TexelSize.z == 1024) mipCount0 = 10;
+ if (_Matcap_TexelSize.z == 512) mipCount0 = 9;
+ if (_Matcap_TexelSize.z == 256) mipCount0 = 8;
+ if (_Matcap_TexelSize.z == 128) mipCount0 = 7;
+ if (_Matcap_TexelSize.z == 64) mipCount0 = 6;
+ if (_Matcap_TexelSize.z == 32) mipCount0 = 5;
+
+ matcapSmoothness = _MatcapSmoothness;
+
+ if (_MatcapMaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
+ matcapSmoothness *= POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskSmoothnessChannel];
+ #endif
+ }
+ matcapSmoothness = (1 - matcapSmoothness) * mipCount0;
+ }
+
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
- matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ if (_MatcapSmoothnessEnabled)
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap), matcapSmoothness) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
+ else
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
#else
matcap = float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
#endif
matcap.rgb *= _MatcapIntensity;
+ matcap.rgb = lerp(matcap.rgb, matcap.rgb * poiFragData.baseColor.rgb, _MatcapBaseColorMix);
+
#if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
matcapMask = POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskChannel];
#else
@@ -11959,12 +12037,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap2Smoothness;
+ float mipCount2 = 9;
+ if (_Matcap2SmoothnessEnabled)
+ {
+ if (_Matcap2_TexelSize.z == 8192) mipCount2 = 13;
+ if (_Matcap2_TexelSize.z == 4096) mipCount2 = 12;
+ if (_Matcap2_TexelSize.z == 2048) mipCount2 = 11;
+ if (_Matcap2_TexelSize.z == 1024) mipCount2 = 10;
+ if (_Matcap2_TexelSize.z == 512) mipCount2 = 9;
+ if (_Matcap2_TexelSize.z == 256) mipCount2 = 8;
+ if (_Matcap2_TexelSize.z == 128) mipCount2 = 7;
+ if (_Matcap2_TexelSize.z == 64) mipCount2 = 6;
+ if (_Matcap2_TexelSize.z == 32) mipCount2 = 5;
+
+ matcap2Smoothness = _Matcap2Smoothness;
+
+ if (_Matcap2MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap2Smoothness *= POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskSmoothnessChannel];
+ #endif
+ }
+ matcap2Smoothness = (1 - matcap2Smoothness) * mipCount2;
+ }
+
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
- matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ if (_Matcap2SmoothnessEnabled)
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2), matcap2Smoothness) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
+ else
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
#else
matcap2 = float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
#endif
+
matcap2.rgb *= _Matcap2Intensity;
+ matcap2.rgb = lerp(matcap2.rgb, matcap2.rgb * poiFragData.baseColor.rgb, _Matcap2BaseColorMix);
+
#if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
matcap2Mask = POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskChannel];
#else
@@ -12041,12 +12154,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap3Smoothness;
+ float mipCount3 = 9;
+ if (_Matcap3SmoothnessEnabled)
+ {
+ if (_Matcap3_TexelSize.z == 8192) mipCount3 = 13;
+ if (_Matcap3_TexelSize.z == 4096) mipCount3 = 12;
+ if (_Matcap3_TexelSize.z == 2048) mipCount3 = 11;
+ if (_Matcap3_TexelSize.z == 1024) mipCount3 = 10;
+ if (_Matcap3_TexelSize.z == 512) mipCount3 = 9;
+ if (_Matcap3_TexelSize.z == 256) mipCount3 = 8;
+ if (_Matcap3_TexelSize.z == 128) mipCount3 = 7;
+ if (_Matcap3_TexelSize.z == 64) mipCount3 = 6;
+ if (_Matcap3_TexelSize.z == 32) mipCount3 = 5;
+
+ matcap3Smoothness = _Matcap3Smoothness;
+
+ if (_Matcap3MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap3Smoothness *= POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskSmoothnessChannel];
+ #endif
+ }
+ matcap3Smoothness = (1 - matcap3Smoothness) * mipCount3;
+ }
+
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
- matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ if (_Matcap3SmoothnessEnabled)
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3), matcap3Smoothness) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
+ else
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
#else
matcap3 = float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
#endif
+
matcap3.rgb *= _Matcap3Intensity;
+ matcap3.rgb = lerp(matcap3.rgb, matcap3.rgb * poiFragData.baseColor.rgb, _Matcap3BaseColorMix);
+
#if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
matcap3Mask = POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskChannel];
#else
@@ -12123,12 +12271,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap4Smoothness;
+ float mipCount4 = 9;
+ if (_Matcap4SmoothnessEnabled)
+ {
+ if (_Matcap4_TexelSize.z == 8192) mipCount4 = 13;
+ if (_Matcap4_TexelSize.z == 4096) mipCount4 = 12;
+ if (_Matcap4_TexelSize.z == 2048) mipCount4 = 11;
+ if (_Matcap4_TexelSize.z == 1024) mipCount4 = 10;
+ if (_Matcap4_TexelSize.z == 512) mipCount4 = 9;
+ if (_Matcap4_TexelSize.z == 256) mipCount4 = 8;
+ if (_Matcap4_TexelSize.z == 128) mipCount4 = 7;
+ if (_Matcap4_TexelSize.z == 64) mipCount4 = 6;
+ if (_Matcap4_TexelSize.z == 32) mipCount4 = 5;
+
+ matcap4Smoothness = _Matcap4Smoothness;
+
+ if (_Matcap4MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap4Smoothness *= POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskSmoothnessChannel];
+ #endif
+ }
+ matcap4Smoothness = (1 - matcap4Smoothness) * mipCount4;
+ }
+
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
- matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ if (_Matcap4SmoothnessEnabled)
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4), matcap4Smoothness) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
+ else
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
#else
matcap4 = float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
#endif
+
matcap4.rgb *= _Matcap4Intensity;
+ matcap4.rgb = lerp(matcap4.rgb, matcap4.rgb * poiFragData.baseColor.rgb, _Matcap4BaseColorMix);
+
#if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
matcap4Mask = POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskChannel];
#else
@@ -12158,6 +12341,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
#endif
//endex
//ifex _MatcapEnable==0 && _Matcap2Enable==0 && _Matcap3Enable==0 && _Matcap4Enable==0
+
}
#endif
//endex
@@ -18069,6 +18253,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap;
float4 _Matcap_ST;
+ float4 _Matcap_TexelSize;
float2 _MatcapPan;
float _MatcapUV;
#endif
@@ -18093,7 +18278,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
float _MatcapMaskGlobalMask;
float _MatcapMaskGlobalMaskBlendType;
float _MatcapBorder;
+ float _MatcapSmoothnessEnabled;
+ float _MatcapSmoothness;
+ float _MatcapMaskSmoothnessChannel;
+ float _MatcapMaskSmoothnessApply;
float4 _MatcapColor;
+ float _MatcapBaseColorMix;
float _MatcapColorThemeIndex;
float _MatcapIntensity;
float _MatcapReplace;
@@ -18118,6 +18308,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap2;
float4 _Matcap2_ST;
+ float4 _Matcap2_TexelSize;
float2 _Matcap2Pan;
float _Matcap2UV;
#endif
@@ -18142,7 +18333,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
float _Matcap2MaskGlobalMask;
float _Matcap2MaskGlobalMaskBlendType;
float _Matcap2Border;
+ float _Matcap2SmoothnessEnabled;
+ float _Matcap2Smoothness;
+ float _Matcap2MaskSmoothnessChannel;
+ float _Matcap2MaskSmoothnessApply;
float4 _Matcap2Color;
+ float _Matcap2BaseColorMix;
float _Matcap2ColorThemeIndex;
float _Matcap2Intensity;
float _Matcap2Replace;
@@ -18168,6 +18364,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap3;
float4 _Matcap3_ST;
+ float4 _Matcap3_TexelSize;
float2 _Matcap3Pan;
float _Matcap3UV;
#endif
@@ -18192,7 +18389,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
float _Matcap3MaskGlobalMask;
float _Matcap3MaskGlobalMaskBlendType;
float _Matcap3Border;
+ float _Matcap3SmoothnessEnabled;
+ float _Matcap3Smoothness;
+ float _Matcap3MaskSmoothnessChannel;
+ float _Matcap3MaskSmoothnessApply;
float4 _Matcap3Color;
+ float _Matcap3BaseColorMix;
float _Matcap3ColorThemeIndex;
float _Matcap3Intensity;
float _Matcap3Replace;
@@ -18218,6 +18420,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
Texture2D _Matcap4;
float4 _Matcap4_ST;
+ float4 _Matcap4_TexelSize;
float2 _Matcap4Pan;
float _Matcap4UV;
#endif
@@ -18242,7 +18445,12 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
float _Matcap4MaskGlobalMask;
float _Matcap4MaskGlobalMaskBlendType;
float _Matcap4Border;
+ float _Matcap4SmoothnessEnabled;
+ float _Matcap4Smoothness;
+ float _Matcap4MaskSmoothnessChannel;
+ float _Matcap4MaskSmoothnessApply;
float4 _Matcap4Color;
+ float _Matcap4BaseColorMix;
float _Matcap4ColorThemeIndex;
float _Matcap4Intensity;
float _Matcap4Replace;
@@ -24396,7 +24604,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
}
if (globalMaskIndex > 0)
{
- matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex-1], globalMaskBlendType);
+ matcapMask = customBlend(matcapMask, poiMods.globalMask[globalMaskIndex - 1], globalMaskBlendType);
}
poiFragData.baseColor.rgb = lerp(poiFragData.baseColor.rgb, matcapColor.rgb, replace * matcapMask * matcapColor.a * .999999);
@@ -24467,13 +24675,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcapSmoothness;
+ float mipCount0 = 9;
+ if (_MatcapSmoothnessEnabled)
+ {
+ if (_Matcap_TexelSize.z == 8192) mipCount0 = 13;
+ if (_Matcap_TexelSize.z == 4096) mipCount0 = 12;
+ if (_Matcap_TexelSize.z == 2048) mipCount0 = 11;
+ if (_Matcap_TexelSize.z == 1024) mipCount0 = 10;
+ if (_Matcap_TexelSize.z == 512) mipCount0 = 9;
+ if (_Matcap_TexelSize.z == 256) mipCount0 = 8;
+ if (_Matcap_TexelSize.z == 128) mipCount0 = 7;
+ if (_Matcap_TexelSize.z == 64) mipCount0 = 6;
+ if (_Matcap_TexelSize.z == 32) mipCount0 = 5;
+
+ matcapSmoothness = _MatcapSmoothness;
+
+ if (_MatcapMaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
+ matcapSmoothness *= POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskSmoothnessChannel];
+ #endif
+ }
+ matcapSmoothness = (1 - matcapSmoothness) * mipCount0;
+ }
+
#if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED)
- matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ if (_MatcapSmoothnessEnabled)
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap), matcapSmoothness) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
+ else
+ {
+ matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap)) * float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
+ }
#else
matcap = float4(poiThemeColor(poiMods, _MatcapColor.rgb, _MatcapColorThemeIndex), _MatcapColor.a);
#endif
matcap.rgb *= _MatcapIntensity;
+ matcap.rgb = lerp(matcap.rgb, matcap.rgb * poiFragData.baseColor.rgb, _MatcapBaseColorMix);
+
#if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED)
matcapMask = POI2D_SAMPLER_PAN(_MatcapMask, _MainTex, poiUV(poiMesh.uv[_MatcapMaskUV], _MatcapMask_ST), _MatcapMaskPan)[_MatcapMaskChannel];
#else
@@ -24551,12 +24793,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap2Smoothness;
+ float mipCount2 = 9;
+ if (_Matcap2SmoothnessEnabled)
+ {
+ if (_Matcap2_TexelSize.z == 8192) mipCount2 = 13;
+ if (_Matcap2_TexelSize.z == 4096) mipCount2 = 12;
+ if (_Matcap2_TexelSize.z == 2048) mipCount2 = 11;
+ if (_Matcap2_TexelSize.z == 1024) mipCount2 = 10;
+ if (_Matcap2_TexelSize.z == 512) mipCount2 = 9;
+ if (_Matcap2_TexelSize.z == 256) mipCount2 = 8;
+ if (_Matcap2_TexelSize.z == 128) mipCount2 = 7;
+ if (_Matcap2_TexelSize.z == 64) mipCount2 = 6;
+ if (_Matcap2_TexelSize.z == 32) mipCount2 = 5;
+
+ matcap2Smoothness = _Matcap2Smoothness;
+
+ if (_Matcap2MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap2Smoothness *= POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskSmoothnessChannel];
+ #endif
+ }
+ matcap2Smoothness = (1 - matcap2Smoothness) * mipCount2;
+ }
+
#if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED)
- matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ if (_Matcap2SmoothnessEnabled)
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2), matcap2Smoothness) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
+ else
+ {
+ matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap2)) * float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
+ }
#else
matcap2 = float4(poiThemeColor(poiMods, _Matcap2Color.rgb, _Matcap2ColorThemeIndex), _Matcap2Color.a);
#endif
+
matcap2.rgb *= _Matcap2Intensity;
+ matcap2.rgb = lerp(matcap2.rgb, matcap2.rgb * poiFragData.baseColor.rgb, _Matcap2BaseColorMix);
+
#if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED)
matcap2Mask = POI2D_SAMPLER_PAN(_Matcap2Mask, _MainTex, poiUV(poiMesh.uv[_Matcap2MaskUV], _Matcap2Mask_ST), _Matcap2MaskPan)[_Matcap2MaskChannel];
#else
@@ -24633,12 +24910,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap3Smoothness;
+ float mipCount3 = 9;
+ if (_Matcap3SmoothnessEnabled)
+ {
+ if (_Matcap3_TexelSize.z == 8192) mipCount3 = 13;
+ if (_Matcap3_TexelSize.z == 4096) mipCount3 = 12;
+ if (_Matcap3_TexelSize.z == 2048) mipCount3 = 11;
+ if (_Matcap3_TexelSize.z == 1024) mipCount3 = 10;
+ if (_Matcap3_TexelSize.z == 512) mipCount3 = 9;
+ if (_Matcap3_TexelSize.z == 256) mipCount3 = 8;
+ if (_Matcap3_TexelSize.z == 128) mipCount3 = 7;
+ if (_Matcap3_TexelSize.z == 64) mipCount3 = 6;
+ if (_Matcap3_TexelSize.z == 32) mipCount3 = 5;
+
+ matcap3Smoothness = _Matcap3Smoothness;
+
+ if (_Matcap3MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap3Smoothness *= POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskSmoothnessChannel];
+ #endif
+ }
+ matcap3Smoothness = (1 - matcap3Smoothness) * mipCount3;
+ }
+
#if defined(PROP_MATCAP3) || !defined(OPTIMIZER_ENABLED)
- matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ if (_Matcap3SmoothnessEnabled)
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3), matcap3Smoothness) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
+ else
+ {
+ matcap3 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap3, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap3)) * float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
+ }
#else
matcap3 = float4(poiThemeColor(poiMods, _Matcap3Color.rgb, _Matcap3ColorThemeIndex), _Matcap3Color.a);
#endif
+
matcap3.rgb *= _Matcap3Intensity;
+ matcap3.rgb = lerp(matcap3.rgb, matcap3.rgb * poiFragData.baseColor.rgb, _Matcap3BaseColorMix);
+
#if defined(PROP_MATCAP3MASK) || !defined(OPTIMIZER_ENABLED)
matcap3Mask = POI2D_SAMPLER_PAN(_Matcap3Mask, _MainTex, poiUV(poiMesh.uv[_Matcap3MaskUV], _Matcap3Mask_ST), _Matcap3MaskPan)[_Matcap3MaskChannel];
#else
@@ -24715,12 +25027,47 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
matcapUV.x = 1 - matcapUV.x;
}
+ float matcap4Smoothness;
+ float mipCount4 = 9;
+ if (_Matcap4SmoothnessEnabled)
+ {
+ if (_Matcap4_TexelSize.z == 8192) mipCount4 = 13;
+ if (_Matcap4_TexelSize.z == 4096) mipCount4 = 12;
+ if (_Matcap4_TexelSize.z == 2048) mipCount4 = 11;
+ if (_Matcap4_TexelSize.z == 1024) mipCount4 = 10;
+ if (_Matcap4_TexelSize.z == 512) mipCount4 = 9;
+ if (_Matcap4_TexelSize.z == 256) mipCount4 = 8;
+ if (_Matcap4_TexelSize.z == 128) mipCount4 = 7;
+ if (_Matcap4_TexelSize.z == 64) mipCount4 = 6;
+ if (_Matcap4_TexelSize.z == 32) mipCount4 = 5;
+
+ matcap4Smoothness = _Matcap4Smoothness;
+
+ if (_Matcap4MaskSmoothnessApply)
+ {
+ #if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
+ matcap4Smoothness *= POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskSmoothnessChannel];
+ #endif
+ }
+ matcap4Smoothness = (1 - matcap4Smoothness) * mipCount4;
+ }
+
#if defined(PROP_MATCAP4) || !defined(OPTIMIZER_ENABLED)
- matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ if (_Matcap4SmoothnessEnabled)
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER_LOD(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4), matcap4Smoothness) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
+ else
+ {
+ matcap4 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap4, _MainTex, TRANSFORM_TEX(matcapUV, _Matcap4)) * float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
+ }
#else
matcap4 = float4(poiThemeColor(poiMods, _Matcap4Color.rgb, _Matcap4ColorThemeIndex), _Matcap4Color.a);
#endif
+
matcap4.rgb *= _Matcap4Intensity;
+ matcap4.rgb = lerp(matcap4.rgb, matcap4.rgb * poiFragData.baseColor.rgb, _Matcap4BaseColorMix);
+
#if defined(PROP_MATCAP4MASK) || !defined(OPTIMIZER_ENABLED)
matcap4Mask = POI2D_SAMPLER_PAN(_Matcap4Mask, _MainTex, poiUV(poiMesh.uv[_Matcap4MaskUV], _Matcap4Mask_ST), _Matcap4MaskPan)[_Matcap4MaskChannel];
#else
@@ -24750,6 +25097,7 @@ Shader ".poiyomi/Poiyomi 8.1/Poiyomi Toon"
#endif
//endex
//ifex _MatcapEnable==0 && _Matcap2Enable==0 && _Matcap3Enable==0 && _Matcap4Enable==0
+
}
#endif
//endex