Skip to content

Commit

Permalink
Add chunkPad option, update to voxel-mesher ^0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
deathcap committed May 26, 2014
1 parent 348bdaf commit 216be65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function Game(opts) {
this.arrayType = opts.arrayType || {1:Uint8Array, 2:Uint16Array, 4:Uint32Array}[opts.arrayTypeSize] || Uint8Array
this.cubeSize = 1 // backwards compat
this.chunkSize = opts.chunkSize || 32
this.chunkPad = opts.chunkPad || 4

// chunkDistance and removeDistance should not be set to the same thing
// as it causes lag when you go back and forth on a chunk boundary
Expand Down Expand Up @@ -629,7 +630,7 @@ Game.prototype.showChunk = function(chunk, optionalPosition) {
//console.log('showChunk',chunkIndex,'density=',JSON.stringify(chunkDensity(chunk)))

var voxelArray = isndarray(chunk) ? chunk : ndarray(chunk.voxels, chunk.dims)
var mesh = this.mesherPlugin.createVoxelMesh(this.shell.gl, voxelArray, this.stitcher.voxelSideTextureIDs, this.stitcher.voxelSideTextureSizes, chunk.position)
var mesh = this.mesherPlugin.createVoxelMesh(this.shell.gl, voxelArray, this.stitcher.voxelSideTextureIDs, this.stitcher.voxelSideTextureSizes, chunk.position, this.chunkPad)

if (!mesh) {
// no voxels
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"Mikola Lysenko <[email protected]> (https://github.com/mikolalysenko/)"
],
"dependencies": {
"voxel-mesher": "^0.10.0",
"voxel-mesher": "^0.11.0",
"voxel-shader": "^0.11.0",
"gl-now": "^1.3.0",
"ndarray": "^1.0.10",
Expand Down

0 comments on commit 216be65

Please sign in to comment.