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:
authorBrecht Van Lommel <brecht@blender.org>2022-11-09 21:35:54 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-11-09 21:36:30 +0300
commit8232cf5287445d21b7d6effb3f0e1ffb6df09adf (patch)
tree0acb3e4f2cc411cf75a9c8bedff6fb715aa25a7e
parent1fbb1d8cf6ea9badd3361e4c533625f569d14734 (diff)
Fix T101669: Cycles artifacts in bump map baking
After barycentric convention changes, the differentials used for bump mapping were wrong leading to artifacts with long thin triangles.
-rw-r--r--intern/cycles/kernel/integrator/init_from_bake.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/cycles/kernel/integrator/init_from_bake.h b/intern/cycles/kernel/integrator/init_from_bake.h
index 667ba949760..cc3fbe3fe39 100644
--- a/intern/cycles/kernel/integrator/init_from_bake.h
+++ b/intern/cycles/kernel/integrator/init_from_bake.h
@@ -156,6 +156,13 @@ ccl_device bool integrator_init_from_bake(KernelGlobals kg,
u = v;
v = 1.0f - tmp - v;
+ const float tmpdx = dudx;
+ const float tmpdy = dudy;
+ dudx = dvdx;
+ dudy = dvdy;
+ dvdx = -tmpdx - dvdx;
+ dvdy = -tmpdy - dvdy;
+
/* Position and normal on triangle. */
const int object = kernel_data.bake.object_index;
float3 P, Ng;