Skip to content

Commit

Permalink
Grafted update from com.unity.toonshader.
Browse files Browse the repository at this point in the history
  • Loading branch information
H3idi-X committed Jan 20, 2022
1 parent 6d6adac commit 7169cde
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog
**Universal Toon Shader [a.k.a. Unity-Chan Toon Shader]**
## [2.4.0] - 2022/01/20
* URP:UTS materials don't receive shadows when using newer than Unity 2021.1.
* AutoRenderQueue is canceled when material inspector is unfocused.

## [2.3.0] - 2021/10/18
### Fixed
Expand Down
4 changes: 3 additions & 1 deletion Editor/UniversalToonGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace UnityEditor.Rendering.Universal.Toon.ShaderGUI
public class UniversalToonGUI : UnityEditor.ShaderGUI
{
protected const float kVersionX = 2.0f;
protected const float kVersionY = 3.0f;
protected const float kVersionY = 4.0f;
protected const float kVersionZ = 0.0f;

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

UpdateVersionInMaterial(material);

_autoRenderQueue = (int)material.GetInt(ShaderPropAutoRenderQueue);
_Transparent_Setting = (_UTS_Transparent)material.GetInt(ShaderPropTransparentEnabled);
_StencilNo_Setting = material.GetInt(ShaderPropStencilNo);

Expand Down
2 changes: 1 addition & 1 deletion Runtime/Shaders/UniversalToon.shader
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Shader "Universal Render Pipeline/Toon" {
[HideInInspector] _simpleUI("SimpleUI", Int) = 0
// Versioning of material to help for upgrading
[HideInInspector] _utsVersionX("VersionX", Float) = 2
[HideInInspector] _utsVersionY("VersionY", Float) = 3
[HideInInspector] _utsVersionY("VersionY", Float) = 4
[HideInInspector] _utsVersionZ("VersionZ", Float) = 0

[HideInInspector] _utsTechnique("Technique", int) = 0 //DWF
Expand Down
4 changes: 2 additions & 2 deletions Runtime/Shaders/UniversalToonBodyDoubleShadeWithFeather.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@
//DoubleShadeWithFeather
#endif

real shadowAttenuation = 1.0;
# ifdef _MAIN_LIGHT_SHADOWS
float shadowAttenuation = 1.0;
#if defined(_MAIN_LIGHT_SHADOWS) || defined(_MAIN_LIGHT_SHADOWS_CASCADE) || defined(_MAIN_LIGHT_SHADOWS_SCREEN)
shadowAttenuation = mainLight.shadowAttenuation;

# endif
Expand Down
6 changes: 2 additions & 4 deletions Runtime/Shaders/UniversalToonBodyShadingGradeMap.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,10 @@
#endif


real shadowAttenuation = 1.0;

# ifdef _MAIN_LIGHT_SHADOWS
float shadowAttenuation = 1.0;

#if defined(_MAIN_LIGHT_SHADOWS) || defined(_MAIN_LIGHT_SHADOWS_CASCADE) || defined(_MAIN_LIGHT_SHADOWS_SCREEN)
shadowAttenuation = mainLight.shadowAttenuation;

# endif


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.unity.universaltoonshader.urp",
"displayName": "Universal Toon Shader for URP",
"version": "2.3.0",
"version": "2.4.0",
"unity": "2019.3",
"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.",
"repository": {
Expand Down

0 comments on commit 7169cde

Please sign in to comment.