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.
This commit is contained in:
Brecht Van Lommel 2022-11-09 19:35:54 +01:00
parent 1fbb1d8cf6
commit 8232cf5287
Notes: blender-bot 2023-02-14 08:07:50 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
Referenced by issue #101669, Regression: Normal baking strange artifacts in texture bake
1 changed files with 7 additions and 0 deletions

View File

@ -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;