File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ void Geometry::_alpha_skip(SurfaceCandidate &c) const noexcept {
167
167
auto ray = c.ray ();
168
168
auto bary = make_float3 (1 .f - hit.bary .x - hit.bary .y , hit.bary );
169
169
auto it = interaction (hit.inst , hit.prim , bary, -ray->direction ());
170
+ auto committed = def (false );
170
171
$if (it->shape ().maybe_non_opaque () & it->shape ().has_surface ()) {
171
172
auto u = xxhash32 (make_uint4 (hit.inst , hit.prim , compute::as<uint2>(hit.bary ))) * 0x1p-32f ;
172
173
$switch (it->shape ().surface_tag ()) {
@@ -176,20 +177,22 @@ void Geometry::_alpha_skip(SurfaceCandidate &c) const noexcept {
176
177
$case (i) {
177
178
// TODO: pass the correct swl and time
178
179
if (auto opacity = surface->evaluate_opacity (*it, _pipeline.spectrum ()->sample (.5f ), 0 .f )) {
179
- $if (u < *opacity) {
180
- c.commit ();
181
- };
180
+ committed = u <= *opacity;
182
181
} else {
183
- c. commit () ;
182
+ committed = true ;
184
183
}
185
184
};
186
- }
185
+ }
187
186
}
188
187
$default { compute::unreachable (); };
189
188
};
190
189
}
191
190
$else {
191
+ committed = true ;
192
+ };
193
+ $if (committed) {
192
194
c.commit ();
195
+ // $if (terminate_on_any) { c.terminate(); };
193
196
};
194
197
}
195
198
You can’t perform that action at this time.
0 commit comments