Closed jywu511 closed 1 year ago
Hi @jywu511 - When you say "virtual domain," are you referring to diffuse shading, which also appears in the GUI alignment window? If so, you can save these frames by making a few edits to RenderingModule.cpp and RenderingModule.h:
1.) Add "RenderFlags::DIFFUSE" to the flags passed to the context->updateRenderFlags function in the class constructor. This will tell the renderer to render diffuse frames. 2.) Allocate host memory using malloc. This memory will store the rendered frame before it is saved to an image file. The diffuse images are 8-bit with four color channels. 3.) Looking to the for loop in the launch function, copy the data from the device to the host using cudaMemcpy. 4.) Write the data to an image file using stbi_write_png.
If you follow the code, you will see where each step occurs for the other image types. You can insert these functions for the diffuse images at the same lines while using the correct number of bits and color channels for the diffuse image type.
@tbobrow1 Thanks!
No problem! I will close the issue for now - but let me know if you have any trouble with implementing it.
Thank you very much for sharing your work openly. During the rendering process, this project can output information such as image depth and normals. I would like to simultaneously output corresponding images for the virtual domain. Could you please advise on how to achieve this? Thank you very much.
Best regards