mmp / pbrt-v4

Source code to pbrt, the ray tracer described in the forthcoming 4th edition of the "Physically Based Rendering: From Theory to Implementation" book.
https://pbrt.org
Apache License 2.0
2.89k stars 454 forks source link

Save Alpha Channel with Transparent Backgound #457

Closed Gaozhongpai closed 6 days ago

Gaozhongpai commented 2 weeks ago

Can we save the alpha channel (i.e., RGBA) with a transparent background?

mmp commented 2 weeks ago

There's no current functionality to do that. It probably wouldn't be too hard if you only care about alpha for rays that hit/don't hit geometry. If you want partial alpha for volumetrics, you'd have to update the VolPathIntegrator to compute the full transmittance for camera rays; currently it doesn't keep ray-marching to compute transmittance (or check for geometry behind the volumetric) if there's a scattering event inside the volumetric.