nikobarli
Topic Author
Posts: 180
Joined: 26 Apr 2017, 06:23

RenderOptions.BitmapScalingMode="HighQuality" seems to have no effect when downsampling images

20 Jun 2017, 06:00

In WPF, we can make an image shown smooth in the case of downsampling (e.g 256x256 pixel images shown as 32x32 pixel).

Ref: http://10rem.net/blog/2010/05/01/crappy ... calingmode

However, the setting seems to have no effect in NoesisGUI in the case of downsampling. Is there anything to be set besides the property RenderOptions.BitmapScalingMode ?
 
User avatar
jsantos
Site Admin
Posts: 3917
Joined: 20 Jan 2012, 17:18
Contact:

Re: RenderOptions.BitmapScalingMode="HighQuality" seems to have no effect when downsampling images

20 Jun 2017, 18:45

That setting activates Trilinear filtering (mipmap interpolation). It is only useful if textures have mipmaps. The default texture provider in Noesis does not generate internal mipmaps. We have plans to incorporate support for DDS in the future (this format allows having the mipmaps inside). But the best alternative is implementing a custom texture provider.
 
nikobarli
Topic Author
Posts: 180
Joined: 26 Apr 2017, 06:23

Re: RenderOptions.BitmapScalingMode="HighQuality" seems to have no effect when downsampling images

21 Jun 2017, 07:47

In our case, we often needs to show icons (originally in PNG format) in slightly different sizes (not known exactly, decided following circumstances). Seems no easy solution for the moment...
 
User avatar
ai_enabled
Posts: 231
Joined: 18 Jul 2013, 05:28
Contact:

Re: RenderOptions.BitmapScalingMode="HighQuality" seems to have no effect when downsampling images

21 Jun 2017, 08:23

Downsampling requires trilinear filtering (which requires mipmaps) as bilinear filtering simply cannot handle downsampling properly - it doesn't have lower resolution images to interpolate pixels.
For us it was quite easy to create a custom texture provider which will provide textures to NoesisGUI with mipmaps generated in runtime.
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
 
User avatar
jsantos
Site Admin
Posts: 3917
Joined: 20 Jan 2012, 17:18
Contact:

Re: RenderOptions.BitmapScalingMode="HighQuality" seems to have no effect when downsampling images

22 Jun 2017, 15:35

In our case, we often needs to show icons (originally in PNG format) in slightly different sizes (not known exactly, decided following circumstances). Seems no easy solution for the moment...
Is using DDS a valid alternative? If not, the alternative sf improving the texture provider to calculate mipmaps on the fly.
 
nikobarli
Topic Author
Posts: 180
Joined: 26 Apr 2017, 06:23

Re: RenderOptions.BitmapScalingMode="HighQuality" seems to have no effect when downsampling images

23 Jun 2017, 03:12

Thanks for the reply @ai_enabled, @jsantos,

We have many icons in PNG and I think it is hard for us to convert them all to DDS. I think I need to go with the custom texture provider approach, but currently have little clue to how to implement it. Do you have any reference code for that ?

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests