1a40efbdedef3fbfeaa776f7e1ab37ccbc9d0421
Turns out that with `-fassociative-math`, GCC turns `(1.0f - cos_NH2) + alpha2 * cos_NH2` into `cos_NH2 * (alpha2 - 1.0f) + 1.0f`. Not sure why since the operation count is the same, but if alpha2 is very small, `alpha2 - 1.0f` will be exactly -1.0f, which then causes issues. Luckily, having one_minus_cos_NH2 as its own variable appears to be enough to make GCC keep the original formulation. Just to be safe, I've also used one_minus_cos_NH2 in the other branch to hopefully reduce the chance of it being folded in again. Also turns a division into a reciprocal, which is in theory slightly faster. Pull Request: https://projects.blender.org/blender/blender/pulls/130469
…
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%
