Skip to content

Commit

Permalink
better alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Leo-Smith committed Jan 13, 2024
1 parent c58b9d2 commit 56fe0a0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/base/geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void Geometry::_process_shape(

// emplace instance here since we need to know the opaque property
_accel.emplace_back(*mesh.resource, object_to_world, visible, false);
//(properties & Shape::property_flag_maybe_non_opaque) == 0u);
//(properties & Shape::property_flag_maybe_non_opaque) == 0u);

auto light_tag = 0u;
auto medium_tag = 0u;
Expand Down Expand Up @@ -201,14 +201,14 @@ Var<Hit> Geometry::trace_closest(const Var<Ray> &ray) const noexcept {
$if(it->shape().maybe_non_opaque() & it->shape().has_surface()) {
PolymorphicCall<Surface::Closure> call;
_pipeline.surfaces().dispatch(it->shape().surface_tag(), [&](auto surface) noexcept {
$if(surface->maybe_non_opaque()) {
if(surface->maybe_non_opaque()) {
// TODO: pass the correct time
surface->closure(call, *it, _pipeline.spectrum()->sample(.5f), -ray->direction(), 1.f, 0.f);
};
} else {
compute::unreachable();
}
});
auto u1 = xxhash32(as<uint3>(ray->origin()));
auto u2 = xxhash32(as<uint3>(ray->direction()));
auto u = xxhash32(make_uint2(u1, u2)) * 0x1p-32f;
auto u = xxhash32(make_uint4(hit.inst, hit.prim, compute::as<uint2>(hit.bary))) * 0x1p-32f;
call.execute([&](const Surface::Closure *closure) noexcept {
// apply opacity map
auto alpha_skip = def(false);
Expand Down Expand Up @@ -243,14 +243,14 @@ Var<bool> Geometry::trace_any(const Var<Ray> &ray) const noexcept {
$if(it->shape().maybe_non_opaque() & it->shape().has_surface()) {
PolymorphicCall<Surface::Closure> call;
_pipeline.surfaces().dispatch(it->shape().surface_tag(), [&](auto surface) noexcept {
$if(surface->maybe_non_opaque()) {
if(surface->maybe_non_opaque()) {
// TODO: pass the correct time
surface->closure(call, *it, _pipeline.spectrum()->sample(.5f), -ray->direction(), 1.f, 0.f);
};
} else {
compute::unreachable();
}
});
auto u1 = xxhash32(as<uint3>(ray->origin()));
auto u2 = xxhash32(as<uint3>(ray->direction()));
auto u = xxhash32(make_uint2(u1, u2)) * 0x1p-32f;
auto u = xxhash32(make_uint4(hit.inst, hit.prim, compute::as<uint2>(hit.bary))) * 0x1p-32f;
call.execute([&](const Surface::Closure *closure) noexcept {
// apply opacity map
auto alpha_skip = def(false);
Expand Down

0 comments on commit 56fe0a0

Please sign in to comment.