diff options
author | Charlie Jolly <mistajolly@gmail.com> | 2021-07-26 13:00:58 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-08-23 10:20:41 +0300 |
commit | d97e586f58ba24e16f0df5dcfe73b5d505b889e9 (patch) | |
tree | 987ca5d8905565d0429c3e19b65ee3d99e6d33f2 /source/blender/nodes | |
parent | 690fa2ba86a05b3196a8bc4f78df47f3d5da9b51 (diff) |
Geometry Nodes: Fix vector math project bug
Implementation is incorrect compared to Cycles/Eevee.
Reported by @DrDubosc in comments of T88922.
Differential Revision: https://developer.blender.org/D12029
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/NOD_math_functions.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/nodes/NOD_math_functions.hh b/source/blender/nodes/NOD_math_functions.hh index 45de1816549..54608b4cfca 100644 --- a/source/blender/nodes/NOD_math_functions.hh +++ b/source/blender/nodes/NOD_math_functions.hh @@ -266,7 +266,7 @@ inline bool try_dispatch_float_math_fl3_fl3_to_fl3(const NodeVectorMathOperation return dispatch([](float3 a, float3 b) { return float3::cross_high_precision(a, b); }); case NODE_VECTOR_MATH_PROJECT: return dispatch([](float3 a, float3 b) { - float length_squared = float3::dot(a, b); + float length_squared = float3::dot(b, b); return (length_squared != 0.0) ? (float3::dot(a, b) / length_squared) * b : float3(0.0f); }); case NODE_VECTOR_MATH_REFLECT: |