Scale select sprite without anti-aliasing


#1

My game uses anti-aliasing for most sprites. To save atlas space (and file size) I’d like to stretch a square sprite larger, and retain pixel sharpness on just that one sprite. Is there a way to achieve pixel sharpness (anti-aliasing turned off) on a specific sprite?

This is the (predictable) result currently:

58


#2

Technically yes but you’re either going to get an extra draw call or an extra atlas / material.

What are you stretching? You can use GUI 9patch for repeating things like this too.


#3

I have a rectangular area I’d like to fill with a solid colour inside my game world. Maybe I’ll have to go down the route of using a tilemap instead?


#4

Could this be an option, or is it likely to be too slow? All I want to do is to create a filled rectangle.


#5

You can draw to a buffer once and then keep it static. You don’t have to do it every frame so it’s fine.


#6

Set texture sampling mode to “nearest” instead of “linear” and disable mipmaps for that particular atlas?


#7

Good idea! Could be an option if the TileMap (that I’m using currently) turns out to be too heavy.