diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index 8b3761b7efb..6d4c83ec309 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). +## [Unreleased] - 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) {