Scaling Tileset or Texture


#1

Witch one is better practice:

1.Scale textures according to screen size and use Tileset with screen resolution.
2.Use smaller textures and scale Tileset up.

Thanks.


#2

If you can support smaller texture sizes, the memory and bandwidth on GPU will be much better. In practice, it depends a bit, because if your texture is too small, the quality might not be what you want. In general, though, you won’t gain anything by scaling textures up in advance, let the GPU do that and it should be a lot better.

Scaling down, however, you can get a quality and performance benefit by scaling your BitmapData first, so that you are sure the smaller graphic is smooth, and so that you have less texture data to upload


#3

What’s the best way to scale up/down game graphics ? For example if i would like to use 2:1 scale.
By best way i mean, whats the most optimal scaling method performance wise.
should i scale each Tileset by using .scaleX .scaleY ?
or should i scale main container like Lib.current.scaleX ?

I haven’t managed to get openfl automatic scaling to work. For example, if i get app dimensions from Lib.application.window.width/height. Generate .5 scale graphics and scale it up to 1.


#4

You could do tilemap.scaleX = tilemap.scaleY = 2, and make the tilemap dimensions half of the screen size, I think that should do what you want.

…or leave the Tilemap as the full screen size, but make your BitmapData smaller, so all of your tiles in your tilemap are scaled 2x


#5

Yeah, that was my solution so far. But after some testing it seems that scaling tilemap by 2 decreases performance noticeably.


#6

It shouldn’t cost too much on a GL renderer, but it will certainly cost more on software. What is trace (stage.window.renderer.type)?

There is a matter of fill rate on GL as well, but it shouldn’t require a bigger texture or anything