Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert to pre-atlas voxel-texture. Fixes voxel/voxelmetaverse#14
voxel-texture 0.5.0 switched to use texture atlases, packing all the block textures into one graphic for efficiency purposes. However, this introduces two problems: - With the culled mesher (default as of voxel-engine 0.17+), I get serious lag spikes (30-60 ms frames, or unplayably higher) when placing/breaking blocks, and also slow page load as the meshes are built (see voxel/voxelmetaverse#10) - With the greedy mesher, performance is much better (fixes first issue) but textures are stretched across each of the greedily constructed meshes, instead of tiled across each block (see voxel/voxelmetaverse#14) Example: https://f.cloud.github.com/assets/5897956/1651233/1f478c9e-5aca-11e3-82cc-4028f1e1b1da.png There are techniques for texturing greedy meshes, detailed in this article: http://0fps.wordpress.com/2013/07/09/texture-atlases-wrapping-and-mip-mapping/ - Using array textures is ideal, but they won't be supported until WebGL 2.0 at earliest https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7 - Otherwise, they can be tiled manually, but this requires a few tricks, would certainly be worthwhile to implement, but is fairly complex. Maybe later, once I understand it better. So for now, (unfortunately) I've reverted back to voxel-texture without atlases. This keeps mesh recalculation fast (when breaking/placing blocks) and avoids stretched textures but may slow down complex scenes with many materials (see performance improvement @shama noted in max-mapper#69).
- Loading branch information