Lachei / VulkanPBRT

Vulkan physically based raytracer including denoising
MIT License
28 stars 11 forks source link

External exr buffer images #15

Closed Lachei closed 2 years ago

Lachei commented 2 years ago

Adds the ability to use external .exr images and denoises them as well as adds the ability to export renderings. The following command line arguments have been added: --dephts : filename format of external depth images --exportDepth: filename format of exported depth images --positions: filename format of external positions (only depths or positions should be specified. If both, depth is taken) --exportPosition: filename format of exported position images --normals: filename format of external normal images --exportNormal: filename format of exported normal images --albedos: filename format of external albedo images --exportAlbedo: filename format of exported albedo images --materials: filename format of external material images (currently not used) --exportMaterial: filename format of exported material images (are exported!) --matrices: filename format of external camera matrices corresponding to external dataset (currently only dataset of BMFR matrices can be read) --exportMatrices: filename format of exported camera matrices (currently not used, have not yet decided on file format to store matrices) Format means that the filename can be a c-style format string with a single %d where the frame number will be inserted (eg: "folder/depth_%d.exr").

Further an option for high quality path tracing has been added as the currently used rgba8 buffer (8 bit per channel) fails to get rid of all noise. -hq or --highqual enables the 4 component float resulting image.

For review check compilation, your scenes and high quality mode (and maybe export).

Lachei commented 2 years ago

Yes it would! Pushed a commit with the change

sven-luepke commented 2 years ago

Rendering works flawlessly, also with the 3D-FRONT scenes.

However when checking export options I noticed the following things:

Lachei commented 2 years ago

when only exportIllumination is used, the exported images contain the final image instead of just the illumination

Currently illumination is meant to be the final image. The illumination you refer to is i guess the illumination with demodulated first hit albedo, which currently can not be exported...

I will check the faulty exported images tomorrow. However last time i checked the PR on my machine the export worked...

Lachei commented 2 years ago

Can not confirm the problems with the export on my machine (Linux Ubuntu).

Positions doesn't work yet as the matrix exporting was not yet implemented (did not finalize the matrix layout for exporting). This will be added on friday.

With what program did you look at the depth image? The depth is stored in the Y component of the image, not all viewers support view of this channel...

Note, that if both depth and position export path is given only position is exported. I thought one does not want to export both at the same time. But thinking about it now i think i will change this also on friday so both will be exported in such a scenario.

sven-luepke commented 2 years ago

With what program did you look at the depth image? The depth is stored in the Y component of the image, not all viewers support view of this channel...

Renderdoc

Lachei commented 2 years ago

Renderdoc

Ah ok. Render doc does not load the y channel if available. If you try eg. Blender, you can see the depth(you might have to decrease the lighting of the image to get a good view of it). Changes are now made to the Gbuffer exporter to properly export only some of the gbuffer as well as the depth images.