### Unity Shader Configuration: Rendering Mode Setup Source: https://context7.com/poiyomi/poiyomitoonshader/llms.txt Example of how to configure rendering modes for a material using a Unity shader script. It demonstrates setting the rendering mode (e.g., Cutout) and associated properties like alpha cutoff and Z-write. ```csharp // Material Properties for Rendering Mode // Access via: Inspector > Rendering Preset dropdown // Available Rendering Presets: // - Opaque (0): Solid materials, no transparency // - Cutout (1): Binary transparency using alpha cutoff // - TransClipping (9): Transparent with cutout behavior // - Fade (2): Smooth transparency with ZWrite off // - Transparent (3): Premultiplied alpha blending // - Additive (4): Add color to background (glow effects) // - Soft Additive (5): Softer additive blending // - Multiplicative (6): Multiply with background // - 2x Multiplicative (7): Double multiply blending // Example: Setting up cutout material in script Material mat = new Material(Shader.Find(".poiyomi/Poiyomi Toon")); mat.SetInt("_Mode", 1); // Cutout mode mat.SetFloat("_Cutoff", 0.5f); // Alpha threshold mat.SetInt("_ZWrite", 1); mat.SetInt("_ZTest", 4); // LessEqual ``` -------------------------------- ### Poiyomi Toon Shader Installation Instructions Source: https://context7.com/poiyomi/poiyomitoonshader/llms.txt Instructions for installing the Poiyomi Toon Shader package into a Unity project. It recommends using VPM for VRChat Creator Companion or manual download from releases. ```text // VPM Installation (Recommended for VRChat Creator Companion) // Add the repository to VCC: https://poiyomi.github.io/vpm/ // Manual Installation // Download the latest Unity Package from: // https://github.com/poiyomi/PoiyomiToonShader/releases/latest ``` -------------------------------- ### Texture with AltClick Action Property Option Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Example of using the 'altClick' property option to define an action that is triggered when the user holds 'Alt' and clicks on the texture property. This example opens a URL. ```ShaderLab _Tex("Texture--{altClick:{type:URL,data:http://thryrallo.de}}",2D) = "white" { } ``` -------------------------------- ### Shader Property Configuration Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Demonstrates how to configure shader properties with various options like hiding in inspector, referencing other properties, and setting default values. These examples use a custom shader syntax. ```ShaderLab _Toogle ("Gradient Lighting--{texture:{hide_in_inspector:true}}", Int) = 0 ``` ```ShaderLab _Texture("Panning Texture --{reference_properties:[_PanSpeed,_PanUV]}", 2D) = "white" { } ``` ```ShaderLab _Texture("Animated Texture --{reference_property:_FrameCount}", 2DArray) = { } ``` ```ShaderLab m_vertex("Vertex Options--{button_right:{text:Tutorial,action:{type:URL,data:https://www.youtube.com/watch?v=FO-bxI5znI0},hover:YouTube},is_hideable:true}", Float) = 0 ``` ```ShaderLab m_vertex("Vertex Options--{button_right:{text:Tutorial,action:{type:URL,data:https://www.youtube.com/watch?v=FO-bxI5znI0},hover:YouTube},is_hideable:true,is_hidden_default:true}", Float) = 0 ``` -------------------------------- ### Define Shader UI Metadata Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Examples of defining UI labels, locale files, and shader swap actions using hidden inspector properties. ```Unity Shader [HideInInspector] shader_master_label (" Poiyomi Toon Shader V4.0 ", Float) = 0 [HideInInspector] shader_properties_label_file ("poiToonLabels", Float) = 0 [HideInInspector] shader_properties_locale ("locale::locale--{file_name:locale_file_name}", Float) = 0 [HideInInspector] shader_on_swap_to ("--{actions:[{type:SET_PROPERTY,data:_ZWrite=1},{type:SET_PROPERTY,data:_CullBack=0}]}", Float) = 0 ``` -------------------------------- ### Gradient with Texture Settings Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Example of configuring texture settings like width, height, filter mode, and wrap mode for a Gradient drawer. It also demonstrates forcing these texture options. ```ShaderLab [Gradient]_ColorRamp ("Gradient --{texture:{width:256,height:16,filterMode:Point,wrapMode:Clamp}}", 2D) = "white" { } ``` ```ShaderLab [Gradient]_ColorRamp ("Gradient --{texture:{width:256,height:16,filterMode:Point,wrapMode:Clamp},force_texture_options:true}", 2D) = "white" { } ``` -------------------------------- ### Texture with Condition Show Property Option Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Example of using the 'condition_show' property option to control the visibility of a texture property based on a condition. This example shows the texture only if '_ForceOpaque' is equal to 1. ```ShaderLab _Tex("Texture--{condition_show:{type:PROPERTY_BOOL,data:_ForceOpaque==1}}",2D) = "white" { } ``` -------------------------------- ### Curve with Texture Channel Settings Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Example of configuring texture settings for a Curve drawer, specifically setting the width, height, and the channel (e.g., 'b' for blue) to be used from the texture. ```ShaderLab [Curve]_MainTex ("Texture --{image:{width:256,height:16,channel:b}}", 2D) = "white" { } ``` -------------------------------- ### Texture with Condition Enable Property Option Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Example of using the 'condition_enable' property option to control the enabled state of a texture property based on a condition. This example enables the texture only if '_ForceOpaque' is equal to 1. ```ShaderLab _Tex("Texture--{condition_enable:{type:PROPERTY_BOOL,data:_ForceOpaque==1}}",2D) = "white" { } ``` -------------------------------- ### Texture with Tooltip Property Option Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Example of using the 'tooltip' property option to display custom text when hovering over a texture field, providing additional context or instructions. ```ShaderLab _Tex("Texture--{tooltip:use this texture for albedo}",2D) = "white" { } ``` -------------------------------- ### Stencil Configuration for Rendering Control (HLSL) Source: https://context7.com/poiyomi/poiyomitoonshader/llms.txt Configures stencil buffer operations to control rendering order and create effects like see-through materials. It allows setting reference values, masks, operations (Pass, Fail, ZFail), and comparison functions. Common setups for writing and reading stencil values are provided. ```hlsl // Stencil Configuration _StencilRef ("Reference Value", Int) = 0 // 0-255 _StencilReadMask ("Read Mask", Int) = 255 _StencilWriteMask ("Write Mask", Int) = 255 // Stencil Operations _StencilPassOp ("Pass Op", Int) = 0 _StencilFailOp ("Fail Op", Int) = 0 _StencilZFailOp ("ZFail Op", Int) = 0 // Operations: 0=Keep, 1=Zero, 2=Replace, 3=IncrSat, 4=DecrSat, 5=Invert, 6=Incr, 7=Decr // Stencil Comparison _StencilCompareFunction ("Compare Function", Int) = 8 // 0=Disabled, 1=Never, 2=Less, 3=Equal, 4=LessEqual, 5=Greater, 6=NotEqual, 7=GreaterEqual, 8=Always // Common Stencil Setups: // 1. Invisible writing material (creates holes): // Ref=1, Pass=Replace, Compare=Always, ColorMask=0 // 2. Only show where written: // Ref=1, Compare=Equal // 3. Show everywhere except written: // Ref=1, Compare=NotEqual ``` -------------------------------- ### Define Shader Section Header with Tutorial Link Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Shaders/PoiLabels.txt This snippet shows how to define a section header in the shader inspector that includes a clickable tutorial link pointing to YouTube. ```text m_start_lightingAdvanced:=Additive Lighting (Point & Spot Light)--{button_right:{text:Tutorial,action:{type:URL,data:https://www.youtube.com/watch?v=at3p5yRRVU0},hover:YouTube}} m_start_matcap:=Matcap--{reference_property:_MatcapEnable,button_right:{text:Tutorial,action:{type:URL,data:https://youtu.be/DFo87kuO1OI},hover:YouTube},is_hideable:true,is_visible_simple:true} ``` -------------------------------- ### Define Shader UI Properties and Tutorial Links Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Shaders/PoiLabels.txt This snippet demonstrates how to define shader properties in the Poiyomi Toon Shader configuration. It includes mapping internal variables to display names, linking YouTube tutorials, and setting visibility flags for the inspector. ```PoiyomiConfig // Main m_mainOptions:=Main--{button_right:{text:Tutorial,action:{type:URL,data:https://www.youtube.com/watch?v=5yxREJE8DPA&list=PL4_Gy3VRJSmbXfQSldzUiChgABQsoBlLw},hover:YouTube},is_visible_simple:true} _MainTex:=Main Texture--{reference_properties:[_MainTexPan, _MainTextureUV]} // RGB Mask m_start_RGBMask:=RGB Mask--{button_right:{text:Tutorial,action:{type:URL,data:https://www.youtube.com/watch?v=VVJ9Ac1_fXk&list=PL4_Gy3VRJSmbXfQSldzUiChgABQsoBlLw},hover:YouTube},reference_property:_RGBMaskEnabled,is_hideable:true} _RGBMask:=RGB Mask--{reference_properties:[_RGBMaskPanning, _RGBMaskUV]} ``` -------------------------------- ### Define Shader UI Property Configuration Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Shaders/PoiLabels.txt This snippet demonstrates the custom configuration syntax used to define shader properties in the Poiyomi Toon Shader. It includes metadata for UI visibility, tutorial links, and property references. ```text _EnableRimLighting:=Rim Lighting--{hide_in_inspector:true} _RimTex:=Rim Texture--{reference_properties:[_RimTexPan, _RimTexUV]} _EnableMetallic:=Metallics--{hide_in_inspector:true} _EnableEmission:=Emission--{hide_in_inspector:true} ``` -------------------------------- ### Texture with Offset Property Option Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Example of using the 'offset' property option within a texture field to add an extra X-offset to the texture's UV coordinates. ```ShaderLab _Tex("Texture--{offset:1}",2D) = "white" { } ``` -------------------------------- ### POST /Thry.ThryEditor.PropertyOptions/Reference Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/Editor/Tests/ParserTests.txt Defines a list of reference properties for the shader editor. ```APIDOC ## POST /Thry.ThryEditor.PropertyOptions/Reference ### Description Defines the set of properties that the editor should track or reference for specific shader features like lighting shadow masks. ### Method POST ### Endpoint /Thry.ThryEditor.PropertyOptions ### Request Body - **reference_properties** (array) - Required - A list of shader property names to be referenced by the editor. ### Request Example { "reference_properties": ["_LightingShadowMasksPan", "_LightingShadowMasksUV", "_LightingShadowMaskStrengthR"] } ``` -------------------------------- ### AudioLink Integration for Music Reactivity (HLSL) Source: https://context7.com/poiyomi/poiyomitoonshader/llms.txt Integrates VRChat's AudioLink system to make materials react to music. It includes settings for enabling AudioLink, defining theme colors, controlling emission and decal properties based on audio bands, and enabling hue shifts. Audio bands range from Bass (0) to Treble (3) and Volume (4). ```hlsl // Enable AudioLink _EnableAudioLink ("Enable AudioLink", Float) = 0 // Audio Bands available: // 0 = Bass, 1 = Low Mid, 2 = High Mid, 3 = Treble, 4 = Volume // Theme Colors (respond to AudioLink theme) _AudioLinkThemeColor0 ("Theme Color 0", Color) = (1, 0, 0, 1) _AudioLinkThemeColor1 ("Theme Color 1", Color) = (0, 1, 0, 1) _AudioLinkThemeColor2 ("Theme Color 2", Color) = (0, 0, 1, 1) _AudioLinkThemeColor3 ("Theme Color 3", Color) = (1, 1, 0, 1) // Emission AudioLink (Example: Emission 0) _EnableEmissionAudioLink ("Enable AL Emission", Float) = 0 _AudioLinkEmissionAddBand ("Band", Int) = 0 // Which frequency band _AudioLinkEmissionAdd ("Add Range", Vector) = (0, 1, 0, 0) // Min/Max emission add // Decal AudioLink (Example: Decal 0) _AudioLinkDecal0ScaleBand ("Scale Band", Int) = 0 _AudioLinkDecal0Scale ("Scale Mod", Vector) = (0, 0, 0.1, 0.1) // Xmin, Ymin, Xmax, Ymax _AudioLinkDecal0AlphaBand ("Alpha Band", Int) = 0 _AudioLinkDecal0Alpha ("Alpha Mod", Vector) = (0, 1, 0, 0) // Min/Max alpha // Chrono Time (continuous animation with audio) // Use "Chrono Motion Type" settings for smooth audio-reactive animation // Types: 0-1 = Intensity-based, 2-3 = Back-and-forth, 4-7 = Speed variations // Hue Shift AudioLink _MainHueALCTEnabled ("Enable AL Hue Shift", Float) = 0 _MainALHueShiftBand ("Band", Int) = 0 _MainHueALMotionSpeed ("Motion Speed", Float) = 1 ``` -------------------------------- ### Texture with Button Right Property Option Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Example of using the 'button_right' property option to add a button to the right side of a dropdown header. This button can trigger various actions, such as opening a URL. ```ShaderLab _Tex("Texture--{button_right:{text:Test Button,action:{type:URL,data:https://github.com/Thryrallo/thryeditor},hover:hover text,condition_show:{type:PROPERTY_BOOL,data:_ShowButtonOnMenus}}}",2D) = "white" { } ``` -------------------------------- ### Helpbox Drawer Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Implements a 'Helpbox' drawer to display informational text boxes within the shader inspector, useful for providing guidance or notes to users. ```ShaderLab [Helpbox]_MainHelpbox("This is the text inside the info box",Float)= 0 ``` -------------------------------- ### Configure UI Menus and Groups Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Organizes shader properties into dropdown menus or logical groups for cleaner UI presentation. ```Unity Shader [HideInInspector] m_mainOptions ("Main", Float) = 0 [HideInInspector] m_start_Alpha ("Alpha Options", Float) = 0 [HideInInspector] m_end_Alpha ("", Float) = 0 [HideInInspector] g_start_blending ("--{condition_show:{type:PROPERTY_BOOL,data:_DisplayBlending}}", Float) = 0 [HideInInspector] g_end_blending ("", Float) = 0 ``` -------------------------------- ### Configure Texture Import Settings Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Shaders/PoiLabels.txt This snippet shows how to enforce specific texture import settings like width, height, filter mode, and wrap mode for shader ramps. ```PoiyomiConfig _ToonRamp1:=Lighting Ramp 2--{texture:{width:512,height:4,filterMode:Bilinear,wrapMode:Clamp},force_texture_options:true} _ToonRamp2:=Lighting Ramp 3--{texture:{width:512,height:4,filterMode:Bilinear,wrapMode:Clamp},force_texture_options:true} ``` -------------------------------- ### POST /Thry.ThryEditor.PropertyOptions/Actions Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/Editor/Tests/ParserTests.txt Configures state-based actions that update render settings when a specific property value is set. ```APIDOC ## POST /Thry.ThryEditor.PropertyOptions/Actions ### Description Defines a mapping of property values to a series of actions that modify shader render states, such as render queue, blend modes, and Z-testing. ### Method POST ### Endpoint /Thry.ThryEditor.PropertyOptions ### Request Body - **on_value_actions** (array) - Required - A list of objects containing a 'value' and an array of 'actions' to execute. ### Request Example { "on_value_actions": [ { "value": 0, "actions": [ { "type": "SET_PROPERTY", "data": "render_queue=2000" }, { "type": "SET_PROPERTY", "data": "render_type=Opaque" } ] } ] } ``` -------------------------------- ### Shader Property Metadata Configuration Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Defines how to configure shader properties with metadata for UI behavior, visibility, and reference properties. ```APIDOC ## Shader Property Configuration ### Description Configures UI behavior for shader properties using metadata strings within the property definition. ### Parameters #### Metadata Fields - **hide_in_inspector** (bool) - Optional - Hides property in ThryEditor. - **reference_properties** (string[]) - Optional - Properties to display in texture foldout menus. - **reference_property** (string) - Optional - Links a property for toggles, texture array depths, or side-by-side drawing. - **is_hideable** (bool) - Optional - Enables the eye icon for toggling visibility. - **is_hidden_default** (bool) - Optional - Sets initial visibility state if hideable. ### Request Example _Toogle ("Gradient Lighting--{texture:{hide_in_inspector:true}}", Int) = 0 _Texture("Panning Texture --{reference_properties:[_PanSpeed,_PanUV]}", 2D) = "white" { } ### Response - **Success** (200) - Property metadata successfully parsed and applied to the inspector UI. ``` -------------------------------- ### Configure Shading and Lighting Models in HLSL Source: https://context7.com/poiyomi/poiyomitoonshader/llms.txt This HLSL code configures various shading and lighting models for materials. It allows selection between different shading types like Realistic, Toon, Wrapped, Skin, Shade Maps, Flat, PBR, Cloth, and SDF. Parameters include shadow strength, gradient settings, brightness limits, monochromatic lighting, shadow tint, ambient occlusion, and light data modes. ```hlsl // Shading Type Selection _LightingMode ("Light Mode", Int) = 1 // 0 = Realistic (PBR-like response) // 1 = Toon/Multilayer Math (recommended for VRChat) // 2 = Wrapped // 3 = Skin Shading // 4 = Shade Maps (anime-style) // 5 = Flat // 6 = Realistic PBR // 7 = Cloth // 8 = SDF (Signed Distance Field) // Multilayer Math Shading (Mode 1) - Most Common _ShadowStrength ("Shadow Strength", Range(0, 1)) = 1 _LightingGradientStart ("Gradient Start", Range(0, 1)) = 0 _LightingGradientEnd ("Gradient End", Range(0, 1)) = 0.5 _LightingMinLightBrightness ("Min Brightness", Range(0, 1)) = 0 // Never go fully dark _LightingMaxLightBrightness ("Max Brightness", Range(0, 5)) = 1 // Cap maximum brightness _LightingMonochromatic ("Monochromatic Lighting", Range(0, 1)) = 0 // Ignore light color // Shadow Color Customization _LightingShadowColor ("Shadow Tint", Color) = (0.7, 0.75, 0.85, 1) // Ambient Occlusion _AOMap ("AO Map", 2D) = "white" { } _AOStrength ("AO Strength", Range(0, 1)) = 1 // Light Data Configuration _LightingDirectionMode ("Direction Mode", Int) = 0 // 0=Normal, 1=Forced Local _LightDataDebug ("Show Debug", Float) = 0 // Visualize light data ``` -------------------------------- ### Poiyomi Toon Shader Variants Overview Source: https://context7.com/poiyomi/poiyomitoonshader/llms.txt Lists the different shader variants available for Poiyomi Toon Shader, categorized by their features and use cases. Includes standard, two-pass, early outline, grab pass, world, and fur shaders, along with utility shaders found in the Extras folder. ```Text // Standard Toon Shader .poiyomi/Poiyomi Toon - Full feature set - Single pass rendering // Two Pass Variant .poiyomi/Poiyomi Toon Two Pass - For transparent materials that need proper depth - Renders opaque pass first, then transparent // Early Outline Variant .poiyomi/Poiyomi Toon Early Outline - Outlines rendered before main pass - Better for certain outline effects // Grab Pass Variant (Pro only) .poiyomi/Poiyomi Toon Grab Pass - Enables refraction and blur effects - Requires grabpass (performance cost) // World Shader .poiyomi/Poiyomi Toon World - Optimized for world/environment objects - Reduced avatar-specific features // Fur Shader (Pro only) .poiyomi/Poiyomi Toon Lil Fur .poiyomi/Poiyomi Toon Lil Fur Two Pass - Shell-based fur rendering - Full toon shader features plus fur // Extra Utility Shaders (in Extras folder) .poiyomi/Extras/InvisStencil - Invisible stencil writer .poiyomi/Extras/MasterScanner - Debug visualization .poiyomi/Extras/PoiyomiFakeShadow - Fake shadow projection ``` -------------------------------- ### Small Texture Drawer Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Implements a 'SmallTexture' drawer to create a texture field that is consistently displayed at a small size in the UI. ```ShaderLab [SmallTexture]_MainTex("Main Texture",2D)= "white" { } ``` -------------------------------- ### Configure Rendering Properties in Thry Editor Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/Editor/Tests/ParserTests.txt This snippet demonstrates how to configure various rendering properties in the Thry Editor based on different value inputs. It includes settings for render queue, render type, blend operations, and Z-writing. These configurations are typically used to control how materials are rendered. ```json { "on_value_actions": [ { "value": 0, "actions": [ { "type": "SET_PROPERTY", "data": "render_queue=2000" }, { "type": "SET_PROPERTY", "data": "render_type=Opaque" }, { "type": "SET_PROPERTY", "data": "_BlendOp=0" }, { "type": "SET_PROPERTY", "data": "_BlendOpAlpha=0" }, { "type": "SET_PROPERTY", "data": "_Cutoff=0" }, { "type": "SET_PROPERTY", "data": "_SrcBlend=1" }, { "type": "SET_PROPERTY", "data": "_DstBlend=0" }, { "type": "SET_PROPERTY", "data": "_SrcBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_DstBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_AddSrcBlend=1" }, { "type": "SET_PROPERTY", "data": "_AddDstBlend=1" }, { "type": "SET_PROPERTY", "data": "_AddSrcBlendAlpha=0" }, { "type": "SET_PROPERTY", "data": "_AddDstBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_AlphaToCoverage=0" }, { "type": "SET_PROPERTY", "data": "_ZWrite=1" }, { "type": "SET_PROPERTY", "data": "_ZTest=4" }, { "type": "SET_PROPERTY", "data": "_AlphaPremultiply=0" }, { "type": "SET_PROPERTY", "data": "_OutlineSrcBlend=1" }, { "type": "SET_PROPERTY", "data": "_OutlineDstBlend=0" }, { "type": "SET_PROPERTY", "data": "_OutlineSrcBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_OutlineDstBlendAlpha=0" }, { "type": "SET_PROPERTY", "data": "_OutlineBlendOp=0" }, { "type": "SET_PROPERTY", "data": "_OutlineBlendOpAlpha=0" } ] }, { "value": 1, "actions": [ { "type": "SET_PROPERTY", "data": "render_queue=2450" }, { "type": "SET_PROPERTY", "data": "render_type=TransparentCutout" }, { "type": "SET_PROPERTY", "data": "_BlendOp=0" }, { "type": "SET_PROPERTY", "data": "_BlendOpAlpha=4" }, { "type": "SET_PROPERTY", "data": "_Cutoff=0.5" }, { "type": "SET_PROPERTY", "data": "_SrcBlend=1" }, { "type": "SET_PROPERTY", "data": "_DstBlend=0" }, { "type": "SET_PROPERTY", "data": "_SrcBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_DstBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_AddSrcBlend=1" }, { "type": "SET_PROPERTY", "data": "_AddDstBlend=1" }, { "type": "SET_PROPERTY", "data": "_AddSrcBlendAlpha=0" }, { "type": "SET_PROPERTY", "data": "_AddDstBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_AlphaToCoverage=0" }, { "type": "SET_PROPERTY", "data": "_ZWrite=1" }, { "type": "SET_PROPERTY", "data": "_ZTest=4" }, { "type": "SET_PROPERTY", "data": "_AlphaPremultiply=0" }, { "type": "SET_PROPERTY", "data": "_OutlineSrcBlend=1" }, { "type": "SET_PROPERTY", "data": "_OutlineDstBlend=0" }, { "type": "SET_PROPERTY", "data": "_OutlineSrcBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_OutlineDstBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_OutlineBlendOp=0" }, { "type": "SET_PROPERTY", "data": "_OutlineBlendOpAlpha=4" } ] }, { "value": 9, "actions": [ { "type": "SET_PROPERTY", "data": "render_queue=2450" }, { "type": "SET_PROPERTY", "data": "render_type=TransparentCutout" }, { "type": "SET_PROPERTY", "data": "_BlendOp=0" }, { "type": "SET_PROPERTY", "data": "_BlendOpAlpha=4" }, { "type": "SET_PROPERTY", "data": "_Cutoff=0" }, { "type": "SET_PROPERTY", "data": "_SrcBlend=5" }, { "type": "SET_PROPERTY", "data": "_DstBlend=10" }, { "type": "SET_PROPERTY", "data": "_SrcBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_DstBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_AddSrcBlend=5" }, { "type": "SET_PROPERTY", "data": "_AddDstBlend=1" }, { "type": "SET_PROPERTY", "data": "_AddSrcBlendAlpha=0" }, { "type": "SET_PROPERTY", "data": "_AddDstBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_AlphaToCoverage=0" }, { "type": "SET_PROPERTY", "data": "_ZWrite=1" }, { "type": "SET_PROPERTY", "data": "_ZTest=4" }, { "type": "SET_PROPERTY", "data": "_AlphaPremultiply=0" }, { "type": "SET_PROPERTY", "data": "_OutlineSrcBlend=5" }, { "type": "SET_PROPERTY", "data": "_OutlineDstBlend=10" }, { "type": "SET_PROPERTY", "data": "_OutlineSrcBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_OutlineDstBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_OutlineBlendOp=0" }, { "type": "SET_PROPERTY", "data": "_OutlineBlendOpAlpha=4" } ] }, { "value": 2, "actions": [ { "type": "SET_PROPERTY", "data": "render_queue=3000" }, { "type": "SET_PROPERTY", "data": "render_type=Transparent" }, { "type": "SET_PROPERTY", "data": "_BlendOp=0" }, { "type": "SET_PROPERTY", "data": "_BlendOpAlpha=4" }, { "type": "SET_PROPERTY", "data": "_Cutoff=0" }, { "type": "SET_PROPERTY", "data": "_SrcBlend=5" }, { "type": "SET_PROPERTY", "data": "_DstBlend=10" }, { "type": "SET_PROPERTY", "data": "_SrcBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_DstBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_AddSrcBlend=5" }, { "type": "SET_PROPERTY", "data": "_AddDstBlend=1" }, { "type": "SET_PROPERTY", "data": "_AddSrcBlendAlpha=0" }, { "type": "SET_PROPERTY", "data": "_AddDstBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_AlphaToCoverage=0" }, { "type": "SET_PROPERTY", "data": "_ZWrite=0" }, { "type": "SET_PROPERTY", "data": "_ZTest=4" }, { "type": "SET_PROPERTY", "data": "_AlphaPremultiply=0" }, { "type": "SET_PROPERTY", "data": "_OutlineSrcBlend=5" }, { "type": "SET_PROPERTY", "data": "_OutlineDstBlend=10" }, { "type": "SET_PROPERTY", "data": "_OutlineSrcBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_OutlineDstBlendAlpha=1" }, { "type": "SET_PROPERTY", "data": "_OutlineBlendOp=0" }, { "type": "SET_PROPERTY", "data": "_OutlineBlendOpAlpha=4" } ] } ] } ``` -------------------------------- ### Configure Emission System in HLSL Source: https://context7.com/poiyomi/poiyomitoonshader/llms.txt This HLSL code provides parameters for configuring up to 4 emission layers with various effects. It allows enabling emission, setting color and texture maps, controlling strength, and implementing effects like 'Center Out' (expanding emission), scrolling waves, blinking, and 'Glow in the Dark' (emission in low light). ```hlsl // Emission 0 Configuration (0-3 available) _EnableEmission ("Enable Emission", Float) = 0 _EmissionColor ("Emission Color", Color) = (1, 1, 1, 1) _EmissionMap ("Emission Map", 2D) = "white" { } // RGB = color, controls where emission occurs _EmissionMask ("Mask", 2D) = "white" { } // Grayscale mask for emission areas _EmissionStrength ("Emission Strength", Range(0, 20)) = 0 // 0 = no glow, >1 = bloom effect // Center Out Effect (expanding emission) _EmissionCenterOutEnabled ("Center Out Effect", Float) = 0 _EmissionCenterOutSpeed ("Flow Speed", Float) = 5 // Scrolling Emission (wave effect) _EmissionScrollingEnabled ("Enable Scrolling", Float) = 0 _EmissiveScroll_Direction ("Scroll Direction", Vector) = (0, -10, 0, 0) // Direction vector _EmissiveScroll_Width ("Wave Width", Float) = 10 _EmissiveScroll_Velocity ("Wave Velocity", Float) = 10 _EmissiveScroll_Interval ("Wave Interval", Float) = 20 _EmissionScrollingCurve ("Wave Curve", 2D) = "white" { } // Blinking Effect _EmissionBlinkingEnabled ("Enable Blinking", Float) = 0 _EmissiveBlink_Min ("Blink Min", Float) = 0 // Minimum emission multiplier _EmissiveBlink_Max ("Blink Max", Float) = 1 // Maximum emission multiplier _EmissiveBlink_Velocity ("Blink Speed", Float) = 4 // Glow in the Dark (emission in low light) _EnableGITDEmission ("Glow in Dark", Float) = 0 _GITDMinEmissionMultiplier ("Min Multiplier", Range(0, 1)) = 1 // Emission when lit _GITDMaxEmissionMultiplier ("Max Multiplier", Range(0, 1)) = 0 // Emission when dark ``` -------------------------------- ### Create UI Footers Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Adds interactive footer buttons to the shader UI, such as links to external URLs or icons. ```Unity Shader [HideInInspector] footer_github ("{text:Github,action:{type:URL,data:https://github.com/thryrallo/thryeditor}}", Float) = 0 [HideInInspector] footer_discord ("{texture:{name:discord-icon,height:40},action:{type:URL,data:https://discord.gg}}", Float) = 0 ``` -------------------------------- ### Enable Shader Features Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Enables specific shader functionality panels like DSGI, Instancing, or Lightmap flags. ```Unity Shader [HideInInspector] DSGI ("", Float) = 0 [HideInInspector] Instancing ("", Float) = 0 [HideInInspector] LightmapFlags ("", Float) = 0 ``` -------------------------------- ### Variant Selector with Enum and Actions Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Demonstrates how to use Enum with on_value_actions to create a variant selector. This allows different shader properties or shader assignments based on the selected enum value. ```ShaderLab [Enum(Cutout,0,Transparent,1)]variant_selector("Variant--{on_value_actions:[{value:0,actions:[{type:SET_PROPERTY,data:_ZWrite=1},{type:SET_SHADER,data:Thry/Example 1}]},{value:1,actions:[{type:SET_PROPERTY,data:_ZWrite=0},{type:SET_SHADER,data:Thry/Example 2}]}\}}",Float) = 0 ``` -------------------------------- ### UI Button and Action API Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Defines the structure for UI buttons and associated actions triggered within the shader inspector. ```APIDOC ## UI Button Configuration ### Description Defines interactive buttons that trigger specific actions like opening URLs or setting shader properties. ### Parameters #### Button Structure - **text** (string) - Required - Button label. - **action** (Action) - Required - The action object to perform. - **hover** (string) - Optional - Tooltip text. #### Action Structure - **type** (ActionType) - Required - URL, SET_PROPERTY, or SET_SHADER. - **data** (string) - Required - The payload for the action. ### Request Example { "type": "URL", "data": "https://github.com/Thryrallo/thryeditor" } ### Response - **Success** (200) - Action configuration registered. ``` -------------------------------- ### Gradient Texture Drawer Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Implements a 'Gradient' drawer that creates a texture field with an adjacent gradient editor. The gradient is automatically converted into a texture. ```ShaderLab [Gradient]_ColorRamp("Color Ramp",2D)= "white" { } ``` -------------------------------- ### Conditional Logic API Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Defines how to implement conditional visibility and logic for shader properties based on state. ```APIDOC ## Conditional Logic ### Description Defines conditions to show or hide properties based on property values, editor versions, or texture states. ### Parameters #### Condition Fields - **type** (ConditionType) - Required - AND, OR, PROPERTY_BOOL, EDITOR_VERSION, etc. - **data** (string) - Required - The condition value or comparator string. ### Request Example { "type": "DROPDOWN", "data": "_LightingType==2" } ### Response - **Success** (200) - Condition evaluated and UI state updated accordingly. ``` -------------------------------- ### Configure Decal System in HLSL Source: https://context7.com/poiyomi/poiyomitoonshader/llms.txt This HLSL code defines parameters for applying up to 4 independent decals to a material. It includes controls for enabling decals, positioning, rotation, scaling, texture selection, color tinting, emission strength, and various blending modes. Advanced options for mirroring, symmetry, and hue shifting are also available. ```hlsl // Decal 0 Configuration (Decals 0-3 available) _DecalEnabled ("Enable Decal 0", Float) = 0 // Positioning _DecalPosition ("Position", Vector) = (0.5, 0.5, 0, 0) // UV coordinates (0.5 = center) _DecalRotation ("Rotation", Range(0, 360)) = 0 _DecalRotationSpeed ("Rotation Speed", Float) = 0 // Animated rotation _DecalScale ("Scale", Vector) = (1, 1, 1, 0) // X, Y, linked _DecalSideOffset ("Side Offset", Vector) = (0, 0, 0, 0) // L, R, D, U // Texture and Color _DecalTexture ("Decal", 2D) = "white" { } _DecalColor ("Color", Color) = (1, 1, 1, 1) _DecalEmissionStrength ("Emission Strength", Range(0, 20)) = 0 // Blending _DecalBlendType ("Color Blend Mode", Int) = 0 // 0=Replace, 1=Darken, 2=Multiply, 5=Lighten, 6=Screen, 7=Subtract, 8=Add, 9=Overlay _DecalBlendAlpha ("Alpha", Range(0, 1)) = 1 _Decal0Depth ("Depth", Range(-0.5, 2)) = 0 // Layer ordering // Mirroring for avatar symmetry _DecalMirroredUVMode ("Mirrored UV Mode", Int) = 0 // Off, Flip, Left/Right Only _DecalSymmetryMode ("Symmetry Mode", Int) = 0 // Off, Symmetry, Flipped // Hue Shift per Decal _DecalHueShiftEnabled ("Enable Hue Shift", Float) = 0 _DecalHueShift ("Hue Shift", Range(0, 1)) = 0 _DecalHueShiftSpeed ("Shift Speed", Float) = 0 ``` -------------------------------- ### Unity Shader Configuration: Color Adjust and Hue Shift Source: https://context7.com/poiyomi/poiyomitoonshader/llms.txt Properties for runtime color adjustments including saturation, brightness, gamma, and hue shifting. Supports masking for per-channel control and provides options for static hue selection or animated hue cycling. ```hlsl // Enable Color Adjustment // Inspector: Color & Normals > Color Adjust > Enable _Saturation ("Saturation", Range(-1, 10)) = 0 // -1 grayscale, 0 normal, >0 oversaturated _MainBrightness ("Brightness", Range(-1, 2)) = 0 _MainGamma ("Gamma", Range(0.01, 5)) = 1 // Hue Shift Configuration _MainHueShiftToggle ("Enable Hue Shift", Float) = 0 _MainHueShiftColorSpace ("Color Space", Int) = 0 // 0=OKLab, 1=HSV _MainHueShiftSelectOrShift ("Mode", Int) = 1 // 0=Hue Select, 1=Hue Shift _MainHueShift ("Hue Shift", Range(0, 1)) = 0 // 0-1 cycles through all hues _MainHueShiftSpeed ("Shift Speed", Float) = 0 // Non-zero for animated cycling // Color Adjustment Mask (per-channel control) _MainColorAdjustTexture ("Mask", 2D) = "white" { } // R = Hue Mask, G = Brightness Mask, B = Saturation Mask, A = Gamma Mask // Animation Example (for avatar animators): // Animate _MainHueShift from 0 to 1 for rainbow cycling effect // Use _MainHueShiftSpeed for automatic continuous cycling ``` -------------------------------- ### Vector3 Drawer Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Implements a 'Vector3' drawer to create a user interface field for Vector3 properties, allowing input for three float values. ```ShaderLab [Vector3]_Vector("Vector with 3 values",Vector)= (0,0,0,0) ``` -------------------------------- ### Vector2 Drawer Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Implements a 'Vector2' drawer to create a user interface field for Vector2 properties, allowing input for two float values. ```ShaderLab [Vector2]_Vector("Vector with 2 values",Vector)= (0,0,0,0) ``` -------------------------------- ### Shader Locking for Optimization (HLSL & C#) Source: https://context7.com/poiyomi/poiyomitoonshader/llms.txt Optimizes shaders for VRChat performance by locking materials, which strips unused features, bakes constants, and makes properties non-animatable. Unused properties can be marked as 'Animated' to remain animatable. Includes C# API for programmatic locking and unlocking. ```hlsl // Shader Optimizer controlled via ThryEditor // Access via material inspector: Lock button (padlock icon) // When locked: // - Unused features are stripped from shader // - Constants are baked into shader code // - Material properties become non-animatable // - Significantly improves GPU performance // Properties to keep animated (prefix with "Animated"): // In material inspector, properties can be marked as "Animated" // These will NOT be baked and remain animatable // C# API for locking: using Thry.ThryEditor; // Lock a material ShaderOptimizer.SetLockedForAllMaterials(new Material[] { myMaterial }, 1, true); // Unlock a material ShaderOptimizer.SetLockedForAllMaterials(new Material[] { myMaterial }, 0, true); // Check if material is locked bool isLocked = ShaderOptimizer.IsLocked(myMaterial); // Important: Always lock materials before uploading to VRChat // Unlocked materials display warning: "YOU_FORGOT_TO_LOCK_THIS_MATERIAL" ``` -------------------------------- ### Unity Shader Configuration: Main Texture and Normals Source: https://context7.com/poiyomi/poiyomitoonshader/llms.txt Configuration properties for the main texture, color, alpha settings, and normal maps within a Unity shader. Includes settings for UV mapping, panning, and alpha mask blending modes. ```hlsl // Main Color & Texture Properties _Color ("Color & Alpha", Color) = (1, 1, 1, 1) _MainTex ("Texture", 2D) = "white" { } _MainTexUV ("UV", Int) = 0 // UV0-UV3, Panosphere, World/Local Pos, Polar UV, Distorted UV, Matcap _MainTexPan ("Panning", Vector) = (0, 0, 0, 0) // X/Y pan speed // Normal Map Configuration _BumpMap ("Normal Map", 2D) = "bump" { } _BumpScale ("Intensity", Range(0, 10)) = 1 // Alpha Mask for transparency control _AlphaMask ("Alpha Map", 2D) = "white" { } _MainAlphaMaskMode ("Blend Mode", Int) = 2 // Off, Replace, Multiply, Add, Subtract _AlphaMaskInvert ("Invert", Float) = 0 // Alpha Cutoff for cutout rendering _Cutoff ("Alpha Cutoff", Range(0, 1.001)) = 0.5 // Example Material Setup: // 1. Assign your base texture to "Texture" slot // 2. Set Color tint (default white for no tinting) // 3. Add Normal Map for surface detail // 4. Configure Alpha Mask if using transparency // 5. Adjust Alpha Cutoff for cutout materials ``` -------------------------------- ### MultiSlider Drawer for Vector Properties Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Implements a 'MultiSlider' drawer for vector properties, allowing users to control a range with sliders. The X and Y components represent the slider values, while Z and W define the minimum and maximum limits. ```ShaderLab [MultiSlider]_Slider("Multi Slider",Vector)= (0.1,0.9,0,1) ``` -------------------------------- ### Big Texture Drawer Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Implements a 'BigTexture' drawer to create a texture field that is consistently displayed at a large size in the UI. ```ShaderLab [BigTexture]_MainTex("Main Texture",2D)= "white" { } ``` -------------------------------- ### Texture Array Drawer Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Implements a 'TextureArray' drawer to create a field that accepts and manages texture arrays, commonly used for flipbook animations. ```ShaderLab [TextureArray]_FlipbookTexArray ("Texture Array", 2DArray) = "" {} ``` -------------------------------- ### Condition Type Definitions Source: https://github.com/poiyomi/poiyomitoonshader/blob/master/_PoiyomiShaders/Scripts/ThryEditor/docs.html Illustrates various condition types used for controlling property visibility or behavior, including checking boolean properties, editor versions, SDK versions, texture settings, and dropdown selections. These are defined using a JSON-like structure. ```JSON {type:PROPERTY_BOOL,data:_ForceOpaque} ``` ```JSON {type:PROPERTY_BOOL,data:_ForceOpaque==0} ``` ```JSON {type:EDITOR_VERSION,data:>0.17} ``` ```JSON {type:VRC_SDK_VERSION,data:>0.17} ``` ```JSON {type:TEXTURE_SET,data:_ToonRamp} ``` ```JSON {type:DROPDOWN,data:_LightingType==2} ```