Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to voxel-texture v0.5.0 which uses texture atlases. Bump v0.17.0. #69

Merged
merged 1 commit into from
Apr 15, 2013

Conversation

shama
Copy link
Contributor

@shama shama commented Apr 15, 2013

Updates to support voxel-texture v0.5.0 which now loads everything onto a texture atlas and sets UV mappings.

Increases performance roughly by 10 fold. voxel-texture has just about been re-written and is not backwards compatible so I've bumped voxel engine a minor version.

Previously this scene with chunkDistance: 6 never would run above 7fps on my macbook but now runs around 30fps :D
screen_2013-04-15

@max-mapper
Copy link
Owner

amazing

max-mapper added a commit that referenced this pull request Apr 15, 2013
Update to voxel-texture v0.5.0 which uses texture atlases. Bump v0.17.0.
@max-mapper max-mapper merged commit 7f9788d into max-mapper:master Apr 15, 2013
@shama shama deleted the textureatlas branch April 15, 2013 23:56
deathcap added a commit to deathcap/voxel-engine that referenced this pull request Dec 3, 2013
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 max-mapperGH-10).

- With the greedy mesher, performance is much better (fixes max-mapperGH-10) but textures are stretched
across each of the greedily constructed meshes, instead of tiled across each block (see max-mapperGH-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).
deathcap added a commit to deathcap/voxel-engine that referenced this pull request Dec 3, 2013
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants