Fix #117771: Incorrect Cycles texture position on emissive triangles

Pull Request: https://projects.blender.org/blender/blender/pulls/117801
This commit is contained in:
Alaska
2024-02-05 13:56:18 +01:00
committed by Brecht Van Lommel
parent 6827400305
commit a3183fb95f

View File

@@ -237,7 +237,7 @@ ccl_device_forceinline bool triangle_light_sample(KernelGlobals kg,
}
const float t = 1.0f - u - v;
ls->P = u * V[0] + v * V[1] + t * V[2];
ls->P = t * V[0] + u * V[1] + v * V[2];
/* compute incoming direction, distance and pdf */
ls->D = normalize_len(ls->P - P, &ls->t);
ls->pdf = triangle_light_pdf_area_sampling(ls->Ng, -ls->D, ls->t) / area;