Skip to content

Commit f24cb9c

Browse files
committed
Add shadow point to all shapes
1 parent 8ebfdbb commit f24cb9c

File tree

9 files changed

+9
-0
lines changed

9 files changed

+9
-0
lines changed

src/shapes/bsplinecurve.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,7 @@ class BSplineCurve final : public Shape<Float, Spectrum> {
10061006
si.prim_index = pi.prim_index;
10071007
si.shape = this;
10081008
si.instance = nullptr;
1009+
si.p_shadow = si.p;
10091010

10101011
return si;
10111012
}

src/shapes/cylinder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ class Cylinder final : public Shape<Float, Spectrum> {
758758
si.prim_index = pi.prim_index;
759759
si.shape = this;
760760
si.instance = nullptr;
761+
si.p_shadow = si.p;
761762

762763
return si;
763764
}

src/shapes/disk.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ class Disk final : public Shape<Float, Spectrum> {
513513
si.prim_index = pi.prim_index;
514514
si.shape = this;
515515
si.instance = nullptr;
516+
si.p_shadow = si.p;
516517

517518
return si;
518519
}

src/shapes/ellipsoids.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ class Ellipsoids final : public Shape<Float, Spectrum> {
391391
si.prim_index = pi.prim_index;
392392
si.shape = this;
393393
si.instance = nullptr;
394+
si.p_shadow = si.p;
394395

395396
return si;
396397
}

src/shapes/ellipsoidsmesh.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ class EllipsoidsMesh final : public Mesh<Float, Spectrum> {
309309

310310
// Divide by the number of faces per Gaussians
311311
si.prim_index /= (uint32_t) m_shell_faces.size();
312+
si.p_shadow = si.p;
312313

313314
return si;
314315
}

src/shapes/instance.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ class Instance final: public Shape<Float, Spectrum> {
190190

191191
// Hit point `si.p` is only attached to the surface motion
192192
si.p = to_world * si.p;
193+
si.p_shadow = to_world * si.p_shadow;
193194
si.n = dr::normalize(dr::detach(to_world) * si.n);
194195
if (likely(has_flag(ray_flags, RayFlags::ShadingFrame)))
195196
si.sh_frame.n = dr::normalize(dr::detach(to_world) * si.sh_frame.n);

src/shapes/linearcurve.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ class LinearCurve final : public Shape<Float, Spectrum> {
364364
si.prim_index = pi.prim_index;
365365
si.shape = this;
366366
si.instance = nullptr;
367+
si.p_shadow = si.p;
367368

368369
return si;
369370
}

src/shapes/sdfgrid.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ class SDFGrid final : public Shape<Float, Spectrum> {
451451
si.prim_index = pi.prim_index;
452452
si.shape = this;
453453
si.instance = nullptr;
454+
si.p_shadow = si.p;
454455

455456
return si;
456457
}

src/shapes/sphere.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,7 @@ class Sphere final : public Shape<Float, Spectrum> {
735735
si.prim_index = pi.prim_index;
736736
si.shape = this;
737737
si.instance = nullptr;
738+
si.p_shadow = si.p;
738739

739740
return si;
740741
}

0 commit comments

Comments
 (0)