-
Notifications
You must be signed in to change notification settings - Fork 475
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
Stream Texture Import Bug from official examples #462
Comments
GLB/GLTF-Binary-Models imported through the stream option works great. I actually don't get it, the only difference between the Stream & URI option is the ExternalDataLoader property from ImportOptions. But both looks fine for me... so why does the above bug only appear in stream option? |
Hello, |
Hi there, I just wanted to know, if this is still an issue. I had this Issue too, when it first came up, and I'm waiting for this to get solved before I'll update the plugin in my project. |
To workaround this issue, in GLTFSceneImporter.cs, in the ConstructImageBuffer method, change the LoadStream call to use LoadStreamSync instead. // await _options.ExternalDataLoader.LoadStream(image.Uri); For some reason, the async LoadStream method only works once, so only the first texture is loaded, and all others are empty. |
@Stephengower Thank you for the info! Saved me a lot of time! it works now as expected |
Yeah, the current release is just flat out broken due to this, and it looks like it's been this way for a couple months at least. Maybe all the devs took the summer off. |
I take the works as expected back, it's causing memory leaks on iOS. |
vr_table.zip |
@yaqinh No it is not, and it does not really fix the issue completely as it causes memory leaks on iOS. I guess we have to wait until the devs are back. |
@Dryra , yeah, my platform is UWP and I have not found any issue yet. But, yeah memory leak on IOS is important |
From what I can see, the issue stems from attempting to use File.OpenRead asynchronously when it wasn't created to natively work that way, at least initially. I don't have an iOS device to test this issue on so I can't reproduce the memory leak but by modifying the LoadFileStream method in FileLoader.cs to look like this below, the textures now load correctly.
If someone can confirm whether this fixes the issue, I'll go ahead and make a pull request and see if i can get it merged in. |
@AdamMitchell-ms Are you ok with the above implementation to resolve this issue? This also would resolve issue #484 |
Im currently trying to test out the stream option but it seems like it doesn't import the textures correctly. If I run the official example scene "StreamTestScene", I get the following result:
The URI option works great, only the stream option gives me red/white question mark textures. The same bug appears for every model imported through the stream option.
The text was updated successfully, but these errors were encountered: