It'd be interesting to look into the question empirically of whether this optimization would be worthwhile.
Also it depends somewhat on the specifics of the application. Two factors come to mind:
(1) Draw distance (drawing many faraway polys that are only a few pixels on-screen probably favors poly-count reduction more)
(2) Extra pixel shader complexity. If you're doing fancy per-pixel stuff with lighting or shadows or whatever, your optimization should become more attractive, because starting with your optimization and adding that extra stuff reduces the percentage of the per-pixel computation that's spent on your optimization.
I don't know how well non-power-of two texture coordinates work in GLES and WebGL, but you could put a single column of pixels from the other side of the texture on both sides.
say you have ABCD and so you store, DABCDA, it'd use up some memory but could result in a speed boost since you could likely avoid breaking the normal mipmapping and such. I don't think you'd have to go as far as having half the texture on either side, but it'd be worth experimenting.
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).
If you have 256 different block types in 1 chunk, using texture atlas there's only 1 mesh instead of 256 different meshes.
https://docs.google.com/viewer?url=http%3A%2F%2Fnvidia.com%2...
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.
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 - 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:
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?