diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-07-26 17:07:50 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-07-27 22:03:33 +0300 |
commit | 38af5b0501005d8ee84a59f027417bf6a31fcc5e (patch) | |
tree | 0856dd31787e59abe9300a8d4b3c6b37be3cfbc8 /intern/cycles/kernel/integrator/init_from_bake.h | |
parent | 69f2732a1391680d252c86365b2df62b084ceeb8 (diff) |
Cycles: switch Cycles triangle barycentric convention to match Embree/OptiX
Simplifies intersection code a little and slightly improves precision regarding
self intersection.
The parametric texture coordinate in shader nodes is still the same as before
for compatibility.
Diffstat (limited to 'intern/cycles/kernel/integrator/init_from_bake.h')
-rw-r--r-- | intern/cycles/kernel/integrator/init_from_bake.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/cycles/kernel/integrator/init_from_bake.h b/intern/cycles/kernel/integrator/init_from_bake.h index bf3f41b52b9..dd26215bcd2 100644 --- a/intern/cycles/kernel/integrator/init_from_bake.h +++ b/intern/cycles/kernel/integrator/init_from_bake.h @@ -155,6 +155,11 @@ ccl_device bool integrator_init_from_bake(KernelGlobals kg, 1.0f - u); } + /* Convert from Blender to Cycles/Embree/OptiX barycentric convention. */ + const float tmp = u; + u = v; + v = 1.0f - tmp - v; + /* Position and normal on triangle. */ const int object = kernel_data.bake.object_index; float3 P, Ng; |