Game
Project Final Fantasy
11 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

Final Fantasy 3

Rebuild of my favorite Final Fantasy Map

MonoGame I went from XNA to MonoGame.

update #6

still wip

Path of Kami: The Evolution of the Lore

Runestones: from concept to in-game model🗿

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

In the quest for accessibility, I'm adding Resurrection Shrines for players on the 'novice' end of the platforming spectrum.

In order to unlock the power of a Shrine, you must collect 3 'Souls' from your dead corpses! (the floating blue orbs)