Fix Cycles Embree test failures with shadow catcher
Ref T73778
This commit is contained in:
@@ -589,7 +589,7 @@ void BVHEmbree::add_instance(Object *ob, int i)
|
|||||||
pack.prim_tri_index.push_back_slow(-1);
|
pack.prim_tri_index.push_back_slow(-1);
|
||||||
|
|
||||||
rtcSetGeometryUserData(geom_id, (void *)instance_bvh->scene);
|
rtcSetGeometryUserData(geom_id, (void *)instance_bvh->scene);
|
||||||
rtcSetGeometryMask(geom_id, ob->visibility);
|
rtcSetGeometryMask(geom_id, ob->visibility_for_tracing());
|
||||||
|
|
||||||
rtcCommitGeometry(geom_id);
|
rtcCommitGeometry(geom_id);
|
||||||
rtcAttachGeometryByID(scene, geom_id, i * 2);
|
rtcAttachGeometryByID(scene, geom_id, i * 2);
|
||||||
@@ -653,7 +653,7 @@ void BVHEmbree::add_triangles(const Object *ob, const Mesh *mesh, int i)
|
|||||||
rtcSetGeometryUserData(geom_id, (void *)prim_offset);
|
rtcSetGeometryUserData(geom_id, (void *)prim_offset);
|
||||||
rtcSetGeometryIntersectFilterFunction(geom_id, rtc_filter_func);
|
rtcSetGeometryIntersectFilterFunction(geom_id, rtc_filter_func);
|
||||||
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func);
|
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func);
|
||||||
rtcSetGeometryMask(geom_id, ob->visibility);
|
rtcSetGeometryMask(geom_id, ob->visibility_for_tracing());
|
||||||
|
|
||||||
rtcCommitGeometry(geom_id);
|
rtcCommitGeometry(geom_id);
|
||||||
rtcAttachGeometryByID(scene, geom_id, i * 2);
|
rtcAttachGeometryByID(scene, geom_id, i * 2);
|
||||||
@@ -841,7 +841,7 @@ void BVHEmbree::add_curves(const Object *ob, const Hair *hair, int i)
|
|||||||
rtcSetGeometryUserData(geom_id, (void *)prim_offset);
|
rtcSetGeometryUserData(geom_id, (void *)prim_offset);
|
||||||
rtcSetGeometryIntersectFilterFunction(geom_id, rtc_filter_func);
|
rtcSetGeometryIntersectFilterFunction(geom_id, rtc_filter_func);
|
||||||
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func);
|
rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func);
|
||||||
rtcSetGeometryMask(geom_id, ob->visibility);
|
rtcSetGeometryMask(geom_id, ob->visibility_for_tracing());
|
||||||
|
|
||||||
rtcCommitGeometry(geom_id);
|
rtcCommitGeometry(geom_id);
|
||||||
rtcAttachGeometryByID(scene, geom_id, i * 2 + 1);
|
rtcAttachGeometryByID(scene, geom_id, i * 2 + 1);
|
||||||
|
@@ -439,7 +439,7 @@ ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals *kg,
|
|||||||
ctx.num_hits = 0;
|
ctx.num_hits = 0;
|
||||||
IntersectContext rtc_ctx(&ctx);
|
IntersectContext rtc_ctx(&ctx);
|
||||||
RTCRay rtc_ray;
|
RTCRay rtc_ray;
|
||||||
kernel_embree_setup_ray(*ray, rtc_ray, PATH_RAY_SHADOW);
|
kernel_embree_setup_ray(*ray, rtc_ray, visibility);
|
||||||
rtcOccluded1(kernel_data.bvh.scene, &rtc_ctx.context, &rtc_ray);
|
rtcOccluded1(kernel_data.bvh.scene, &rtc_ctx.context, &rtc_ray);
|
||||||
|
|
||||||
if (ctx.num_hits > max_hits) {
|
if (ctx.num_hits > max_hits) {
|
||||||
|
Reference in New Issue
Block a user