Pixelating textures is easy, but we need to write a 5-10 lines of code.
We put the texture in the objects which represents the pixelated texture and
now we're going to write code. The reason the textures are not pixelated is
the mipmapping method is linear if you've guessed it, we should set the mipmapping
to none.
Import the game engine module and we use the
render class. From that class we should set
setMipmapping() to 0 or
bge.render.RAS_MIPMAP_NONE. So the code looks like this.
try:
import bge
except:
import Range as bge
cont = bge.logic.getCurrentController()
own = cont.owner
def main(cont):
bge.render.setMipmapping(0)
In the image you can see the black lines when the mipmapping is set to linear and the the artifacts goes away when set to none.
Here we put the mipmap method inside main function.
And our "always" sensor triggers this function only once, you can enable "Tap" too.
Here is the project file for this tutorial,
Download now.