Unity-Technologies/usd-unity-sdk

Smooth normals on imported USD files [USDU-461]

SoftwareMechanic opened this issue ยท 8 comments

Hello, first of all Thank you for bringing USD compatibility with Unity.
I just want to inform that I found that when I import a USD file with this SDK, everything looks good, except that the normals are smooth.

this is what I would expect to see:
immagine

this is what I get:
immagine

Hey @Baruchware! Thank you for reporting. Do you have a file you could share as a reproduction case to help us investigate this issue?

Hello!
Thank you for answering me, and sorry for the late.
Yes I have it, I can share with you the ".usd" and the ".usda" files!
usd_files.zip

@Baruchware Thank you for sharing! I will test this out and file a bug internally. Could you please also share:

  • your Unity version
  • whether your project uses Built-in Render Pipeline, URP or HDRP
  • whether you are using the 'Import Preview Surface' material import mode?

Hello! Thank you a lot for the response!
Of course I can share these info, sorry if I didn't do that before.

Unity Version: 2022.3.5f1
Rendering Pipeline: URP
Yes I am importing using Preview Surface

hope this can help you out ๐Ÿ˜Š

EDIT:
Weird trying now with same file I see normals correctly computed ๐Ÿ˜•

but I found that transparent materials in USD are imported as black in Unity
Do you want that I open another issue about this?

I show you an image;
immagine

Hello @Baruchware, thank you for the additional information!

Sadly at the exact moment, the URP is not supported, but @vickycl has created PR which will add a bit of support to importing on URP - could you please try your workflow on that branch?

Also about the transparency, the package does not automatically set the following settings at the moment:

  • Transparency
  • Double sided

you need to set them manually after importing - sorry about the trouble

Thank you once again, and let us know if you have more questions or problems!

hello @lee-aandrew and thank you so much for the details,
Please forgive my ignorance, but it is not clear to me how to install in Unity a custom branch, I tried uploading the "package.json" from disk but seems it is not different from the main branch.

can you please what are the steps in order to install it?

Thank you in advance!

EDIT:
Ok, I imported the com.unity.formats.usd folder from the branch you suggested from here: https://github.com/Unity-Technologies/usd-unity-sdk/tree/a4753ff507799b8383271fac3c0c9c6e6998aad5/package/com.unity.formats.usd and pasted directly in Unity, but when I import a USD file (both as prefab or as gameobjects) I get the same results of the main branch (maybe there is something I don't noticed).

For me now is ok to set transparency manually and double side.

But I found that elements which have more than 1 material ( using GeomSubset ) are considered with only one material:
immagine

in this case the window is one mesh with 3 GeomSubsets which have different materials.

this is what I would expect:
immagine

I hope this feedback can help you out
(Or maybe it's me doing something wrong ๐Ÿ˜– )

hey @Baruchware!

Sorry for not being specific on how to have the package set a branch!
So assuming you aren't too familiar with git

  1. Install git
  2. Clone this repository by opening your windows commandline and entering in git clone https://github.com/Unity-Technologies/usd-unity-sdk.git
  3. This will create a folder called usd-unity-sdk
  4. Now open up Unity, and install the package via Package Manager -> Install Package from Disk... ->
  5. Go into your usd-unity-sdk folder, open up another commandline from that folder, and enter in the command git checkout exp/urp-import-support
  6. This should set your package to the branch i mentioned

Or if this is all a bit too much for you, I've zipped up the package on that branch Google Drive Link (sorry its too big to attach here), unzip this and install it to Unity by Package Manager -> Install Package from Disk... ->

But having said all that, I have to say this package at the moment does not support GeomSubsets or multiple materials on a single mesh - but it is on our radar

Thank you once again, and please let us know if you have any more problems / questions!

I am very very very sorry for the late reply.
I was on holiday and upon my return I had emergencies to manage on other projects.
I am so sorry for that!
I Just want to thank you for this detailed information, soon I will resume all my tests concerning this package!!