atteneder / glTFast

Efficient glTF 3D import / export package for Unity
Other
1.24k stars 250 forks source link

Error "Draco package needs to be installed in order to support glTF extension KHR_draco_mesh_compression!" #284

Closed atteneder closed 2 years ago

atteneder commented 2 years ago

Discussed in https://github.com/atteneder/glTFast/discussions/279

Originally posted by **ItsCubeTime** November 16, 2021 ![image](https://user-images.githubusercontent.com/20190653/141960906-302ccee3-262b-4e9d-8d81-9756b79ca2cd.png) Any thoughts or advice is welcome <3 Im using Unity 2020.3.22f1 with a Personal license, testing in the HDRP sample scene. The gltf file was exported from Blender & dragged from Windows File Explorer into Unitys file explorer
ItsCubeTime commented 2 years ago

Oh hi, uhm thanks for the effort making this an issue but I actually got it working soon after my last post after reinstalling both glTFast & Draco3D from there master branch (via Unitys git package install feature)!

So Im guessing the issue derived from using mismatching versions of Draco & glTFast.

I do have another question though that I dont think is answered in the docs; Can I expect the shaders to build for every platform that Unitys HDRP shaders build for?

Im working on a commercial project that were developing primarly for Windows rn, but that we might want to make cross platform later on. Thinking if using glTFast could cause any issues down the road?

atteneder commented 2 years ago

Good to hear, but then I didn't understand the intention of your last message :)

Anyhow, regarding HDRP and material issues:

There are currently a couple of known problems with HDRP. From the top of my head:

Also some newer material extensions are not supported yet.

That being said, I'm currently working on solving some of those. I'd suggest, in the spirit of open source, take it as it is and report issues whenever you encounter them. I'll try to get them resolved, but cannot guarantee response times.

hth

ItsCubeTime commented 2 years ago

Good to hear, but then I didn't understand the intention of your last message :)

Anyhow, regarding HDRP and material issues:

There are currently a couple of known problems with HDRP. From the top of my head:

  • Transparency order issues
  • Emission value (range 0-1) does not reflect HDRP's physical value (lumens) and thus is often not visible/too weak

Also some newer material extensions are not supported yet.

That being said, I'm currently working on solving some of those. I'd suggest, in the spirit of open source, take it as it is and report issues whenever you encounter them. I'll try to get them resolved, but cannot guarantee response times.

hth

Hi again and thanks! Yeah okay, well assuming it builds just fine for desktop & console that shouldnt be any issue.

I noticed though theres some serious performance penalty comparing a material created by gltFast & HDRPs lit shader:

https://youtu.be/E0l9Dt5 The black one is default lit, the semi translucent one is a material generated from a "alpha clip" material in Blender, the blue was created by gltFast from a opaque material exported from Blender with gltf (The "black" material is using HDRPs lit shader that was manually setup using normal/smoothness/met/ao/albedo textures, the blue one is a one that was generated by glTF using the default settings when importing an "opaque" material exported from Blender)

https://user-images.githubusercontent.com/20190653/143439822-08ec7a5f-6bae-4ef8-923e-1f93864f8662.mp4

Is there anything that I could do about this? Im quite sure the project manager wont allow me to use these shaders if I cant get the performance close-to on pair with how Unitys HDRP shaders performs

ItsCubeTime commented 2 years ago

I can see this section in the manual: image

Mentioning ways for me to customize the import process, but can I use this during editor imports? We're pretty much only looking to drop gltf files into Unitys file browser really.

ItsCubeTime commented 2 years ago

@atteneder let me know if you have any thoughts <3 I would really love to make gltFast a cornerstone of our asset pipeline.

Up until now weve basically been building our scenes in Blender, exported our models with fbx and then recreated all our materials manually in Unity, which to me seems like a pretty big annoyance when we already have everything setup with textures in Blender.

atteneder commented 2 years ago

@ItsCubeTime Thanks for pointing out that performance problem!

Is the performance so bad in the Editor as well? Or is it restricted to certain platforms/builds?

Two ideas/solutions:

  1. Analyze what the source of the bad performance is. One way to make shaders faster is to leave out unused paths via keywords. Unfortunately the number of variants is already hight, so this is a hot topic to be solved.
  2. Prioritize the Editor import to Lit Materials (as suggested in #258 )

As far as I see solution number two would be the one ideal for you!

ItsCubeTime commented 2 years ago

@ItsCubeTime Thanks for pointing out that performance problem!

Is the performance so bad in the Editor as well? Or is it restricted to certain platforms/builds?

Two ideas/solutions:

  1. Analyze what the source of the bad performance is. One way to make shaders faster is to leave out unused paths via keywords. Unfortunately the number of variants is already hight, so this is a hot topic to be solved.
  2. Prioritize the Editor import to Lit Materials (as suggested in Editor Import: Convert to Lit/Standard based materials (instead of custom glTF shaders) #258 )

As far as I see solution number two would be the one ideal for you!

https://user-images.githubusercontent.com/20190653/143459185-6f9188c4-0b66-4304-acfb-3532a8cc6051.mp4

@ItsCubeTime Thanks for pointing out that performance problem!

No, thank you for showing interest!

2. Prioritize the Editor import to Lit Materials (as suggested in Editor Import: Convert to Lit/Standard based materials (instead of custom glTF shaders) #258 ) Can you elaborate a bit on that? Where exactly do I change that setting? I dont see any in my inspector with a material created by glTFast in my content browser. How do I bring up that particular menu in the inspector that I find that setting?

This is what it looks like in the editor (same issue at a packaged build for win64_84x): https://user-images.githubusercontent.com/20190653/143460286-be60e71d-9d2f-466e-aff3-cc9dc4f755cc.mp4

I created an issue for this: https://github.com/atteneder/glTFast/issues/285