Skip to content
Open
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
10 changes: 5 additions & 5 deletions src/render/integrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,13 @@ SamplingIntegrator<Float, Spectrum>::render(Scene *scene,

// Compute the position on the image plane
Vector2u pos;
pos.y() = idx / film_size[0];
pos.x() = dr::fnmadd(film_size[0], pos.y(), idx);
pos.y() = idx / dr::opaque<UInt32>(film_size[0]);
pos.x() = dr::fnmadd(dr::opaque<UInt32>(film_size[0]), pos.y(), idx);

if (film->sample_border())
pos -= film->rfilter()->border_size();
pos -= dr::opaque<Vector2u>(film->rfilter()->border_size());

pos += film->crop_offset();
pos += dr::opaque<Vector2u>(film->crop_offset());

// Scale factor that will be applied to ray differentials
ScalarFloat diff_scale_factor = dr::rsqrt((ScalarFloat) spp);
Expand Down Expand Up @@ -422,7 +422,7 @@ SamplingIntegrator<Float, Spectrum>::render_sample(const Scene *scene,
offset = -ScalarVector2f(film->crop_offset()) * scale;

Vector2f sample_pos = pos + sampler->next_2d(active),
adjusted_pos = dr::fmadd(sample_pos, scale, offset);
adjusted_pos = dr::fmadd(sample_pos, dr::opaque<Vector2f>(scale), dr::opaque<Vector2f>(offset));

Point2f aperture_sample(.5f);
if (sensor->needs_aperture_sample())
Expand Down
6 changes: 3 additions & 3 deletions src/sensors/perspective.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class PerspectiveCamera final : public ProjectiveCamera<Float, Spectrum> {
ray.wavelengths = wavelengths;

Vector2f scaled_principal_point_offset =
m_film->size() * m_principal_point_offset / m_film->crop_size();
dr::opaque<Vector2f>(m_film->size()) * m_principal_point_offset / dr::opaque<Vector2f>(m_film->crop_size());

// Compute the sample position on the near plane (local camera space).
Point3f near_p = m_sample_to_camera *
Expand Down Expand Up @@ -247,7 +247,7 @@ class PerspectiveCamera final : public ProjectiveCamera<Float, Spectrum> {
ray.wavelengths = wavelengths;

Vector2f scaled_principal_point_offset =
m_film->size() * m_principal_point_offset / m_film->crop_size();
dr::opaque<Vector2f>(m_film->size()) * m_principal_point_offset / dr::opaque<Vector2f>(m_film->crop_size());

// Compute the sample position on the near plane (local camera space).
Point3f near_p = m_sample_to_camera *
Expand Down Expand Up @@ -291,7 +291,7 @@ class PerspectiveCamera final : public ProjectiveCamera<Float, Spectrum> {
return { ds, dr::zeros<Spectrum>() };

Vector2f scaled_principal_point_offset =
m_film->size() * m_principal_point_offset / m_film->crop_size();
dr::opaque<Vector2f>(m_film->size()) * m_principal_point_offset / dr::opaque<Vector2f>(m_film->crop_size());

Point3f screen_sample = m_camera_to_sample * ref_p;
ds.uv = Point2f(screen_sample.x() - scaled_principal_point_offset.x(),
Expand Down