UI+ VRChat Shader
- Digital900 JPY








# UI+ UI Shader for VRChat Worlds ## Features - Anti-Aliased rounded corners - Border Width, Color and Blur - Box Shadow Spread and Offset - Refractive Glass (2 Modes - Static Texture or Grabpass) - Multi-channel SDF Textures - Super Sampling - Gradient (Radial, Linear) - Parallax Depth ## Usage - Create a new Material with the `"UI+/Image"` Shader - Assign it an Image component on a Canvas - Add Component `PositionAsUV1` to the Image GameObject (Important) For additional help reference the included sample scene ### Refractive Glass - Regular Mode (Recommended): Set a canvas background texture and adjust the canvas size (the image will cover the portion of the background where its positioned on the canvas) - Grabpass Mode: Uses a Grabpass instead for the background (requires manually managing render queues, no blur option) - Highlight rotation with the canvas transform ### MSDF - Supports MSDF textures generated with [msdfgen](https://github.com/Chlumsky/msdfgen) - Disable sRGB on MSDF textures and enable high quality (use the included texture importer preset) - This allows sharper images with lower resolution (similar to TextMeshPro fonts but for an image) ### Gradient - Applies a gradient texture to the image, border or the shadow layer - Radial and Linear UVs with rotation and tiling with time ## Contents - UI Shader for Canvas Image or RawImage components: `"UI+/Image"` and `"UI+/Image Grabpass"` - Example Scene (all of the images were taken in Unity) ## Additional Info - Every Image requires a `PositionAsUV1` component (Add Component -> UI -> Effects -> Position As UV1). This component sets additional vertex attributes that are required for certain shader features to work properly - Additional shader channels `TexCoord1`, `Normal`, and `Tangent` are required on the Canvas component (On by default on VRChat UI) - Shader is only meant for the UI (mesh renderers are not supported) - The vertex color alpha has multiply all the individual layers in order for canvas group alpha to function. To keep borders, shadow and other layers visible use a transparent sprite instead or set the alpha on the material color property - To only apply vertex colors (Image Component Color) to other layers like the shadow, border without affecting the image, disable image tint and enable tint on the specific layer - The shader itself does not have any dependencies on VRChat itself and can be used in a standalone Unity application with the Built-In or Universal Render Pipeline as well (excluding the example scene), however theres better ways to do this with proper C# scripting - Some effects automatically enable the rounded box SDF, the corner radius gets applied even if the border is disabled - As an alternative to the `PositionAsUV1` you can enable Sliced Mode and set the `white-sliced-mode` sprite to adjust the radius with a pixel pre unit multiplier on the image component, however it will behave differently as the additional vertex data is missing ## Limitations This shader was created with certain VRChat limitations, due to lack of full C# scripting: - Only Image Type `Simple` is supported with borders/shadows, most the features were made to replace the need for sliced images. Sprite atlas is also still supported - Changing the Rect Transform Pivot is not supported with all features (changing the pivot of a parent Rect Transform works however) - The shadow feature does not work with non uniform transform scaling currently - Wide shadow distance effects might have issues with culling and sorting (the mesh gets extruded) - Managing the Render Queue can be harder with the Refractive Glass Grabpass shader - An attempt was made to make the shader compatible with UI as much as possible, but I can not guarantee it works with every Unity feature ## Prefabs using UI+ - https://github.com/z3y/ZPlayer ## Changelog ### [1.4.1] - 2025-12-2 - Parallax depth for the background glass texture - Tested and confirmed support in URP (Works in BasisVR) - Fixed material color getting disabled when vertex color is disabled - Added optional fog - Added cull mode - Added a special use case for sliced mode ### [1.4.0] - 2025-11-27 - Glass highlight min max adjustment - Border blur is now adjustable for glass and regular border - Shadow fill toggle - Added more samples - Fixed sample incorrect TMP component ### [1.3.1] - 2025-11-26 - Added glass highlight rotation ### [1.3.0] - 2025-11-25 - Added parallax depth effect for the sprite texture - Improved Anti-Aliasing - Added Anti-Aliasing offset property which can help remove the gap between UI Images - Invert corners toggle - Scene with few more examples ### [1.2.0] - 2025-11-19 - New shader inspector - Fix buttons for faster setup ### [1.1.0] - 2025-11-18 - Added Gradients - Fixed Shadow not working without borders enabled - Added options to tint individual layers with vertex colors ### [1.0.0] - 2025-11-11 - Initial Release ## Example Example VRChat World - https://vrchat.com/home/world/wrld_d86c4cca-1d13-49f6-af79-5ce997179a7c/info ## Contact https://discord.gg/bw46tKgRFT ## Terms of use You are permitted to use and modify the shader for public or private VRChat worlds, or any other Unity application, without including the shader source code.
日本語
# UI+ VRChatワールド用UIシェーダー ## 機能 - アンチエイリアス処理された丸い角 - 境界線の幅、色、ぼかし - ボックスシャドウの拡散とオフセット - 屈折ガラス(2つのモード - 静的テクスチャまたはグラブパス) - マルチチャンネルSDFテクスチャ - スーパーサンプリング - グラデーション(放射状、線形) - 視差深度 ## 使用方法 - `"UI+/Image"` シェーダーで新しいマテリアルを作成します。 - キャンバスにイメージコンポーネントを割り当てます。 - イメージゲームオブジェクトにコンポーネント `PositionAsUV1` を追加します(重要) 詳細については、付属のサンプルシーンを参照してください。 ### 屈折ガラス - 通常モード(推奨):キャンバスの背景テクスチャを設定し、キャンバスサイズを調整します(画像はキャンバス上の配置部分の背景を覆います)。 - グラブパスモード:背景にグラブパスを使用します(レンダリングを手動で管理する必要があります)。キュー、ぼかしオプションなし) - キャンバストランスフォームによるハイライト回転 ### MSDF - [msdfgen](https://github.com/Chlumsky/msdfgen) で生成された MSDF テクスチャをサポート - MSDF テクスチャの sRGB を無効にし、高画質を有効にします(付属のテクスチャインポータープリセットを使用) - 低解像度でも鮮明な画像を実現(TextMeshPro フォントと同様の効果を画像で実現) ### グラデーション - 画像、境界、またはシャドウレイヤーにグラデーションテクスチャを適用します - 時間経過による回転とタイリングが可能な放射状および線形 UV ## コンテンツ - Canvas Image または RawImage コンポーネント用の UI シェーダー: `"UI+/Image"` および `"UI+/Image Grabpass"` - サンプルシーン(すべての画像は Unity で撮影) ## 追加情報 - すべての画像には `PositionAsUV1` コンポーネントが必要です([コンポーネントの追加] -> [UI] -> [エフェクト] -> [Position As UV1])。このコンポーネントは、特定のシェーダー機能が正しく動作するために必要な追加の頂点属性を設定します。 - Canvas コンポーネントには、追加のシェーダーチャンネル「TexCoord1」、「Normal」、「Tangent」が必要です(VRChat UI ではデフォルトでオンになっています)。 - シェーダーは UI 専用です(メッシュレンダラーはサポートされていません)。 - Canvas グループアルファを機能させるには、頂点カラーアルファをすべての個別レイヤーに乗算する必要があります。境界線、影、その他のレイヤーを表示するには、透明なスプライトを使用するか、マテリアルカラープロパティでアルファを設定します。 - 頂点カラー(画像コンポーネントカラー)を、画像に影響を与えずに影や境界線などの他のレイヤーにのみ適用するには、画像の色合いを無効にし、特定のレイヤーの色合いを有効にします。 - このシェーダー自体はVRChat自体に依存しておらず、組み込みまたはユニバーサルレンダーパイプラインを使用したスタンドアロンのUnityアプリケーションでも使用できます(サンプルシーンを除く)。ただし、適切なC#スクリプトを使用することで、より優れた方法でこれを行うことができます。 - 一部のエフェクトは角丸ボックスSDFを自動的に有効にするため、境界線が無効であっても角の半径が適用されます。 - `PositionAsUV1`の代わりに、スライスモードを有効にし、`white-sliced-mode`スプライトを設定することで、画像コンポーネントのピクセル単位乗数を使用して半径を調整できます。ただし、追加の頂点データがないため、動作が異なります。 ## 制限事項 このシェーダーは特定のVRChatで作成されました。完全な C# スクリプトがないため、以下の制限があります。 - 境界線/影付きでサポートされているのは、画像タイプ「Simple」のみです。ほとんどの機能は、スライスされた画像の必要性をなくすために作成されています。スプライトアトラスも引き続きサポートされています - Rect Transform のピボット変更は、すべての機能でサポートされているわけではありません(ただし、親 Rect Transform のピボット変更は可能です) - シャドウ機能は、現在、非均一なトランスフォームスケーリングでは動作しません - シャドウ距離が広いエフェクトでは、カリングとソートに問題が発生する可能性があります(メッシュが押し出されます) - 屈折ガラス Grabpass シェーダーを使用すると、レンダーキューの管理が難しくなる可能性があります - シェーダーは UI と可能な限り互換性を持たせるよう努めましたが、すべての Unity 機能で動作することを保証することはできません ## UI+ を使用したプレハブ - https://github.com/z3y/ZPlayer ## 変更履歴 ### [1.4.1] - 2025-12-2 - 背景ガラステクスチャの視差深度 - URP でのサポートをテストおよび確認済み(BasisVR で動作) - 頂点カラーが無効になっているとマテリアルカラーも無効になる問題を修正 - オプションのフォグを追加 - カリングモードを追加 -スライスモードの特殊な使用例を追加しました ### [1.4.0] - 2025-11-27 - ガラスのハイライトの最小値と最大値を調整 - ガラスと通常の境界線の境界線のぼかしを調整可能 - 影の塗りつぶし切り替え - サンプルを追加 - サンプルのTMPコンポーネントの誤りを修正 ### [1.3.1] - 2025-11-26 - ガラスのハイライトの回転機能を追加しました ### [1.3.0] - 2025-11-25 - スプライトテクスチャに視差深度効果を追加しました - アンチエイリアシングを改善しました - UI画像間の隙間をなくすのに役立つアンチエイリアシングのオフセットプロパティを追加しました - コーナー反転切り替え機能を追加しました - サンプルシーンをいくつか追加しました ### [1.2.0] - 2025-11-19 - 新しいシェーダーインスペクターを追加しました - セットアップを高速化するためのボタンを修正しました ### [1.1.0] - 2025-11-18 -グラデーションを追加 - ボーダーが有効になっていないと影が機能しない問題を修正 - 頂点カラーで個々のレイヤーに色付けするオプションを追加 ### [1.0.0] - 2025年11月11日 - 初回リリース ## 例 VRChatワールドの例 - https://vrchat.com/home/world/wrld_d86c4cca-1d13-49f6-af79-5ce997179a7c/info ## お問い合わせ https://discord.gg/bw46tKgRFT ## 利用規約 シェーダーのソースコードを含めることなく、公開または非公開のVRChatワールド、あるいはその他のUnityアプリケーションでシェーダーを使用および改変することができます。








