tangent-opensource / blender

Tangent Animation's Blender Fork | More information ->
https://github.com/tangent-devops/tangent-blender/wiki
Other
9 stars 6 forks source link

USD Import: UsdPreviewSurface material import option #23

Open kowalskima opened 3 years ago

kowalskima commented 3 years ago

This is work in progress. I'm in the process of porting the following feature from branch usd-importer-T81257 to branch usd-importer-T81257-merge:

Provide experimental option to convert UsdPreviewSurface shaders to Blender Principled BSD shader networks on import. Attached is a screenshot of the Attic scene imported with this feature enabled (in branch usd-importer-T81257).

I will update this issue when I commit this work.

BlenderAtticUsdPreviewSurface

kowalskima commented 3 years ago

I've committed this change to the usd-importer-T81257-merge branch. Below is the Attic scene rendered in a build from this branch. The current conversion is useful as a basic material mapping for preview, but it doesn't yet handle all the shader parameters or node types and is considered an experimental option.

This implementation converts UsdPreviewSurface to Blender nodes as follows:

UsdPreviewSurface -> Pricipled BSDF UsdUVTexture -> Texture Image + Normal Map UsdPrimvarReader_float2 -> UV Map

Limitations: arbitrary primvar readers or UsdTransform2d not yet supported. For UsdPreviewSurface, only the file and st inputs are handled, and the color space is retrieved from the texture metadata.

TODO: Investigate adding support for converting additional shaders and inputs. Supporting certain types of inputs, such as texture scale and bias, will probably require creating Blender Group nodes with the corresponding inputs.

The commit is here https://github.com/tangent-opensource/blender/commit/5f74fc980d486621c59a352fa68f8e646f434f85.

atticUsdPreviewSurfaceImportMerge