DLR-RM / BlenderProc

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

[FEATURE]: turn off the Shading mechanism #570

Closed xubin1994 closed 2 years ago

xubin1994 commented 2 years ago

can we use the BlenderProc to turn off the Shading mechanism? In this way, the real images are directly output as textures to the material. we can ensure that the imported image textures will not be disturbed by lighting so that the network can extract the real image’s features.

cornerfarmer commented 2 years ago

Hey @xubin1994,

I do not really understand what you mean, could you maybe please show an example? I don't think turning off the lighting is such a good idea, as this is one of the key features of blenderproc: Generating photo realistic images.

xubin1994 commented 2 years ago

thank you for your reply. @cornerfarmer First, My purpose is to use blenderproc to reproduce the process of this paper: https://arxiv.org/abs/2101.10811。 The entire pipeline is as follows: image The most critical step is: without Shader. Intuitively, I don't know the noise model of my own camera, so I want to stick the image from my camera as a texture on the object,without Shader, blenderproc can output the "origin img with specific real camera noise".

cornerfarmer commented 2 years ago

Hey @xubin1994,

BlenderProc does currently only support cycles and not the eevee engine. Also turning of all shading effect has not been done yet.

One easy way to achieve your goal, while still using the cycles engine, is to use an emission shader in your materials:

Screenshot_2022-04-28_10-47-51

In this way all shading effects are disabled for the respective objects.

xubin1994 commented 2 years ago

Hi, @cornerfarmer I don't know much about the inner workings of blender, can you tell me which api can I get the same effect to use an emission shader in my materials? I found possible api on blenderproc doc, maybe i can set it as follow? material.make_emissive(emission_strength= 1000, emission_color=[128,128,128], replace=True)

cornerfarmer commented 2 years ago

The make_emissive method does add the emission shader node to the material graph, however it will not create the other three nodes on the left. So you probably will need to write that code yourself. You can take a look at the content of the make_emissive method for how to create nodes and link them.

xubin1994 commented 2 years ago

The make_emissive method does add the emission shader node to the material graph, however it will not create the other three nodes on the left. So you probably will need to write that code yourself. You can take a look at the content of the make_emissive method for how to create nodes and link them.

Thanks!

themasterlink commented 2 years ago

I assume this is resolved now.