Skip to content

Commit

Permalink
Fixed: Null reference exception when the HDRP tesselation shader is a…
Browse files Browse the repository at this point in the history
…pplied . (#327)
  • Loading branch information
H3idi-X authored Aug 22, 2023
1 parent 660f671 commit 095ecfd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions com.unity.toonshader/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog
## [0.9.5-preview] - 2023-06-18
TBD - not released yet.
## [0.9.5-preview] - 2023-08-25
### Fixed
* A URP Shader error when using newer than 2023.1.3.
* A Null Reference Exception error with HDRP tesslation shader.

## [0.9.4-preview] - 2023-05-01
* Added a exlanation for URP line issue into Kown Issues.
Expand Down
3 changes: 2 additions & 1 deletion com.unity.toonshader/Editor/HDRP/HDRPToonGUI-Tessellation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ void DrawDelayedFloatProperty(MaterialProperty prop, GUIContent content)
void TessellationModePopup()
{
EditorGUI.showMixedValue = tessellationMode.hasMixedValue;
var mode = (TessellationMode)tessellationMode.floatValue;
TessellationMode mode = TessellationMode.None;
mode = (TessellationMode)tessellationMode?.floatValue;

EditorGUI.BeginChangeCheck();
mode = (TessellationMode)EditorGUILayout.Popup(TessellationStyles.tessellationModeText, (int)mode, TessellationStyles.tessellationModeNames);
Expand Down

0 comments on commit 095ecfd

Please sign in to comment.