View Issue Details

IDProjectCategoryView StatusLast Update
0001269NoesisGUIC# SDKpublic2023-10-19 10:45
Reporterai_enabled Assigned Tojsantos  
PrioritynormalSeveritytrivial 
Status assignedResolutionopen 
Product Version2.1.0f1 
Target Version3.2 
Summary0001269: Expose mip map LOD bias for texture sampling
Description

As we've discussed, usually with the trilinear filter the result is too blurry, especially if the texture is too large (and all our textures are for 4K so they're large, later we plan to introduce auto switching between textures for 4K and low DPI).

The mip map LOD bias helps with increasing sharpness without getting any side effects when the displayed image is static.
See the attached screenshots to demonstrate why we need the bias to enable the trilinear filtering.

The proper solution might be an XAML extension (similar to Text Stroke) which is recognized by NoesisGUI:

<Image Source="icon.png" noesis:Texture.MipMapLodBias="-0.5"  />

Or maybe even apply it globally to the root and so to the whole visual tree (I mean - enable inheritance of this property).

Another solution - expose the bias setting to the texture wrap API (Texture.WrapD3D11Texture() method) or as a property of the Noesis.Texture class itself.

Regards!

Attached Files
NoMipMap.png (3,037,066 bytes)
MipMap.png (3,110,601 bytes)
PlatformAny

Activities

jsantos

jsantos

2018-04-02 16:37

manager   ~0005165

Thanks for the report! Yes, I was thinking about adding a new method to Texture. But I need to think more about it.

ai_enabled

ai_enabled

2020-11-25 01:08

updater   ~0006820

I wish we can get this method in Texture class or at least as an argument in WrapD3D11 method.

jsantos

jsantos

2021-05-07 18:34

manager   ~0007231

Hi Vladimir, resurrecting this... :)

Sorry for the late reply, this is more complex that adding a float parameter to the texture class. Because it changes de API that our clients need to implement for custom render devices. In modern APIs, MipMapLodBias is not isolated and cannot be set to the GPU. Instead of that, this value is part of a bigger object, SamplerState for example in D3D11. This objects needs to be precreated. This can be done, but we would like to avoid it because it is extra work that need to be done by our clients, we want to avoid increasing the complexity of implementing a custom renderer. Anyway, we are close to 3.1 and this is a good moment to take a decision about this.

I have playing with our examples, and I am observing that a MipMapLodBias of -0.75 works almost perfect and very close to BitmapScalingMode set to HighQuality in WPF.
So, I propose hardcoding this value or a bit better, just exposing that number in RenderDevice, with the rest of configuration functions like SetOffscreenWidth, etc...

This way, instead of a value per texture, you will have the same value for all textures. This is probably what you would end up doing.

What do you think?

ai_enabled

ai_enabled

2022-01-02 04:28

updater   ~0007694

Hi Jesús,
I'm sorry for the very late reply. I've totally forgotten about the email and this ticket as in early May I was totally overwhelmed with 1.0 release and heavy DDoS. attacks on our servers.

Global MipMapLodBias sounds like a good solution for us. We're using very few raster images for the UI itsel—mostly there are item icons, and these are rarely animated so negative LOD bias should not cause any noticeable artifacts.

Regards!

jsantos

jsantos

2022-01-02 19:52

manager   ~0007699

3.1 was released with an internal bias of -0.75, please let us know if it works fine in your game. Thanks!

ai_enabled

ai_enabled

2023-10-19 02:53

updater   ~0008848

Hello!
Sorry for the late reply. We've upgraded to 3.2 a few months ago and nobody complained about the icon bluriness so I guess it's working great!
I wish you can provide this setting in RenderDevice as you've proposed in the message above. This way we can not only determine the best setting (e.g. I would like to have no bias when rendering in 4K) but also ensure that the mip map bias works as expected.

Regards!

Issue History

Date Modified Username Field Change
2018-04-02 08:56 ai_enabled New Issue
2018-04-02 08:56 ai_enabled File Added: NoMipMap.png
2018-04-02 08:56 ai_enabled File Added: MipMap.png
2018-04-02 16:37 jsantos Assigned To => jsantos
2018-04-02 16:37 jsantos Status new => assigned
2018-04-02 16:37 jsantos Note Added: 0005165
2018-11-01 02:14 jsantos View Status public => private
2018-11-21 16:39 jsantos Target Version => 2.2.0
2018-11-21 16:39 jsantos View Status private => public
2018-11-21 16:39 jsantos Platform => Any
2019-03-18 22:12 sfernandez Target Version 2.2.0 => 2.2.1
2019-04-05 12:20 sfernandez Target Version 2.2.1 => 2.2.2
2019-04-30 10:15 sfernandez Target Version 2.2.2 => 2.2.3
2019-06-18 16:57 sfernandez Target Version 2.2.3 => 2.2.4
2019-08-26 15:26 jsantos Target Version 2.2.4 => 2.2.5
2019-12-30 10:33 sfernandez Target Version 2.2.5 => 3.0.0
2020-04-13 14:41 jsantos Target Version 3.0.0 => 3.0
2020-11-25 01:08 ai_enabled Note Added: 0006820
2021-05-07 18:34 jsantos Status assigned => feedback
2021-05-07 18:34 jsantos Note Added: 0007231
2021-05-07 18:34 jsantos Target Version 3.0 => 3.1
2021-05-07 18:35 jsantos Description Updated
2021-05-07 18:35 jsantos Description Updated
2022-01-02 04:28 ai_enabled Note Added: 0007694
2022-01-02 04:28 ai_enabled Status feedback => assigned
2022-01-02 19:52 jsantos Note Added: 0007699
2022-01-02 19:52 jsantos Status assigned => feedback
2023-10-19 02:53 ai_enabled Note Added: 0008848
2023-10-19 02:53 ai_enabled Status feedback => assigned
2023-10-19 10:45 jsantos Target Version 3.1 => 3.2