Skip to content

Commit

Permalink
workaround dx
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Leo-Smith committed Jan 14, 2024
1 parent 52dd56f commit 22011fb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/base/geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ void Geometry::_alpha_skip(SurfaceCandidate &c) const noexcept {
auto ray = c.ray();
auto bary = make_float3(1.f - hit.bary.x - hit.bary.y, hit.bary);
auto it = interaction(hit.inst, hit.prim, bary, -ray->direction());
auto committed = def(false);
$if(it->shape().maybe_non_opaque() & it->shape().has_surface()) {
auto u = xxhash32(make_uint4(hit.inst, hit.prim, compute::as<uint2>(hit.bary))) * 0x1p-32f;
$switch(it->shape().surface_tag()) {
Expand All @@ -176,20 +177,22 @@ void Geometry::_alpha_skip(SurfaceCandidate &c) const noexcept {
$case(i) {
// TODO: pass the correct swl and time
if (auto opacity = surface->evaluate_opacity(*it, _pipeline.spectrum()->sample(.5f), 0.f)) {
$if(u < *opacity) {
c.commit();
};
committed = u <= *opacity;
} else {
c.commit();
committed = true;
}
};
}
}
}
$default { compute::unreachable(); };
};
}
$else {
committed = true;
};
$if(committed) {
c.commit();
// $if (terminate_on_any) { c.terminate(); };
};
}

Expand Down

0 comments on commit 22011fb

Please sign in to comment.