Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 bug report] Apparent medium scattering difference between gpu_spectral and scalar_spectral renders. #581

Open
einburger opened this issue Mar 24, 2022 · 1 comment

Comments

@einburger
Copy link

Summary

The gpu_spectral variant's output seems to lack the medium scattering effects that the same scene rendered with the scalar_spectral variant has.

System configuration

  • Platform: CentOS 7
  • Compiler: GCC 9.3.1
  • Mitsuba version: 2.2.1
  • Python version: 3.6.8
  • Compiled variants:
    • scalar_spectral
    • gpu_spectral

Description

I created a basic scene with three shapes. Two of the shapes are boxes with a diffuse bsdf and and the last shape is a box acting as an area emitter that uses a bitmap for spatially varying radiance values. The sensor is a perspective lens that has a homogeneous medium attached to it for a smokey environment effect. When using the scalar_spectral variant the scene looks as one would expect (lots of scattering due to the medium) but when using the gpu_spectral variant the scene lacks this scattering.

Things tried (but didn't change the difference):

  • Specifying different sample counts, samples per pass, and sampler types
  • Swapped the volpath integrator for the volpathmis integrator
  • Removing the emissive texture and using a single radiance value for the emitter

Curiosities:

  • When I use an area emitter with a bitmap mitsuba generates warnings about not finding a sensor or integrator but when I remove the bitmap and just rely on a value for the radiance, the warnings disappear
  • The profiler output shows the gpu variant spends a lot less time on medium sampling than the scalar variant (0.35% vs. 10.95%)

With the scalar_spectral variant:
scalar_spectral

With the gpu_spectral variant:
gpu_spectral

With the scalar_spectral variant with no emissive "texture" (just a radiance value):
scalar_spectral_no_texture

With the gpu_spectral variant with no emissive "texture" (just a radiance value):
gpu_spectral_no_texture

Here's my xml scene file:

<scene version="2.1.0">
	<default name="resx" value="512"/>
	<default name="resy" value="512"/>
	<default name="spp" value="64"/>

	<integrator type="volpath" id="integrator">
		<integer name="samples_per_pass" value="4"/>
		<integer name="max_depth" value="8"/>
	</integrator>
	<sensor type="perspective" id="sensor">
		<float name="near_clip" value="0.100000"/>
		<float name="far_clip" value="10000.000000"/>
		<transform name="to_world">
			<rotate x="1" angle="118.66886777196044"/>
			<rotate y="1" angle="4.4630245556769734e-07"/>
			<rotate z="1" angle="165.76382806152043"/>
			<translate value="-1.509772 -6.421305 0.993045"/>
		</transform>
		<film type="hdrfilm">
			<rfilter type="lanczos"/>
			<integer name="width" value="$resx"/>
			<integer name="height" value="$resy"/>
		</film>
		<sampler type="independent">
			<integer name="sample_count" value="$spp"/>
		</sampler>
		<string name="focal_length" value="10.0mm"/>
		<medium type="homogeneous">
			<integer name="scale" value="1"/>
			<spectrum value="0.200000" name="sigma_t"/>
			<spectrum value="0.700000" name="albedo"/>
			<phase type="isotropic"/>
		</medium>
	</sensor>

	<shape type="obj" id="shape1">
		<string name="filename" value="meshes/LightBox.obj"/>
		<transform name="to_world">
			<matrix value="1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000"/>
		</transform>
		<bsdf type="diffuse"/>
		<emitter type="area">
			<texture type="bitmap" name="radiance">
				<string name="filename" value="textures/lbox_tex.pfm"/>
			</texture>
		</emitter>
	</shape>

	<shape type="obj" id="shape2">
		<string name="filename" value="meshes/LBox.obj"/>
		<transform name="to_world">
			<matrix value="1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000"/>
		</transform>
		<bsdf type="diffuse">
			<spectrum value="0.500000" name="reflectance"/>
		</bsdf>
	</shape>
	<shape type="obj" id="shape3">
		<string name="filename" value="meshes/RBox.obj"/>
		<transform name="to_world">
			<matrix value="1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000"/>
		</transform>
		<bsdf type="diffuse">
			<spectrum value="0.300000" name="reflectance"/>
		</bsdf>
	</shape>
</scene>

Steps to reproduce

  1. Set up a basic spectral scene
  2. Attach a medium to the scene's sensor
  3. Give one shape in the scene an area emitter with a bitmap texture for its radiance
  4. Render the scene with scalar_spectral and gpu_spectral
@Speierers
Copy link
Member

Hi @einburger ,

If I remember correctly there are currently some known issues regarding volume rendering with gpu_* variants. Unfortunately we are focussing on the release of the next version of Mitsuba, which will better support volume rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants