Anti-aliasing problem

Hello,

I’m currently discovering Corona and I have developed a prototype of the classic Snake game.

The problem I encounter is with the snake display :

As it is composed of several “modules”/“tiles”, I have to draw them separately.

But the anti-aliasing provided by the graphical engine brokes the result as follows :

http://www.servimg.com/image_preview.php?i=215&u=15540327 (too big picture)

So my question is can we fix this issue or maybe how can we disable the anti-aliasing (I tried to change the config.lua but with no results) ?

Thanks for your time.

PS: I apologize if something in my english is wrong, I’m french  :slight_smile:

Hi @darmet.ulysse,

Is your intention to have the snake look “pixelated” like it’s from an 80s arcade game? If so, you can alter how Corona renders graphics with the following lines:

[lua]

display.setDefault( “minTextureFilter”, “nearest” )

display.setDefault( “magTextureFilter”, “nearest” )

[/lua]

This is documented here:

http://docs.coronalabs.com/api/library/display/setDefault.html

Let me know if this is what you’re seeking or not.

Brent

That’s exactly what I wanted to do !  :smiley:

Thanks you a lot for your help (and with such a rapid answer!)

(By the way, is it possible to fix this issue still using the linear filtering?)

Hi @darmet.ulysse,

In theory, you could build “pixel perfect” images for almost every display/content size, but because there are now hundreds of mobile devices with hundreds of different display sizes, this is not a practical approach. I suggest you stay with this “nearest” method for your game. :slight_smile:

Brent

Hi @darmet.ulysse,

Is your intention to have the snake look “pixelated” like it’s from an 80s arcade game? If so, you can alter how Corona renders graphics with the following lines:

[lua]

display.setDefault( “minTextureFilter”, “nearest” )

display.setDefault( “magTextureFilter”, “nearest” )

[/lua]

This is documented here:

http://docs.coronalabs.com/api/library/display/setDefault.html

Let me know if this is what you’re seeking or not.

Brent

That’s exactly what I wanted to do !  :smiley:

Thanks you a lot for your help (and with such a rapid answer!)

(By the way, is it possible to fix this issue still using the linear filtering?)

Hi @darmet.ulysse,

In theory, you could build “pixel perfect” images for almost every display/content size, but because there are now hundreds of mobile devices with hundreds of different display sizes, this is not a practical approach. I suggest you stay with this “nearest” method for your game. :slight_smile:

Brent