Unity-Technologies / usd-unity-sdk

Integration of Pixar's Universal Scene Description into Unity. UPDATE: This package has been superseded by our new bundle of USD packages. Please see README & link below for further details.
https://forum.unity.com/threads/new-openusd-packages-now-available.1524583/
Apache License 2.0
498 stars 75 forks source link

Smooth normals on imported USD files [USDU-461] #401

Open SoftwareMechanic opened 1 year ago

SoftwareMechanic commented 1 year ago

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

vickycl commented 1 year ago

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

SoftwareMechanic commented 1 year ago

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

vickycl commented 1 year ago

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

SoftwareMechanic commented 1 year ago

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 :blush:

EDIT: Weird trying now with same file I see normals correctly computed :confused:

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

lee-aandrew commented 1 year ago

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:

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!

SoftwareMechanic commented 1 year ago

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 😖 )

lee-aandrew commented 1 year ago

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!

SoftwareMechanic commented 1 year ago

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!!