Page 1 of 1

bitmap quality

Posted: 21 Nov 2013, 23:05
by walhore
Hi Guys,

This is probably a noobie question so I apologize in advance.

I'm using bitmaps in some buttons and I'm noticing they look fine running from Expression Blend but are very aliased (blocky) in XamlPlayer and Ogre.

Is there some way to control the render quality of bitmaps or a way to optimize how I'm laying them out in XAML?

The bitmaps are 50x50px PNGs and the rectangle that contains the bitmap is set to 50x50. I've tried all the stretch options and it's always the same result.

Thanks for your help!

Re: bitmap quality

Posted: 22 Nov 2013, 10:14
by jsantos
Are you using v1.1.2? Because we fixed an antialiasing problem in that version.

But I think that the problem you are observing is that we convert images to power of two textures. For example, your 50x50 image is being converted to 64x64. If you are using a pixel perfect layout, this can be a problem. The best way to solve this is using power of two textures with several images inside, an atlas. There is a sample in the image tutorial about it.

Could you post the xaml here to verify the problem?

Re: bitmap quality

Posted: 22 Nov 2013, 15:51
by walhore
Did a quick test and it's the power of 2 issue. I was hoping to get away with how I've been doing wpf in the past. I've been lazy and just been creating individual bitmaps as I need them but this is obviously inefficient. I'll get them into a texture atlas that's a proper size.

Good call, thanks for the help!