DLR-RM / BlenderProc

A procedural Blender pipeline for photorealistic training image generation
GNU General Public License v3.0
2.73k stars 443 forks source link

Transparent materials depth render problem based 3D front dataset #1135

Open Liujunru1991 opened 1 month ago

Liujunru1991 commented 1 month ago

Describe the issue

Hello, thanks for your important work! Recently I was using the 3D Front data set to render a synthetic data set and blenderproc to render the 3D front data set. I found that the depth rendering of transparent materials such as window glass, chandeliers, table lamps, etc. was abnormal. How can I solve this problem? Looking forward to your quick reply, thank you!

Minimal code example

examples/datasets/front_3d_with_improved_mat/main.py

Files required to run the code

3D Front dataset

Expected behavior

NA

BlenderProc version

v2.6.2

cornerfarmer commented 1 month ago

Hey @Liujunru1991,

you can specify which transparent textures are handled as fully transparent and which are fully opaque via:

bpy.context.scene.view_layers["ViewLayer"].pass_alpha_threshold = 0.5

See https://docs.blender.org/api/current/bpy.types.ViewLayer.html#bpy.types.ViewLayer.pass_alpha_threshold