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

update #6

Final Fantasy 3

MonoGame I went from XNA to MonoGame.

still wip

Rebuild of my favorite Final Fantasy Map

Been working lately on lots of 'behind-the-scenes' boring stuff that no one really cares about, so here’s a guy playing the sax for some reason.

#screenshotsaturday

Path of Kami: The Evolution of the Lore

What do you think guys in my robot?Just a beginner in 3d modeling..

My instagram https://www.instagram.com/rojhonbb/

Sometimes the suction cup get sticky. Small animation I made in Blender after doing my tutorial on picking up/dropping objects in animations. Crate model by jQueary (https://sketchfab.com/3d-models/game-ready-sci-fi-crate-d98deca6…).