Fix Cycles OSL geometry node point cloud inconsistency

Update the OSL script for the "Geometry" node to follow the correct
Tangent code path when working with point clouds.

There should be no functional change for the end user since the correct
code path was already taken by accident.

Pull Request: https://projects.blender.org/blender/blender/pulls/113472
This commit is contained in:
Alaska
2023-10-11 21:05:41 +02:00
committed by Brecht Van Lommel
parent abe53e0cca
commit 4f5e684e24

View File

@@ -34,11 +34,13 @@ shader node_geometry(string bump_offset = "center",
point generated;
float IsCurve = 0;
float IsPoint = 0;
getattribute("geom:is_curve", IsCurve);
getattribute("geom:is_point", IsPoint);
/* create spherical tangent from generated coordinates if they're available,
* unless we're on a curve. */
if (!IsCurve && getattribute("geom:generated", generated)) {
* unless we're on a curve or point. */
if (!(IsCurve || IsPoint) && getattribute("geom:generated", generated)) {
normal data = normal(-(generated[1] - 0.5), (generated[0] - 0.5), 0.0);
vector T = transform("object", "world", data);
Tangent = cross(Normal, normalize(cross(T, Normal)));