- Mikhail Yanakayev
- Posts: 5
- Joined:
Dynamic texture loading with fallback local image
Hello! We're using DynamicTextureSource for rendering our image rendered into texture. Also we want to show some default local image while real texture is loading in separate thread. Problem is we don't have any way to get some Noesis::Texture object from BitmapImage with local value to show it in DynamicTextureSource until our real image is loaded.
Do you have tips how to do it better? Converter? Texture provider? Something else?
Some examples would be appreciated.
Thank you!
Do you have tips how to do it better? Converter? Texture provider? Something else?
Some examples would be appreciated.
Thank you!
Re: Dynamic texture loading with fallback local image
For asynchronous texture loading, we recommend using the hot-reloading mechanism provided by the texture providers, as explained here.
Could you clarify why you're using DynamicTextureSource? This class is typically used when you need to dynamically update a render texture with the GPU, such as for video rendering
Could you clarify why you're using DynamicTextureSource? This class is typically used when you need to dynamically update a render texture with the GPU, such as for video rendering
- Mikhail Yanakayev
- Posts: 5
- Joined:
Re: Dynamic texture loading with fallback local image
Actually, we're using it because we need rendering Noesis::Texture into Image. AFAIK, there are only 2 variants:
1. BitmapImage that doesn't have any textures under it
2. DynamicTextureSource, that allows to render into texture and display it. Even if texture was rendered just once (as we do)
If I'm wrong, please correct me
Also there's another question, if we can call PropertyChanged callback for only visible elements of ScrollViewer any time when elements are scrolled? Or, maybe, add/remove invisible elements dynamically?
1. BitmapImage that doesn't have any textures under it
2. DynamicTextureSource, that allows to render into texture and display it. Even if texture was rendered just once (as we do)
If I'm wrong, please correct me
Also there's another question, if we can call PropertyChanged callback for only visible elements of ScrollViewer any time when elements are scrolled? Or, maybe, add/remove invisible elements dynamically?
Re: Dynamic texture loading with fallback local image
Have you tried using a TextureSource for this? If you have a Texture object, created with your renderer or from your texture provider, you can easily pass it to the TextureSource.Actually, we're using it because we need rendering Noesis::Texture into Image. AFAIK, there are only 2 variants:
Do you have a performance problem if you call PropertyChanged for all elements (not only visible) ?Also there's another question, if we can call PropertyChanged callback for only visible elements of ScrollViewer any time when elements are scrolled? Or, maybe, add/remove invisible elements dynamically?
- Mikhail Yanakayev
- Posts: 5
- Joined:
Re: Dynamic texture loading with fallback local image
For now, for debug purposes, we need DynamicTexture. But in the future I'll consider this variant, thank you!Have you tried using a TextureSource for this? If you have a Texture object, created with your renderer or from your texture provider, you can easily pass it to the TextureSource.
For now, PropertyChanged called for every element when we add it and change Source for Image inside it. Inside it we set either BitmapImage or DynamicTextureSource as Image source. But it occurs only during element addition.Do you have a performance problem if you call PropertyChanged for all elements (not only visible) ?
It would be great for memory to unload textures for elements that become invisible in ScrollViewer and replace them back by BitmapImage.
And yeah, we've thought about just replacing rendered Texture with dummy Texture inside DynamicTextureSource's Render callback depending on element visibility. but unfortunately it's complicated to load dummy texture as Texture with our architecture, so now I wonder if some another solution exists.
Re: Dynamic texture loading with fallback local image
I don't think using DynamicTextureSource is a good idea in this scenario. What renderer implementation are you using? Could you just handle the textures externally to Noesis and just wrap then into a Noesis texture using somethng like D3D11Factory::WrapTexture?
- Mikhail Yanakayev
- Posts: 5
- Joined:
Re: Dynamic texture loading with fallback local image
Yeah, we can wrap our engine textures into Noesis::Texture. But now problem actually solved by some changes inside the game outside of Noesis. We just loading our dummy texture and show it for any visible element while actual textures are rendering. I guess, for now this thread can be closed. If some related tasks will appear, I'll ask.
Thank you!
Thank you!
Re: Dynamic texture loading with fallback local image
Thanks for the feedback!
Who is online
Users browsing this forum: No registered users and 1 guest