Open Creepymulder opened 1 year ago
@Creepymulder Try this #580
Similar issue here, the normal loading script works on Desktop builds and Editor on Windows 11 and M1 Mac, works fine on device on IOS. On Android if we try to load a file that has a mesh, materials and textures in it, I get
16028 16053 Error CRASH Cause: null pointer dereference
Interestingly, files that contain only animated bones in them with no materials or textures load fine, this includes an animation only file that I am using to retarget an animation to a model already in the scene.
Any update on this? I need to make this work for android for my bachelor thesis... I'm running into the exact same error which throws me back in my timeplan.
Any update on this? I need to make this work for android for my bachelor thesis... I'm running into the exact same error which throws me back in my timeplan.
I believe this issue is actually this issue I found later on, on Android we could only load glb/gltf that used KTX2 textures. Jpeg/Png don't work. https://github.com/atteneder/glTFast/issues/590
Any update on this? I need to make this work for android for my bachelor thesis... I'm running into the exact same error which throws me back in my timeplan.
I believe this issue is actually this issue I found later on, on Android we could only load glb/gltf that used KTX2 textures. Jpeg/Png don't work. #590
Thanks for the fast answer! Will this be fixed in the near future? Or this even fixable?
Would you recommend Gltfunity for this particular case instead?
Any update on this? I need to make this work for android for my bachelor thesis... I'm running into the exact same error which throws me back in my timeplan.
Did you try #580?
Any update on this? I need to make this work for android for my bachelor thesis... I'm running into the exact same error which throws me back in my timeplan.
Did you try #580?
Do you think this could make it work? I can not change the model directly however... Im gonna give it a try, lets see if it works.
Any update on this? I need to make this work for android for my bachelor thesis... I'm running into the exact same error which throws me back in my timeplan.
Did you try #580?
Do you think this could make it work? I can not change the model directly however... Im gonna give it a try, lets see if it works.
I guess it will but can tell me what are you expecting? In my case i was expecting to display a glb model that is stored on a server with all textures on it and it worked for all models that i used. Note: i didnt try to use URP
I guess it will but can tell me what are you expecting?
Well, like mentioned in the issue. Theres a glb file stored on a server with textures and materials on it and i wanna load it during runtime on android devices. Its actually a crucial part for my bachelor thesis. Im not using URP either, still on the inbuild renderpipeline. However i receive exact the same issue as described above.
The glb file I'm using (from sketchfab) : https://sketchfab.com/3d-models/coffee-maker-9ccda2fddba846e6ba97eb774b8a09c6
I guess it will but can tell me what are you expecting?
Well, like mentioned in the issue. Theres a glb file stored on a server with textures and materials on it and i wanna load it during runtime on android devices. Its actually a crucial part for my bachelor thesis. Im not using URP either, still on the inbuild renderpipeline. However i receive exact the same issue as described above.
The glb file I'm using (from sketchfab) : https://sketchfab.com/3d-models/coffee-maker-9ccda2fddba846e6ba97eb774b8a09c6
I guess it will work with all that mentioned
I guess it will but can tell me what are you expecting?
Well, like mentioned in the issue. Theres a glb file stored on a server with textures and materials on it and i wanna load it during runtime on android devices. Its actually a crucial part for my bachelor thesis. Im not using URP either, still on the inbuild renderpipeline. However i receive exact the same issue as described above. The glb file I'm using (from sketchfab) : https://sketchfab.com/3d-models/coffee-maker-9ccda2fddba846e6ba97eb774b8a09c6
I guess it will work with all that mentioned
It really worked thanks! :) Well it works partially... The model shows up, but its all black for some reason. I downloaded and included the shaders as you said, i put them into Assets/Resources/Shaders (since you haven't mentioned a particular folder). One think i have noticed is that one of the shaders throws errors at me: https://prnt.sc/iVSFuSSR1r28
Any clue why its all black? And why that one shader throws those errors?
I guess it will but can tell me what are you expecting?
Well, like mentioned in the issue. Theres a glb file stored on a server with textures and materials on it and i wanna load it during runtime on android devices. Its actually a crucial part for my bachelor thesis. Im not using URP either, still on the inbuild renderpipeline. However i receive exact the same issue as described above. The glb file I'm using (from sketchfab) : https://sketchfab.com/3d-models/coffee-maker-9ccda2fddba846e6ba97eb774b8a09c6
I guess it will work with all that mentioned
It really worked thanks! :) Well it works partially... The model shows up, but its all black for some reason. I downloaded and included the shaders as you said, i put them into Assets/Resources/Shaders (since you haven't mentioned a particular folder). One think i have noticed is that one of the shaders throws errors at me: https://prnt.sc/iVSFuSSR1r28
Any clue why its all black? And why that one shader throws those errors?
Did you include the pbrMetallicRoughness in the Always included shaders?
Did you include the pbrMetallicRoughness in the Always included shaders?
Yes i have, like this : (Thats the correct one, right?)
However that one throws those errors at me:
Any ideas?
Did you include the pbrMetallicRoughness in the Always included shaders?
Yes i have, like this : (Thats the correct one, right?)
However that one throws those errors at me:
Any ideas?
It's correct. Can you replace it with the one inside the glTFast itself it is located in glTFast directory / Runtime/shader/Built-in
Can you replace it with the one inside the glTFast itself it is located in glTFast directory / Runtime/shader/Built-in
What exactly do you mean? Like replacing the pbrMetallicRoughness shader? I actually downloaded it from https://github.com/atteneder/glTFast/blob/main/Runtime/Shader/Built-In/glTFPbrMetallicRoughness.shader which should be sufficient. Or do you mean something else?
I think the metallicroughness shader itself is not the problem, its the included that are missing. However i have no idea on how to add them to make that work properly.
Can you replace it with the one inside the glTFast itself it is located in glTFast directory / Runtime/shader/Built-in
What exactly do you mean? Like replacing the pbrMetallicRoughness shader? I actually downloaded it from https://github.com/atteneder/glTFast/blob/main/Runtime/Shader/Built-In/glTFPbrMetallicRoughness.shader which should be sufficient. Or do you mean something else?
I think the metallicroughness shader itself is not the problem, its the included that are missing. However i have no idea on how to add them to make that work properly.
It should be sufficient but i dont have any of these errors so you could try to replace the pbrMetallicRoughness.shader that is in the Always Included Shaders with the one that is inside the package directory in your project inside the / Runtime/shader/Built-in If that didnt work you could try including these shaders also but in my case i didnt have to
Can you replace it with the one inside the glTFast itself it is located in glTFast directory / Runtime/shader/Built-in
What exactly do you mean? Like replacing the pbrMetallicRoughness shader? I actually downloaded it from https://github.com/atteneder/glTFast/blob/main/Runtime/Shader/Built-In/glTFPbrMetallicRoughness.shader which should be sufficient. Or do you mean something else? I think the metallicroughness shader itself is not the problem, its the included that are missing. However i have no idea on how to add them to make that work properly.
It should be sufficient but i dont have any of these errors so you could try to replace the pbrMetallicRoughness.shader that is in the Always Included Shaders with the one that is inside the package directory in your project inside the / Runtime/shader/Built-in If that didnt work you could try including these shaders also but in my case i didnt have to
Solved it, now works. I included the whole folder where those missing included were located at and dropped in the shader with meta data again. Thanks!
Can you replace it with the one inside the glTFast itself it is located in glTFast directory / Runtime/shader/Built-in
What exactly do you mean? Like replacing the pbrMetallicRoughness shader? I actually downloaded it from https://github.com/atteneder/glTFast/blob/main/Runtime/Shader/Built-In/glTFPbrMetallicRoughness.shader which should be sufficient. Or do you mean something else? I think the metallicroughness shader itself is not the problem, its the included that are missing. However i have no idea on how to add them to make that work properly.
It should be sufficient but i dont have any of these errors so you could try to replace the pbrMetallicRoughness.shader that is in the Always Included Shaders with the one that is inside the package directory in your project inside the / Runtime/shader/Built-in If that didnt work you could try including these shaders also but in my case i didnt have to
Solved it, now works. I included the whole folder where those missing included were located at and dropped in the shader with meta data again. Thanks!
That's great. Happy to hear that. Good luck finishing your bachelor thesis
Sorry I haven't been able to test it out since I created this issue, but I'm glad it's working with this fix, thanks a lot :-).
Sorry I haven't been able to test it out since I created this issue, but I'm glad it's working with this fix, thanks a lot :-).
No problem at all. you are welcome :)
Describe the bug
Hello there!
I'm trying to import a .glb file using the "Gltf asset" script with all option on default. No custom code.
It's working fine on the editor, but on Android I'm getting the following :
2023/02/27 17:16:43.283 19335 19365 Error Unity NullReferenceException: Object reference not set to an instance of an object. 2023/02/27 17:16:43.283 19335 19365 Error Unity at GLTFast.Materials.BuiltInMaterialGenerator.GenerateDefaultMaterial (System.Boolean pointsSupport) [0x00000] in <00000000000000000000000000000000>:0 2023/02/27 17:16:43.283 19335 19365 Error Unity at GLTFast.Materials.MaterialGenerator.GetDefaultMaterial (System.Boolean pointsSupport) [0x00000] in <00000000000000000000000000000000>:0 2023/02/27 17:16:43.283 19335 19365 Error Unity at GLTFast.GameObjectInstantiator.AddPrimitive (System.UInt32 nodeIndex, System.String meshName, UnityEngine.Mesh mesh, System.Int32[] materialIndices, System.UInt32[] joints, System.Nullable
1[T] rootJoint, System.Single[] morphTargetWeights, System.Int32 primitiveNumeration) [0x00000] in <00000000000000000000000000000000>:0 2023/02/27 17:16:43.283 19335 19365 Error Unity at GLTFast.GltfImport+<>cDisplayClass116_0.The .GLB file in question is attached.
haha-63f797eb227eb(2).zip
I've also tried all the manual way to import a .GLB following the documentation, but they all end with the same error message.
Thanks !