Game
Project Final Fantasy
10 years ago

Mipmaps in XNA


I added mipmaps because i was not so happy with the way the game looked. The problem with mipmaps in XNA is that you can not set the max mipmap level. So in the game i use one image to store multiple tiles for example 10x10 tiles with a size of 16x16 would make the image 160x160. Now when you turn mipmaps on the XNA Pipeline is generating 8 mipmaps:

Original = 160x160 (tilesize 16x16)

Mip 1 = 80x80 (tilesize 8x8)

Mip 2 = 40x40 (tilesize 4x4)

Mip 3 = 20x20 (tilesize 2x2)

Mip 4 = 10x10 (tilesize 1x1)

Mip 5 = 5x5 (tilesize < 1x1)

Mip 6 = 2x2 (tilesize < 1x1)

Mip 7 = 1x1 (tilesize < 1x1)

Mip 8 = 1x1 (tilesize < 1x1)

So after the Mip 4 it would be bad to generate more mipmaps because the tilesize would be less than 1x1 (below you can see how it looks). After doing some research I found out that the only way to solve this problem is to set the max mipmap level in an shader. After i doing this I still was not very happy with the result because the way XNA is generating the mipmaps does not work very good with more than one texture in on image. XNA is just scaling the image down and by doing this the colors of the tiles will mix and i endet up with them becoming a little bit green (as you can see below). So I wrote my own mipmap generator and the problem is gone. It does not look perfect but I am very happy I found a solution to the problem. What do you think?

No mipmap:

5d0c2f2bccd01.jpg

Normal mipmap + generated by the XNA Pipeline:

5d0c2f2d78990.jpg

Normal mipmap + mipmap generated by me:

5d0c2f2f8ac3e.jpg

Max mipmap level set to 4 + generated by the XNA Pipeline:

5d0c2f30e1012.jpg

Max mipmap level set to 4 + generated by me (what im currenty using):

5d0c2f32520cc.jpg


0 comments

Loading...

Next up

Rebuild of my favorite Final Fantasy Map

MonoGame I went from XNA to MonoGame.

still wip

Final Fantasy 3

update #6

Path of Kami: The Evolution of the Lore

Heya! I wanted to show some gameplay progress i made so far. I hope you like it ^^

Family band complete!

Back in my art school days I used to ride the 710 COPSA line from Parque Del Plata to Montevideo almost everyday. This is the Marcopolo Viaggio G4 Mercedes Benz model from the late 80s, one of the older bus models that was running on the line.