a.lashkevich
Topic Author
Posts: 21
Joined: 23 Sep 2024, 08:50

bug with texture UV coordinates ?

03 Jun 2025, 11:37

Hello Noesis Team!
In our project we're using async texture loading and using two versions of the same texture - small-sized for the time while the actual data is loading and then changing its content to the loaded full-sized version. For some reason Noesis does not update texture coordinates when updating an existing texture (when calling RaiseTextureChanged method).
Please see the attached screenshot from render doc:
Attachments
image.png
 
User avatar
jsantos
Site Admin
Posts: 4822
Joined: 20 Jan 2012, 17:18
Contact:

Re: bug with texture UV coordinates ?

03 Jun 2025, 11:50

Could you please confirm that after RaiseTextureChanged is called, GetTextureInfo is invoked in your provider and that it returns the correct new dimensions?
 
a.lashkevich
Topic Author
Posts: 21
Joined: 23 Sep 2024, 08:50

Re: bug with texture UV coordinates ?

03 Jun 2025, 12:33

Yes, the GetTextureInfo method is invoked with the correct dimensions. However, it may be invoked multiple times with different values - 8x8 for small texture, but the final call is always with the correct dimension.
 
User avatar
jsantos
Site Admin
Posts: 4822
Joined: 20 Jan 2012, 17:18
Contact:

Re: bug with texture UV coordinates ?

03 Jun 2025, 12:38

Let me understand a bit more, because GetTextureInfo is not invoked with texture dimensions. You must return the right dimensions from that function.
So, after doing RaiseTextureChanged, all invocations to GetTextureInfo must return the new width and height in the TextureInfo struct.

Could you please confirm this?

Thank you!
 
d.stepanov
Posts: 4
Joined: 03 Jun 2025, 12:53

Re: bug with texture UV coordinates ?

03 Jun 2025, 13:09

Hi! I'm the one who initially found the issue. Answering your question: we're returning current texture dimensions from GetTextureInfo. If a texture is still loading, we're do not know what are the actual dimensions and simply return the size of the stub texture (8x8). When the texture is loaded, we're calling RaiseTextureChanged and then it invokes GetTextureInfo, where we returning the correct size of fully loaded texture in Noesis::TextureInfo.

So typical flow is like this:

- Kick off async loading in GetTextureInfo and return 8x8 size of the stub texture if the texture is loading
- When loaded, call RaiseTextureChanged, which calls GetTextureInfo and return 86x69 there.

Here is the exact sequence:
GuiManager screen start opening: Tablet/Factions/FactionsReward.xaml
GetTextureInfo: Size Tablet/Images/Factions/Rewards/ic_reward_coin.png 8x8
GetTextureInfo: Size Tablet/Images/Factions/Rewards/ic_reward_coin.png 8x8
GetTextureInfo: Size Tablet/Images/Factions/Rewards/ic_reward_case.png 8x8
GuiManager screen finish opening: 38ms Tablet/Factions/FactionsReward.xaml
GetTextureInfo: Size Tablet/Images/Factions/Rewards/ic_reward_coin.png 8x8
GetTextureInfo: Size Tablet/Images/Factions/Rewards/ic_reward_case.png 8x8
RaiseTextureChanged: Size Tablet/Images/Factions/Rewards/ic_reward_coin.png 86x69
GetTextureInfo: Size Tablet/Images/Factions/Rewards/ic_reward_coin.png 86x69
GetTextureInfo: Size Tablet/Images/Factions/Rewards/ic_reward_coin.png 86x69
GetTextureInfo: Size Tablet/Images/Factions/Rewards/ic_reward_coin.png 86x69
RaiseTextureChanged: Size Tablet/Images/Factions/Rewards/ic_reward_case.png 86x69
GetTextureInfo: Size Tablet/Images/Factions/Rewards/ic_reward_case.png 86x69
GetTextureInfo: Size Tablet/Images/Factions/Rewards/ic_reward_case.png 86x69
 
d.stepanov
Posts: 4
Joined: 03 Jun 2025, 12:53

Re: bug with texture UV coordinates ?

03 Jun 2025, 13:43

I've tried calling this on every frame:
eastl::vector<Noesis::Visual*> stack;
stack.push_back(it->root);
while (!stack.empty())
{
    auto widget = stack.back();
    stack.pop_back();
    if (auto elem = Noesis::DynamicCast<Noesis::FrameworkElement*>(widget))
    {
        elem->InvalidateVisual();
    }

    for (int i = 0; i < Noesis::VisualTreeHelper::GetChildrenCount(widget); ++i)
    {
        stack.push_back(Noesis::VisualTreeHelper::GetChild(widget, i));
    }
}
and it fixes the issue. Of course this is not the right solution for this issue, but it somewhat confirms that there's some issue in visual invalidation routine related to texture size changes.
 
User avatar
jsantos
Site Admin
Posts: 4822
Joined: 20 Jan 2012, 17:18
Contact:

Re: bug with texture UV coordinates ?

03 Jun 2025, 13:54

Thanks for the extra information.

Could you please create a ticket for this? if possible, indicating a XAML that we could use to reproduce.
 
d.stepanov
Posts: 4
Joined: 03 Jun 2025, 12:53

Re: bug with texture UV coordinates ?

03 Jun 2025, 14:11

Yeah, sure - https://www.noesisengine.com/bugs/view.php?id=4217 . There's no specific XAML - it can be reproduced on a single Image widget and the steps described in this thread.

Who is online

Users browsing this forum: dstewart, Google [Bot] and 8 guests