allenai / ai2thor

An open-source platform for Visual AI.
http://ai2thor.allenai.org
Apache License 2.0
1.15k stars 216 forks source link

extracting albedo and shading #175

Open anandbhattad opened 5 years ago

anandbhattad commented 5 years ago

Hi! How can I extract albedo and shading? The SimpleToon shader doesn't seem to produce correct albedos. Thanks!

AlvaroHG commented 5 years ago

Hi, so the SimpleToon shader is just a simple fallback effect for rendering objects in our web demo, it is not used by any object, and It is not supported in the metadata we return to the python interface. It is only an efficient approximation to highlight the edges of an object, just a visual effect.

Could you provide more details on what you mean by "albedo" and "shading"? In unity you can access the Albedo property of an object by the GetColor method on a Material object. If this is what you mean see https://docs.unity3d.com/ScriptReference/Material.GetColor.html and https://docs.unity3d.com/Manual/StandardShaderMaterialParameterAlbedoColor.html

If what you want is to extract the pixels of model after rendering it, you probably need to write your own shader to get the particular results you want, and render to a RenderBuffer and read the pixels from the output texture. See: https://docs.unity3d.com/ScriptReference/RenderBuffer.html