NVlabs / nvdiffrast

Nvdiffrast - Modular Primitives for High-Performance Differentiable Rendering
Other
1.31k stars 139 forks source link

How to implement Transparency #65

Closed jameSssssss closed 2 years ago

jameSssssss commented 2 years ago

How to render a texture with transpareny? I have a texture with transpareny defined in 4th channel, but when i render it in nvdiffrast it don't blend the color accross depth.

s-laine commented 2 years ago

Nvdiffrast doesn't support automatic blending, but you can render the mesh layer by layer using depth peeling. You'll have to implement the blending yourself in PyTorch in this case. For reference, see the render_mesh function in nvdiffmodeling project.