Meshing in a Minecraft Game (2012)
0fps.wordpress.com
Meshing in a Minecraft Game (2012)
1–10 of 21 posts
Re: Meshing in a Minecraft Game (2012)
#2The solution is to create 1 dimensional texture atlas like this: http://manicdigger.sourceforge.net/webgl/data/atlas1.png. Then tile in only 1 direction. Minecraft does it and I first read about it in one of Word of Notch posts - http://notch.tumblr.com/post/176620207/i-rewrote-the-tessela....
It's good enough. Manic Digger (http://manicdigger.sourceforge.net) has great framerate at Pentium 4 and Geforce 2 MX.
But there is one problem: in mipmaps there is bleeding between individual textures. The solution is to use:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 4);
It's good on desktop, but there is no GL_TEXTURE_MAX_LEVEL on OpenGL ES and WebGL! I guess it must be done with custom mipmaps or with a pixel shader?Re: Meshing in a Minecraft Game (2012)
#3And we used the same data-structures in the modder voxel editors.
So its not really an 'open question' as the article says, more just an obvious step.
Re: Meshing in a Minecraft Game (2012)
#4Re: Meshing in a Minecraft Game (2012)
#5In practice you need a texture atlas ( http://en.wikipedia.org/wiki/Texture_atlas ) to reduce number of meshes. But if you use texture atlas you can't combine surfaces like in the article. The solution is to create 1 dimensional texture atlas like this: http://manicdigger.sourceforge.net/webgl/data/atlas1.png . Then tile in only 1 direction. Minecraft does it and I first read about it in one of Word of Notch posts -…
Re: Meshing in a Minecraft Game (2012)
#6In practice you need a texture atlas ( http://en.wikipedia.org/wiki/Texture_atlas ) to reduce number of meshes. But if you use texture atlas you can't combine surfaces like in the article. The solution is to create 1 dimensional texture atlas like this: http://manicdigger.sourceforge.net/webgl/data/atlas1.png . Then tile in only 1 direction. Minecraft does it and I first read about it in one of Word of Notch posts -…
Are there no alternative to texture atlases? It seems weird to restrict yourself to merging in only one direction just because the representation of your texture won't allow it.
As for the bleeding, I suppose it's because the scaling kernel overlaps between the tiles in the atlas? Won't reducing the level of mipmapping degrade overall performances?
It seems weird to me that there's no better hardware support for texture atlases if it's so popular.
Re: Meshing in a Minecraft Game (2012)
#7In C&C Tiberian Sun the voxel models were stored - and drawn - from a RLE sparse array. And we used the same data-structures in the modder voxel editors. So its not really an 'open question' as the article says, more just an obvious step.
It's developed for film applications which naturally have a different set of requirements than realtime game engines. But as PC performance grows, the solutions developed for film rendering will become more directly adaptable for games.
Re: Meshing in a Minecraft Game (2012)
#8In practice you need a texture atlas ( http://en.wikipedia.org/wiki/Texture_atlas ) to reduce number of meshes. But if you use texture atlas you can't combine surfaces like in the article. The solution is to create 1 dimensional texture atlas like this: http://manicdigger.sourceforge.net/webgl/data/atlas1.png . Then tile in only 1 direction. Minecraft does it and I first read about it in one of Word of Notch posts -…
Very insightful, thank you. Are there no alternative to texture atlases? It seems weird to restrict yourself to merging in only one direction just because the representation of your texture won't allow it. As for the bleeding, I suppose it's because the scaling kernel overlaps between the tiles in the atlas? Won't reducing the level of mipmapping degrade overall performances? It seems weird to me that there's no bett…
Re: Meshing in a Minecraft Game (2012)
#9In practice you need a texture atlas ( http://en.wikipedia.org/wiki/Texture_atlas ) to reduce number of meshes. But if you use texture atlas you can't combine surfaces like in the article. The solution is to create 1 dimensional texture atlas like this: http://manicdigger.sourceforge.net/webgl/data/atlas1.png . Then tile in only 1 direction. Minecraft does it and I first read about it in one of Word of Notch posts -…
I believe you meant "to reduce number of texutre swaps"? Otherwise I fail to find how texture atlas is helping in reducing number of meshes in the drawn scene.
> But if you use texture atlas you can't combine surfaces like in the article.
Actually you can, pixel/fragment shader can be used later on to transform texture coordinates just before the texel value will be fetched (obviously this is only possible if you use shaders, but most games nowadays do).
Re: Meshing in a Minecraft Game (2012)
#10In practice you need a texture atlas ( http://en.wikipedia.org/wiki/Texture_atlas ) to reduce number of meshes. But if you use texture atlas you can't combine surfaces like in the article. The solution is to create 1 dimensional texture atlas like this: http://manicdigger.sourceforge.net/webgl/data/atlas1.png . Then tile in only 1 direction. Minecraft does it and I first read about it in one of Word of Notch posts -…