Skip to content

Commit 7169cde

Browse files
committed
Grafted update from com.unity.toonshader.
1 parent 6d6adac commit 7169cde

6 files changed

+12
-9
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22
**Universal Toon Shader [a.k.a. Unity-Chan Toon Shader]**
3+
## [2.4.0] - 2022/01/20
4+
* URP:UTS materials don't receive shadows when using newer than Unity 2021.1.
5+
* AutoRenderQueue is canceled when material inspector is unfocused.
36

47
## [2.3.0] - 2021/10/18
58
### Fixed

Editor/UniversalToonGUI.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace UnityEditor.Rendering.Universal.Toon.ShaderGUI
66
public class UniversalToonGUI : UnityEditor.ShaderGUI
77
{
88
protected const float kVersionX = 2.0f;
9-
protected const float kVersionY = 3.0f;
9+
protected const float kVersionY = 4.0f;
1010
protected const float kVersionZ = 0.0f;
1111

1212
const string ShaderDefineSHADINGGRADEMAP = "_SHADINGGRADEMAP";
@@ -561,6 +561,8 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro
561561
Material material = materialEditor.target as Material;
562562

563563
UpdateVersionInMaterial(material);
564+
565+
_autoRenderQueue = (int)material.GetInt(ShaderPropAutoRenderQueue);
564566
_Transparent_Setting = (_UTS_Transparent)material.GetInt(ShaderPropTransparentEnabled);
565567
_StencilNo_Setting = material.GetInt(ShaderPropStencilNo);
566568

Runtime/Shaders/UniversalToon.shader

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Shader "Universal Render Pipeline/Toon" {
1010
[HideInInspector] _simpleUI("SimpleUI", Int) = 0
1111
// Versioning of material to help for upgrading
1212
[HideInInspector] _utsVersionX("VersionX", Float) = 2
13-
[HideInInspector] _utsVersionY("VersionY", Float) = 3
13+
[HideInInspector] _utsVersionY("VersionY", Float) = 4
1414
[HideInInspector] _utsVersionZ("VersionZ", Float) = 0
1515

1616
[HideInInspector] _utsTechnique("Technique", int) = 0 //DWF

Runtime/Shaders/UniversalToonBodyDoubleShadeWithFeather.hlsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103
//DoubleShadeWithFeather
104104
#endif
105105

106-
real shadowAttenuation = 1.0;
107-
# ifdef _MAIN_LIGHT_SHADOWS
106+
float shadowAttenuation = 1.0;
107+
#if defined(_MAIN_LIGHT_SHADOWS) || defined(_MAIN_LIGHT_SHADOWS_CASCADE) || defined(_MAIN_LIGHT_SHADOWS_SCREEN)
108108
shadowAttenuation = mainLight.shadowAttenuation;
109109

110110
# endif

Runtime/Shaders/UniversalToonBodyShadingGradeMap.hlsl

+2-4
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,10 @@
9494
#endif
9595

9696

97-
real shadowAttenuation = 1.0;
98-
99-
# ifdef _MAIN_LIGHT_SHADOWS
97+
float shadowAttenuation = 1.0;
10098

99+
#if defined(_MAIN_LIGHT_SHADOWS) || defined(_MAIN_LIGHT_SHADOWS_CASCADE) || defined(_MAIN_LIGHT_SHADOWS_SCREEN)
101100
shadowAttenuation = mainLight.shadowAttenuation;
102-
103101
# endif
104102

105103

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.unity.universaltoonshader.urp",
33
"displayName": "Universal Toon Shader for URP",
4-
"version": "2.3.0",
4+
"version": "2.4.0",
55
"unity": "2019.3",
66
"description": "Universal Toon Shader(a.k.a Unity-Chan Toon Shader) is a toon shader for images and video that is designed to meet the needs of creators working on cel-shaded 3DCG animations.\nUnlike other pre-render toon shaders, all features can be adjusted in real time on Unity, which is the greatest feature of UTS2.\n\nUTS2 has great power and makes a wide variety of character designs possible, from cel-shaded to light novel illustration styles.\n\nUTS2 has the 3 basic layers of Base Color, 1st Shade Color, and 2nd Shade Color, colors and textures can also accept a wide variety of customization options, such as High Color, Rim Light, MatCap (sphere mapping), and Emissive (light emission).The level of gradation (feather) between colors can also be adjusted in Unity in real-time.",
77
"repository": {

0 commit comments

Comments
 (0)