Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-09-05 19:31:39 +0300
committerHans Goudey <h.goudey@me.com>2022-09-05 19:31:39 +0300
commit4380e1f9006f8487e12af6601142c81633f0f476 (patch)
treec3792de5d298ea04432681db56a15b04c89cbe17 /intern/cycles/kernel/light/light.h
parent456177d8be9ea28d1c5565fbe538435095f5b503 (diff)
parent63cfc8f9f6d623f33b50c5c07976af2b22845713 (diff)
Merge branch 'master' into refactor-mesh-remove-pointersrefactor-mesh-remove-pointers
Diffstat (limited to 'intern/cycles/kernel/light/light.h')
-rw-r--r--intern/cycles/kernel/light/light.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/intern/cycles/kernel/light/light.h b/intern/cycles/kernel/light/light.h
index 85478cd09c5..12a6f21b58d 100644
--- a/intern/cycles/kernel/light/light.h
+++ b/intern/cycles/kernel/light/light.h
@@ -200,8 +200,12 @@ ccl_device_inline bool light_sample(KernelGlobals kg,
inplane = ls->P - inplane;
}
- ls->u = dot(inplane, axisu) * (1.0f / dot(axisu, axisu)) + 0.5f;
- ls->v = dot(inplane, axisv) * (1.0f / dot(axisv, axisv)) + 0.5f;
+ const float light_u = dot(inplane, axisu) * (1.0f / dot(axisu, axisu));
+ const float light_v = dot(inplane, axisv) * (1.0f / dot(axisv, axisv));
+
+ /* NOTE: Return barycentric coordinates in the same notation as Embree and OptiX. */
+ ls->u = light_v + 0.5f;
+ ls->v = -light_u - light_v;
ls->Ng = Ng;
ls->D = normalize_len(ls->P - P, &ls->t);