-
- a.lashkevich
- Posts: 21
- Joined:
bug with texture UV coordinates ?
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:
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:
Re: bug with texture UV coordinates ?
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
- Posts: 21
- Joined:
Re: bug with texture UV coordinates ?
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.
Re: bug with texture UV coordinates ?
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!
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:
Re: bug with texture UV coordinates ?
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:
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:
Code: Select all
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:
Re: bug with texture UV coordinates ?
I've tried calling this on every frame:
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.
Code: Select all
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));
}
}
Re: bug with texture UV coordinates ?
Thanks for the extra information.
Could you please create a ticket for this? if possible, indicating a XAML that we could use to reproduce.
Could you please create a ticket for this? if possible, indicating a XAML that we could use to reproduce.
-
- d.stepanov
- Posts: 4
- Joined:
Re: bug with texture UV coordinates ?
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: No registered users and 4 guests