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

MonoGame I went from XNA to MonoGame.

update #6

still wip

Rebuild of my favorite Final Fantasy Map

Final Fantasy 3

Just as Pecaminosa's musicians #improvise this rendition of #LittleSunflower ๐ŸŒป, so do we improvise with this post you're reading. ๐Ÿ˜‚

What's coming out of your own improvs? ๐Ÿค”

#Pecaminosa | #IndieDev | #OST | #Jazz

So

i may or may not make an full art of some person or i may just leave this like that-

Shoobies leave a sticky trail of mucus in their wake, which can impede movement for any creature that steps in it.

Today I was setting up the location of the first boss. His name is "Father" and he is the first of the Patagonians. His task is to guard the road to the House.๐Ÿ›ก๐Ÿ—ก Bookmark pre-launch page๐Ÿ”–๐Ÿ”–๐Ÿ”–

https://www.kickstarter.com/projects/rdvindiegame/the-patagonianโ€ฆ