forked from bartvdbraak/blender
Cycles: Don't perform re-intersection if ray distance is zero
It is possible that ray distance will be zero which would make intersection refinement return NaN as the refined position which would later lead to all sort of mathematical issues. Don't think there are ways to improve intersection accuracy for such rays so just return original intersection coordinate. This should fix T43475. TODO: Need to look into possible issues in Ashikhmin BSDF which might return zero-length reflected/transmitted ray?
This commit is contained in:
parent
cb2007906f
commit
3f5771475d
@ -309,6 +309,9 @@ ccl_device_inline float3 triangle_refine(KernelGlobals *kg,
|
||||
|
||||
#ifdef __INTERSECTION_REFINE__
|
||||
if(isect->object != OBJECT_NONE) {
|
||||
if(UNLIKELY(t == 0.0f)) {
|
||||
return P;
|
||||
}
|
||||
#ifdef __OBJECT_MOTION__
|
||||
Transform tfm = sd->ob_itfm;
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user