From 1cc3763eb1092e65029da2791366e4a117839237 Mon Sep 17 00:00:00 2001 From: Jesse Barker Date: Mon, 13 Sep 2021 15:56:34 -0700 Subject: [PATCH 1/2] Fix for 1365187 - correct direction transform from view to world space --- com.unity.shadergraph/CHANGELOG.md | 7 +++++++ .../Editor/Data/Nodes/Math/Vector/TransformNode.cs | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index 8b3761b7efb..123fa9dc7e8 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this package are documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [10.8.0] - 2021-09-13 + +### Added + +### Fixed +- Fixed an incorrect direction transform from view to world space [1365187] + ## [10.7.0] - 2021-07-02 ### Added diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/TransformNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/TransformNode.cs index 96f3a28e501..9f6ef237446 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/TransformNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/TransformNode.cs @@ -187,7 +187,9 @@ public void GenerateNodeCode(ShaderStringBuilder sb, GenerationMode generationMo { if (conversion.to == CoordinateSpace.World) { - transformString = string.Format("mul(UNITY_MATRIX_I_V, $precision4({0}, 1)).xyz", inputValue); + transformString = string.Format(conversionType == ConversionType.Direction ? + "mul(UNITY_MATRIX_I_V, $precision4({0}, 0)).xyz" : + "mul(UNITY_MATRIX_I_V, $precision4({0}, 1)).xyz", inputValue); } else if (conversion.to == CoordinateSpace.Object) { From 05ca6eec9763b28ee44539fa7afa0647053719e4 Mon Sep 17 00:00:00 2001 From: Jesse Barker Date: Tue, 14 Sep 2021 08:25:57 -0700 Subject: [PATCH 2/2] Use "Unreleased" version tag in changelog --- com.unity.shadergraph/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index 123fa9dc7e8..6d4c83ec309 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this package are documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [10.8.0] - 2021-09-13 +## [Unreleased] - 2021-09-13 ### Added