You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: com.unity.toon-graphics-test/Editor/README_ShaderGenerator.md
+10-22Lines changed: 10 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,8 @@ This tool helps maintain consistency between `UnityToon.shader` and `UnityToonTe
4
4
5
5
## Files
6
6
7
-
-**CommonPropertiesPart.shader**: Hidden shader asset that contains the shared `Properties` block for both shaders, with original comments preserved
8
-
-**TessellationPropertiesPart.shader**: Hidden shader asset that contains tessellation-specific properties only present in the tessellation shader
7
+
-**CommonPropertiesPart.shader**: Plain text list of shared property definitions (no Shader wrapper) with original comments preserved
8
+
-**TessellationPropertiesPart.shader**: Plain text list of tessellation-only property definitions (no Shader wrapper)
9
9
-**ShaderGenerator.cs**: Unity Editor script (now located in the graphics test package) that generates the shader files from the property assets
10
10
11
11
## How to Use
@@ -27,28 +27,16 @@ This tool helps maintain consistency between `UnityToon.shader` and `UnityToonTe
27
27
28
28
## Property File Format
29
29
30
-
The property files are valid ShaderLab assets that wrap the shared definitions in a minimal hidden shader. The generator extracts only the body of the `Properties` block.
30
+
Each property file is plain text containing only property declarations, e.g.
31
31
32
32
```
33
-
Shader "Hidden/UnityToon/CommonPropertiesPart"
34
-
{
35
-
Properties
36
-
{
37
-
// Comments are preserved
38
-
[HideInInspector] _simpleUI ("SimpleUI", Int ) = 0
39
-
[Enum(OFF, 0, ON, 1)] _isUnityToonshader("Material is touched by Unity Toon Shader", Int) = 1
40
-
_BaseColor ("BaseColor", Color) = (1,1,1,1)
41
-
}
42
-
43
-
SubShader
44
-
{
45
-
Tags { "RenderType"="Opaque" }
46
-
Pass { }
47
-
}
48
-
}
33
+
// Comments are preserved
34
+
[HideInInspector] _simpleUI ("SimpleUI", Int ) = 0
35
+
[Enum(OFF, 0, ON, 1)] _isUnityToonshader("Material is touched by Unity Toon Shader", Int) = 1
36
+
_BaseColor ("BaseColor", Color) = (1,1,1,1)
49
37
```
50
38
51
-
Inside the `Properties` block you can use the same syntax as in any ShaderLab shader. Comments and blank lines are preserved.
39
+
You can use the usual ShaderLab property syntax, including comments and blank lines. The generator indents/layers them into the target shaders automatically.
52
40
53
41
## Benefits
54
42
@@ -86,8 +74,8 @@ com.unity.toon-graphics-test/
86
74
└── README_ShaderGenerator.md # This file
87
75
88
76
com.unity.toonshader/Runtime/Integrated/Shaders/
89
-
├── CommonPropertiesPart.shader # Shared properties with comments (hidden shader asset)
0 commit comments