Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

LWGUI

> 开发工具
Open source

A Lightweight, Flexible, Powerful Shader GUI System for Unity.

1.4K stars0 likes2 views
WebsiteGitHub

About

A Lightweight, Flexible, Powerful Shader GUI System for Unity.

LWGUI (Light Weight Shader GUI)

中文 | English A lightweight, flexible, and powerful Unity Shader GUI system built to maximize material inspector productivity.

LWGUI has been proven in many large-scale commercial projects:
with concise Material Property Drawer syntax, you can build complex inspectors quickly while benefiting from a modular Drawer/Decorator extension architecture, robust MetaData lifecycle caching, a complete Ramp/Preset/Toolbar toolchain, and Timeline integration.

It significantly shortens iteration cycles while improving collaboration between artists and technical artists.

NEW: Now supports visual editing of LWGUI Attributes in Amplify Shader Editor!
You need to install ASE v1.9.9.10+ and enable Project Settings > LWGUI > ASE Integration
The new SampleAmplifyShader can help you get started quickly!
A more powerful Gradient editor than UE, with support for both Shader and C# Use Ramp Atlas to include multiple Ramps in one Texture
When recording material parameter animations in Timeline, automatically capture changes to Toggle's Keywords to enable switching material Keywords at runtime. Feature-rich toolbar
With your sponsorship, I will update more actively. 有你的赞助我会更加积极地更新
paypal.me/JasonMa0012
  • LWGUI (Light Weight Shader GUI)
    • Installation
    • Getting Started
      • NEW: Using in Amplify Shader Editor
      • Using in a Code Editor
    • Basic Drawers
      • Main & Sub
    • Extra Drawers
      • Enum
        • KWEnum
        • SubEnum & SubKeywordEnum
        • Preset
          • Create Preset File
          • Edit Preset
      • Numeric
        • BitMask
        • MinMaxSlider
        • SubIntRange
        • SubPowerSlider
        • SubToggle
      • Ramp
        • Ramp
          • ShaderLab
          • C#
          • Gradient Editor
        • RampAtlas
          • Ramp Atlas Scriptable Object
        • RampAtlasIndexer
      • Texture
        • Image
        • Tex
      • Vector
        • Channel
        • Color
      • Other
        • Button
    • Extra Decorators
      • Appearance
        • Title
        • Tooltip & Helpbox
        • Hidden
        • HelpURL
        • ReadOnly
      • Condition
        • ActiveIf
        • ShowIf
        • PassSwitch
      • Structure
        • Advanced & AdvancedHeaderProperty
    • LWGUI Timeline Tracks
      • MaterialKeywordToggleTrack
    • Unity Builtin Drawers
      • Space
      • Header
      • Enum
      • IntRange
      • KeywordEnum
      • PowerSlider
      • Toggle
    • FAQs
      • Problems Occurred After Modifying the Material in the Code
      • Problems Occurred After Creating the Material in the Code
    • Custom Shader GUI
      • Custom Header and Footer
      • Custom Drawer
    • Contribution
    • Development Guide
      • Data Structure (Shader > Material > Inspector)
      • Lifecycle

Installation

  1. Make sure your environment is compatible with LWGUI

    • LWGUI <1.17: Unity 2017.4+

    • LWGUI >=1.17: Unity 2021.3+

      • Recommended minimum version: Unity 2022.2+, lower versions can be used but may have bugs
  2. Open your project

  3. Window > Package Manager > Add > Add package from git URL , enter: https://github.com/JasonMa0012/LWGUI.git

    • You can also choose to manually download the Zip from Github,then: Package Manager > Add package from disk
    • For Unity 2017, please extract the Zip directly to the Assets directory

Getting Started

NEW: Using in Amplify Shader Editor

  1. Install ASE v1.9.9.10 +
  2. Enable: Project Settings > LWGUI > ASE Integration (At this point, ASE's default Custom Editor will be replaced with LWGUI.LWGUI)
  3. Create or open an Amplify Shader, create or select a Parameter node, and now you can edit LWGUI Drawers and Decorators:
  • Each Parameter node can only have one Drawer, but can have multiple Decorators
  • Detailed descriptions of all Drawers and Decorators can be found below
  • You need to manually select the constructor, a constructor with fewer parameters means some parameters use default values
  • Don't forget to adjust the order of parameters! Incorrect order can cause layout issues
  • You can view the generated code to help solve problems

Using in a Code Editor

  1. Create a newer or use the existing Shader

  2. Open the Shader in the code editor

  3. At the bottom of the Shader, before the last large bracket, add line:CustomEditor "LWGUI.LWGUI"

  4. Completed! Start using the following powerful Drawer to easily draw your Shader GUI

    • MaterialPropertyDrawer is C#-like attribute syntax, it can be used in front of shader properties to change the drawing method, more information can be found in the official documentation
    • You can refer to the example Shaders in the Test directory
    • Please note: Each Property can only have one Drawer, but can have multiple Decorators

Basic Drawers

Main & Sub

…
csharp
/// Draw a property with default style in the folding group
/// 
/// group: parent group name (Default: none)
/// Target Property Type: Any
public SubDrawer() { }
public SubDrawer(string group)

Example:

…

Default result:

Then change values:

Extra Drawers

Enum

KWEnum

…

SubEnum & SubKeywordEnum

…

Preset

csharp
/// Popping a menu, you can select the Shader Property Preset, the Preset values will replaces the default values
/// 
/// group: parent group name (Default: none)
///	presetFileName: "Shader Property Preset" asset name, you can create new Preset by
///		"Right Click > Create > LWGUI > Shader Property Preset" in Project window,
///		*any Preset in the entire project cannot have the same name*
/// Target Property Type: Float, express current keyword index
public PresetDrawer(string presetFileName) : this("_", presetFileName) {}
public PresetDrawer(string group, string presetFileName)

Example:

…

Result:

The Property Value in the selected Preset will be the default value:

Create Preset File
Edit Preset

Numeric

BitMask

…

Example:

csharp
[BitMask(Preset)] _Stencil ("Stencil", Integer) = 0  
[BitMask(Preset, Left, Bit6, Bit5, Bit4, Description, Bit2, Bit1, Right)] _StencilWithDescription ("Stencil With Description", Integer) = 0

Result:

[!CAUTION] If used to set Stencil, it will conflict with SRP Batcher! (Reproduced in Unity 2022)

SRP Batcher does not correctly handle multiple materials with different Stencil Ref values, mistakenly merging them into a single Batch and randomly selecting one material's Stencil Ref value for the entire Batch. In theory, if different materials have different Stencil Ref values, they should not be merged into a single Batch due to differing Render States.

Solution:

  • Force disable SRP Batcher by setting the Material Property Block
  • Place materials with the same Stencil Ref value in a separate Render Queue to ensure the Batch's Render State is correct

MinMaxSlider

csharp
/// Draw a min max slider
/// 
/// group: parent group name (Default: none)
/// minPropName: Output Min Property Name
/// maxPropName: Output Max Property Name
/// Target Property Type: Range, range limits express the MinMaxSlider value range
/// Output Min/Max Property Type: Range, it's value is limited by it's range
public MinMaxSliderDrawer(string minPropName, string maxPropName) : this("_", minPropName, maxPropName) { }
public MinMaxSliderDrawer(string group, string minPropName, string maxPropName)

Example:

csharp
[Title(MinMaxSlider Samples)]
[MinMaxSlider(_rangeStart, _rangeEnd)] _minMaxSlider("Min Max Slider (0 - 1)", Range(0.0, 1.0)) = 1.0
/*[HideInInspector]*/_rangeStart("Range Start", Range(0.0, 0.5)) = 0.0
/*[HideInInspector]*/[PowerSlider(10)] _rangeEnd("Range End PowerSlider", Range(0.5, 1.0)) = 1.0

Result:

SubIntRange

csharp
/// Similar to builtin IntRange()
/// 
/// group: parent group name (Default: none)
/// Target Property Type: Range
public SubIntRangeDrawer(string group)

SubPowerSlider

…

SubToggle

…

Ramp

Ramp

ShaderLab
…

Example:

csharp
[Ramp(_, RampMap, Assets.Art, 512)] _Ramp ("Ramp Map", 2D) = "white" { }

Result:

You must manually Save the edit results, if there are unsaved changes, the Save button will display yellow.

When you move or copy the Ramp Map, remember to move together with the .meta file, otherwise you will not be able to edit it again!

C#

Example:

csharp
public class Test : MonoBehaviour
{
    public LwguiGradient lwguiGradientSrgb = new LwguiGradient();

    [LwguiGradientUsage(ColorSpace.Linear, LwguiGradient.ChannelMask.RGB, LwguiGradient.GradientTimeRange.TwentyFourHundred)]
    public LwguiGradient lwguiGradientLinear = new LwguiGradient();
}

Result:

Default display settings can be set using the LwguiGradientUsage() Attribute.

Gradient Editor

The new LWGUI Gradient Editor integrates with Unity's built-in Gradient Editor and Curve Editor, enabling more powerful features than UE's Gradient Editor.

| Editor | Description

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#editorguihlslshader

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具