Skip to content

Commit 5b85107

Browse files
committed
fixes
1 parent 3e24117 commit 5b85107

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

include/mitsuba/render/interaction.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ struct Interaction {
169169
Point3f offset_p(const Vector3f &d) const {
170170
Float mag = (1.f + dr::max(dr::abs(p))) * math::RayEpsilon<Float>;
171171
mag = dr::detach(dr::mulsign(mag, dr::dot(n, d)));
172-
return dr::fmadd(mag, dr::detach(n), p + ray_offset);
172+
return dr::fmadd(mag, dr::detach(n), p + dr::detach(ray_offset));
173173
}
174174
};
175175

@@ -759,7 +759,9 @@ std::ostream &operator<<(std::ostream &os, const Interaction<Float, Spectrum> &i
759759
<< " t = " << it.t << "," << std::endl
760760
<< " time = " << it.time << "," << std::endl
761761
<< " wavelengths = " << it.wavelengths << "," << std::endl
762-
<< " p = " << string::indent(it.p, 6) << std::endl
762+
<< " p = " << string::indent(it.p, 6) << "," << std::endl
763+
<< " ray_offset = " << string::indent(it.ray_offset, 15) << "," << std::endl
764+
<< " n = " << string::indent(it.n, 6) << std::endl
763765
<< "]";
764766
}
765767
return os;

src/render/mesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ Mesh<Float, Spectrum>::compute_surface_interaction(const Ray3f &ray,
15611561
dot2 = dr::maximum(dr::dot(tmp2, n2), 0.f);
15621562
si.ray_offset =
15631563
m_ray_offset_scale *
1564-
dr::fmadd(b0, dot0 * n0, dr::fmadd(b1, dot1 * n1, b2 * dot2 * n2));
1564+
dr::detach(dr::fmadd(b0, dot0 * n0, dr::fmadd(b1, dot1 * n1, b2 * dot2 * n2)));
15651565
}
15661566

15671567
if (m_flip_normals) {

src/render/python/interaction_v.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ MI_PY_EXPORT(Interaction) {
3131
.def("zero_", &Interaction3f::zero_, D(Interaction, zero))
3232
.def_repr(Interaction3f);
3333

34-
MI_PY_DRJIT_STRUCT(it, Interaction3f, t, time, wavelengths, p, n)
34+
MI_PY_DRJIT_STRUCT(it, Interaction3f, t, time, wavelengths, p, ray_offset, n)
3535
}
3636

3737
MI_PY_EXPORT(SurfaceInteraction) {
@@ -92,7 +92,7 @@ MI_PY_EXPORT(SurfaceInteraction) {
9292
D(SurfaceInteraction, has_n_partials))
9393
.def_repr(SurfaceInteraction3f);
9494

95-
MI_PY_DRJIT_STRUCT(si, SurfaceInteraction3f, t, time, wavelengths, p, n,
95+
MI_PY_DRJIT_STRUCT(si, SurfaceInteraction3f, t, time, wavelengths, p, ray_offset, n,
9696
shape, uv, sh_frame, dp_du, dp_dv, dn_du, dn_dv, duv_dx,
9797
duv_dy, wi, prim_index, instance)
9898
}
@@ -119,7 +119,7 @@ MI_PY_EXPORT(MediumInteraction) {
119119
.def("to_local", &MediumInteraction3f::to_local, "v"_a, D(MediumInteraction, to_local))
120120
.def_repr(MediumInteraction3f);
121121

122-
MI_PY_DRJIT_STRUCT(mi, MediumInteraction3f, t, time, wavelengths, p, n,
122+
MI_PY_DRJIT_STRUCT(mi, MediumInteraction3f, t, time, wavelengths, p, ray_offset, n,
123123
medium, sh_frame, wi, sigma_s, sigma_n, sigma_t,
124124
combined_extinction, mint)
125125
}

0 commit comments

Comments
 (0)