8bc9f174d3ec2b22823bef14010fb6fc937aff26
osl_transform_triple(), osl_transform_dvmdv() and so on are supposed to apply the given transform in the context of OSL's auto-differentiation system. Therefore, the given input is a dual vector, containing both the value as v[0] and its derivatives w.r.t. X and Y in v[1] and v[2]. However, the existing code treats these as a simple list of vectors, applying the same operation to all three instead of propagating the derivatives. On top of that, it also treated the given matrix input as if there were three of them, which isn't the case. Therefore, this commit replaces the implementation to do the right thing. The Vector and Normal case are straightforward since the operation is linear, so applying the same operation to all three vectors works. The Point case is a bit more complicated, but not too bad when written out. This bug mostly became apparent when using Object or Camera texture coordinates with a Bump node, since that node uses OSL differentials and Object/Camera coordinates are implemented using transform(). I'm pretty sure that all the other builtin functions (e.g. sin) at the bottom of services_gpu.h have the same problem, but one thing at a time... Pull Request: https://projects.blender.org/blender/blender/pulls/138045
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
