Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor crashes when importing a glb runtime (URP, Unity 2022, MRTK) #643

Closed
SashelI opened this issue Sep 5, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@SashelI
Copy link

SashelI commented Sep 5, 2023

Hi,

I am trying to make a magic leap project work, with mrtk 2.8 and the gltfast package.
Thing is, every time I load a .glb asset, unity crashes and I can't find why in the logs (accessing denied memory it seems but that doesnt help).

Mind this is an upgrade of a unity 2021.3.25f1 Built-In RP project.

It seems to happen around line n°2652 of GLTFImport.cs :

           var txt = new Texture2D(
                4, 4,
                forceSampleLinear
                    ? GraphicsFormat.R8G8B8A8_UNorm
                    : GraphicsFormat.R8G8B8A8_SRGB,
                textureCreationFlags
            )
            {
                anisoLevel = m_Settings.AnisotropicFilterLevel,
                name = GetImageName(img, index)
            };

This same script with same object worked fine on the old project.

To Reproduce
Steps to reproduce the behavior:
Play the project
Click on an object in the panel that shows up
crash

I can't provide the project, but can provide a video showing what's happening in both unity and VS. Mind that the errors you see are not fatal and aren't linked to this issue.

Expected behavior
Intented model appears.

Screenshots

https://github.com/atteneder/glTFast/assets/22128247/4bf0d67f-5fc2-4f23-98f0-c1c04960e62b
https://github.com/atteneder/glTFast/assets/22128247/6902fb60-349c-4ab4-9d76-26616a14cd2d

Desktop (please complete the following information):

  • glTFast version 5.0.4
  • Unity Editor version 2022.3.7f1
  • Render Pipeline and version Universal Render Pipeline 14.0.8
  • Platform: Editor
    Editor.log
@SashelI SashelI added the bug Something isn't working label Sep 5, 2023
@Walkramis
Copy link

I've had the same issues and managed through trial and error figure out it's related to Magic Leaps change of graphics API to OpenGLCore for windows (which seems to be used by the simulator). I have issues with importing MRTK3 (same thing, crashing on load of GLB assets), but if I remove OpenGLCore as graphics api (or just set to automatic) it imports fine and changing it back will not cause a re-import. This works for me as I am not trying to import during runtime, and I assume the simulator needs OpenGLCore to run.

@SashelI
Copy link
Author

SashelI commented Nov 6, 2023

I've had the same issues and managed through trial and error figure out it's related to Magic Leaps change of graphics API to OpenGLCore for windows (which seems to be used by the simulator). I have issues with importing MRTK3 (same thing, crashing on load of GLB assets), but if I remove OpenGLCore as graphics api (or just set to automatic) it imports fine and changing it back will not cause a re-import. This works for me as I am not trying to import during runtime, and I assume the simulator needs OpenGLCore to run.

Thanks ! Replacing this OpenGLCore by Vulkan in windows graphics API prevents the crash.

@SashelI SashelI closed this as completed Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants