Skip to content

Commit

Permalink
Fix crop_offset for gpu_* modes
Browse files Browse the repository at this point in the history
  • Loading branch information
Speierers committed Aug 10, 2020
1 parent de15049 commit 450b419
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/mitsuba/render/imageblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class MTS_EXPORT_RENDER ImageBlock : public Object {
* \param pos
* Denotes the sample position in fractional pixel coordinates. It is
* not checked, and so must be valid. The block's offset is subtracted
* from the given position to obtain the
* from the given position to obtain the final pixel position.
*
* \param wavelengths
* Sample wavelengths in nanometers
Expand Down Expand Up @@ -126,7 +126,7 @@ class MTS_EXPORT_RENDER ImageBlock : public Object {
* \param pos
* Denotes the sample position in fractional pixel coordinates. It is
* not checked, and so must be valid. The block's offset is subtracted
* from the given position to obtain the
* from the given position to obtain the final pixel position.
*
* \param value
* Pointer to an array containing each channel of the sample values.
Expand Down
4 changes: 4 additions & 0 deletions src/librender/integrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,12 @@ MTS_VARIANT bool SamplingIntegrator<Float, Spectrum>::render(Scene *scene, Senso
film->reconstruction_filter(),
!has_aovs);
block->clear();
block->set_offset(sensor->film()->crop_offset());

Vector2f pos = Vector2f(Float(idx % uint32_t(film_size[0])),
Float(idx / uint32_t(film_size[0])));
pos += block->offset();

std::vector<Float> aovs(channels.size());

for (size_t i = 0; i < n_passes; i++)
Expand Down

0 comments on commit 450b419

Please sign in to comment.