Commit 47a05ba
committed
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).1 parent 586908e commit 47a05ba
3 files changed
+18
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
250 | 256 | | |
251 | 257 | | |
252 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
229 | | - | |
| 230 | + | |
| 231 | + | |
230 | 232 | | |
231 | 233 | | |
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
236 | | - | |
| 238 | + | |
| 239 | + | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
| |||
546 | 549 | | |
547 | 550 | | |
548 | 551 | | |
549 | | - | |
550 | | - | |
| 552 | + | |
| 553 | + | |
551 | 554 | | |
552 | 555 | | |
553 | 556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
0 commit comments