mitsuba-renderer/mitsuba

Missing Channel Names when using AOV Integrator

Closed this issue · 2 comments

When using the AOV integrator, the specified channel names are not stored in the Bitmap produced in the rendering process.
Using the follwoing integrator:

<integrator type="aov">
		<string name="aovs" value="albedo:albedo,depth:depth,geo:geo_normal,shade:sh_normal,pid:prim_index"/>
		<integrator type="path" name="image"/>
</integrator>

should result in the channel names also being used in the Bitmap after using the mitsuba.Bitmap() function on the rendered image according to the documentation provided in https://mitsuba.readthedocs.io/en/stable/src/how_to_guides/image_io_and_manipulation.html#Multichannel-images and https://mitsuba.readthedocs.io/en/stable/src/generated/plugins_integrators.html#arbitrary-output-variables-integrator-aov, however the result is the following:

Bitmap[
  pixel_format = multichannel,
  component_format = float32,
  size = [1024, 1024],
  srgb_gamma = 0,
  struct = Struct<56>[
    float32 ch0; // @0, premultiplied alpha
    float32 ch1; // @4, premultiplied alpha
    float32 ch2; // @8, premultiplied alpha
    float32 ch3; // @12, premultiplied alpha
    float32 ch4; // @16, premultiplied alpha
    float32 ch5; // @20, premultiplied alpha
    float32 ch6; // @24, premultiplied alpha
    float32 ch7; // @28, premultiplied alpha
    float32 ch8; // @32, premultiplied alpha
    float32 ch9; // @36, premultiplied alpha
    float32 ch10; // @40, premultiplied alpha
    float32 ch11; // @44, premultiplied alpha
    float32 ch12; // @48, premultiplied alpha
    float32 ch13; // @52, premultiplied alpha
  ],
  data = [ 56 MiB of image data ]
]

which made me wonder why names can be specified in the AOV in the first place. Or maybe i'm doing something wrong. Thanks in advance.

Hi @hel-har ,

Based on the documentation you've linked, I think you're using Mitsuba 3 and the relevant place to raise an issue is here. This is the issue tracker for an earlier version of Mitsuba.

Regardless, the returned image is a tensor and so that additional metadata has been lost by the time you attempt to call mi.Bitmap. Instead, what you can do is after you've rendered your scene, you can fetch the bitmap information from the associated film. e.g. scene.sensors()[0].film().bitmap() which should contain the channel names.

Oh sorry, my bad. Thank your for your advice.