Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/integrators/mega_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class MegakernelPathTracingInstance final : public ProgressiveIntegrator::Instan
auto swl = spectrum->sample(spectrum->node()->is_fixed() ? 0.f : sampler()->generate_1d());
SampledSpectrum beta{swl.dimension(), camera_weight};
SampledSpectrum Li{swl.dimension()};
Float eta_scale = def(1.f);

auto ray = camera_ray;
auto pdf_bsdf = def(1e16f);
Expand Down Expand Up @@ -109,7 +110,6 @@ class MegakernelPathTracingInstance final : public ProgressiveIntegrator::Instan

// evaluate material
auto surface_tag = it->shape().surface_tag();
auto eta_scale = def(1.f);

$outline {
PolymorphicCall<Surface::Closure> call;
Expand Down Expand Up @@ -137,8 +137,8 @@ class MegakernelPathTracingInstance final : public ProgressiveIntegrator::Instan
// apply eta scale
auto eta = closure->eta().value_or(1.f);
$switch(surface_sample.event) {
$case(Surface::event_enter) { eta_scale = sqr(eta); };
$case(Surface::event_exit) { eta_scale = sqr(1.f / eta); };
$case(Surface::event_enter) { eta_scale *= sqr(eta); };
$case(Surface::event_exit) { eta_scale *= sqr(1.f / eta); };
};
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/util/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Frame::Frame() noexcept
_n{make_float3(0.f, 0.f, 1.f)} {}

Frame Frame::make(Expr<float3> n) noexcept {
auto sgn = sign(n.z);
auto sgn = copysign(1.f, n.z);
auto a = -1.f / (sgn + n.z);
auto b = n.x * n.y * a;
auto s = make_float3(1.f + sgn * sqr(n.x) * a, sgn * b, -sgn * n.x);
Expand Down
Loading