- David Jefferies
- Posts: 27
- Joined:
Textures sometimes fail to load in Unreal
In Unreal we've moved the loading of the Xaml files from disk to be asynchronous. This is because we want to be able to load/unload them during gameplay - the motivation here is that unloading the Xaml means its textures get unloaded as well.
We initiate the async load like this:
Then when its loaded we call LoadXaml on it
The issue we're having is sometimes the textures for the Xaml fail to load with the error message:
Stepping through the code we can see that CreateTexture is failing because InTexture->GetResource() returns nullptr
The issue only occurs in a standalone build - never in editor - and seems to be timing related, sometimes it works fine sometimes it fails.
It looks like the textures haven't finished loading when CreateTexture tries to access them - the UTexture object exists but texture data doesn't yet
Any ideas what we can do to resolve it?
We initiate the async load like this:
Code: Select all
StreamableManager.RequestAsyncLoad(XamlObject.ToSoftObjectPath(), FStreamableDelegate::CreateRaw(this, &FViewLoader::OnXamlLoaded),
FStreamableManager::AsyncLoadHighPriority, false, false, "ViewLoader");
Then when its loaded we call LoadXaml on it
Code: Select all
void FViewLoader::OnXamlLoaded()
{
UNoesisXaml* XamlFile = XamlObject.Get();
const Ptr<BaseComponent> Component = XamlFile->LoadXaml();
..
}
Code: Select all
LogNoesis: Warning: Error loading '/Game;component/MyGame/Images/image_8.png', using fallback texture
Code: Select all
Noesis::Ptr<Noesis::Texture> FNoesisRenderDevice::CreateTexture(UTexture* InTexture)
{
if (!InTexture || !InTexture->GetResource())
return nullptr;
..
}
It looks like the textures haven't finished loading when CreateTexture tries to access them - the UTexture object exists but texture data doesn't yet
Any ideas what we can do to resolve it?
Re: Textures sometimes fail to load in Unreal
Hi David,
I've created a ticket to keep track of this issue. Here's a link: https://www.noesisengine.com/bugs/view.php?id=2705
Please, monitor the ticket, and I will post there as soon as I figure out how to resolve this.
Thanks
I've created a ticket to keep track of this issue. Here's a link: https://www.noesisengine.com/bugs/view.php?id=2705
Please, monitor the ticket, and I will post there as soon as I figure out how to resolve this.
Thanks
- David Jefferies
- Posts: 27
- Joined:
Re: Textures sometimes fail to load in Unreal
Great - thanks :)
One point that may be relevant is that the textures that are being loaded when it fails are quite large - 2560 x 1440 x 24bit
One point that may be relevant is that the textures that are being loaded when it fails are quite large - 2560 x 1440 x 24bit
- David Jefferies
- Posts: 27
- Joined:
Re: Textures sometimes fail to load in Unreal
I'd like to query the severity as 'minor' because the issue means we can't load Xamls asynchronously.
This is a problem because textures are only unloaded when all the references to the UNoesisXaml object are released. So to unload the textures we need to unload the Xaml file but then if we want to show the element again we're forced to load it synchronously, causing hitches.
We either need to be able to load the Xamls asynchronously, or be able to release the textures without unloading the Xaml
This is a problem because textures are only unloaded when all the references to the UNoesisXaml object are released. So to unload the textures we need to unload the Xaml file but then if we want to show the element again we're forced to load it synchronously, causing hitches.
We either need to be able to load the Xamls asynchronously, or be able to release the textures without unloading the Xaml
Re: Textures sometimes fail to load in Unreal
Thanks, severity changed to "major"
Re: Textures sometimes fail to load in Unreal
Hi David,
I've added a comment to the ticket (to keep the conversation in a single place). Could you please take a look?
Thanks!
I've added a comment to the ticket (to keep the conversation in a single place). Could you please take a look?
Thanks!
Who is online
Users browsing this forum: No registered users and 5 guests