glTFast icon indicating copy to clipboard operation
glTFast copied to clipboard

Import/Export round-trip does not preserve all material features

Open myartings opened this issue 2 years ago • 5 comments

Describe the bug Gltf Exporter gives a wrong result. First import a glb format asset into unity and add to the scene. Then export the select game object. The exported glb asset is different from the original one.

Files glb model DamagedHelmet.zip

To Reproduce Steps to reproduce the behavior:

  1. add the glb asset into unity
  2. drag the model to the scene
  3. select the game object, click menu-> GameObject->Export glTF -> GLB
  4. add the exported glb file into asset folder, see the result.

Expected behavior The exported file is exactly same with original one.

Screenshots

original Snipaste_2022-04-21_21-33-12 Snipaste_2022-04-21_21-33-35 Snipaste_2022-04-21_21-35-43 exported Snipaste_2022-04-21_21-34-49 Snipaste_2022-04-21_21-35-17 Snipaste_2022-04-21_21-35-59

The textures has lost when exported, the exported textures are also modified. And the material parameter is different with original one, e.g. texture_ST.

Desktop (please complete the following information):

  • glTFast 4.6.0
  • Unity 2020.3.30f1c1
  • Universal Render Pipeline 10.8.1
  • Windows Editor

Additional context Add any other context about the problem here.

myartings avatar Apr 21 '22 13:04 myartings

@myartings Thanks for the report.

Round-trip import-export does not fully work at the moment. Either import to Lit/Standard (#258) or export of glTF materials (#351 ) has to be implemented first.

And finally some good news: I just pushed a fix for correct color space of exported textures (#353), so with that it should improve somewhat.

hth

atteneder avatar Apr 21 '22 14:04 atteneder

@myartings Another question: Is this a test-run for a production workflow you're seriously aiming at or did you just stumble across it while playing.

If it's the former, I'm happy to hear insights about requirements (like what shaders would you prefer to import to).

atteneder avatar Apr 21 '22 14:04 atteneder

@atteneder Thank you for your response. This is a test-run for a production workflow. We aim to make a avatar creator at rum time. It will combine multiple glb body asset into a single avatar model and expect to export the result game object to one glb model file for other use. Considering shaders, we have no special requirements. It is just ok when rendering correctly.

myartings avatar Apr 22 '22 12:04 myartings

@myartings That's a helpful insight. My 2 cents regarding shader selection:

  • Lit
    • pro: Battle prove standard
    • contra: ORM maps need to get converted at run-time, potentially slowing down loading/exporting
  • glTF shaders:
    • pro: Faster loading/exporting
    • pro: Feature set is built around glTF, so round-trip is more likely to be lossless in the future
    • con: Not as well (there might be missed corner cases on ceratin platform/SRP/settings combination)

I think glTF shaders would be better in your case, but in case import to Lit is available sooner, I'd not rule that out as option either.

atteneder avatar Apr 22 '22 15:04 atteneder

We're in a similar situation and would like to both import user content and export gltfs at runtime. At the moment we are converting to Unity Standard but would switch to relying on gltf shaders and getting rid of all conversions if gltf round trips were possible.

haptiq-sondreu avatar Jun 15 '22 16:06 haptiq-sondreu