forked from bartvdbraak/blender
Fix T45778: Objects scaled to 0 cause black artifacts with Static BVH
The issue was caused by some numeric instability in triangle intersection which was visible on avx2 CPUs and GPUs (at least sm_20 here) but maybe some others too. Committing rather a workaround for now to be safe for the release, still need some investigation. From tests with grass field from Gooseberry project didn't see measurable slowdown.
This commit is contained in:
parent
3633499f4e
commit
2fb639deed
@ -173,6 +173,9 @@ ccl_device_inline bool triangle_intersect(KernelGlobals *kg,
|
|||||||
if(kernel_tex_fetch(__prim_visibility, triAddr) & visibility)
|
if(kernel_tex_fetch(__prim_visibility, triAddr) & visibility)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
if(len_squared(cross(tri_a, tri_b)) < 1e-14f) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
/* Normalize U, V, W, and T. */
|
/* Normalize U, V, W, and T. */
|
||||||
const float inv_det = 1.0f / det;
|
const float inv_det = 1.0f / det;
|
||||||
isect->prim = triAddr;
|
isect->prim = triAddr;
|
||||||
|
Loading…
Reference in New Issue
Block a user