Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove AO in favor of voxel-fakeao

  • Loading branch information...
commit 18242ea7576824b5dbac293d8cd871290fd63bc2 1 parent b5bbc4d
@shama shama authored
Showing with 1 addition and 20 deletions.
  1. +0 −19 index.js
  2. +1 −1  package.json
View
19 index.js
@@ -40,25 +40,6 @@ function Mesh(data, mesher, scaleFactor, three) {
geometry.computeFaceNormals()
- // compute vertex colors for ambient occlusion
- var light = new THREE.Color(0xffffff)
- var shadow = new THREE.Color(0x505050)
- for (var i = 0; i < geometry.faces.length; ++i) {
- var face = geometry.faces[i]
- // facing up
- if (face.normal.y === 1) face.vertexColors = [light, light, light, light]
- // facing down
- else if (face.normal.y === -1) face.vertexColors = [shadow, shadow, shadow, shadow]
- // facing right
- else if (face.normal.x === 1) face.vertexColors = [shadow, light, light, shadow]
- // facing left
- else if (face.normal.x === -1) face.vertexColors = [shadow, shadow, light, light]
- // facing backward
- else if (face.normal.z === 1) face.vertexColors = [shadow, shadow, light, light]
- // facing forward
- else face.vertexColors = [shadow, light, light, shadow]
- }
-
geometry.verticesNeedUpdate = true
geometry.elementsNeedUpdate = true
geometry.normalsNeedUpdate = true
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "voxel-mesh",
"description": "generate a three.js mesh from voxel data",
- "version": "0.2.1",
+ "version": "0.3.0",
"main": "index.js",
"repository": {
"type": "git",
Please sign in to comment.
Something went wrong with that request. Please try again.