z;z++)for(d=J[z],k=0;3>k;)d.vertexColors[k]=f.colors[d[e[k]]],k++}}return b.renderFn&&b.renderFn(),b.stats?b.stats.end():void 0}})})}.call(this)}(window);
\ No newline at end of file
diff --git a/examples/lib/three.js b/examples/lib/three.js
index bc5a5df..38b7a36 100755
--- a/examples/lib/three.js
+++ b/examples/lib/three.js
@@ -11352,11 +11352,11 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) {
}
// hacked in by peter
- for ( i = 0; i < geometry.bones.length; i++) {
- for ( j = 0; j < 3; j++) {
- geometry.bones[i].pos[j] *= scale;
- }
- }
+// for ( i = 0; i < geometry.bones.length; i++) {
+// for ( j = 0; j < 3; j++) {
+// geometry.bones[i].pos[j] *= scale;
+// }
+// }
// could change this to json.animations[0] or remove completely
geometry.animation = json.animation;
@@ -18613,7 +18613,8 @@ THREE.ShaderLib = {
{
"ambient" : { type: "c", value: new THREE.Color( 0xffffff ) },
"emissive" : { type: "c", value: new THREE.Color( 0x000000 ) },
- "wrapRGB" : { type: "v3", value: new THREE.Vector3( 1, 1, 1 ) }
+ "wrapRGB" : { type: "v3", value: new THREE.Vector3( 1, 1, 1 ) },
+ time: { type: "f", value: 0 }
}
] ),
@@ -18629,6 +18630,8 @@ THREE.ShaderLib = {
"varying vec3 vLightBack;",
"#endif",
+ "varying vec2 vSkinWeight;",
+ "varying vec2 vSkinIndex;",
THREE.ShaderChunk[ "map_pars_vertex" ],
THREE.ShaderChunk[ "lightmap_pars_vertex" ],
@@ -18639,8 +18642,12 @@ THREE.ShaderLib = {
THREE.ShaderChunk[ "skinning_pars_vertex" ],
THREE.ShaderChunk[ "shadowmap_pars_vertex" ],
+ "varying vec3 vPos;",
+
"void main() {",
+
+ "vPos = position;",
THREE.ShaderChunk[ "map_vertex" ],
THREE.ShaderChunk[ "lightmap_vertex" ],
THREE.ShaderChunk[ "color_vertex" ],
@@ -18659,6 +18666,11 @@ THREE.ShaderLib = {
THREE.ShaderChunk[ "lights_lambert_vertex" ],
THREE.ShaderChunk[ "shadowmap_vertex" ],
+ "vSkinWeight = skinWeight.xy;",
+ "vSkinIndex = skinIndex.xy;",
+
+// "vUv = uv;",
+
"}"
].join("\n"),
@@ -18667,6 +18679,9 @@ THREE.ShaderLib = {
"uniform float opacity;",
+ "varying vec3 vPos;",
+ "uniform float time;",
+
"varying vec3 vLightFront;",
"#ifdef DOUBLE_SIDED",
@@ -18675,6 +18690,11 @@ THREE.ShaderLib = {
"#endif",
+
+
+ "varying vec2 vSkinWeight;",
+ "varying vec2 vSkinIndex;",
+
THREE.ShaderChunk[ "color_pars_fragment" ],
THREE.ShaderChunk[ "map_pars_fragment" ],
THREE.ShaderChunk[ "lightmap_pars_fragment" ],
@@ -18683,8 +18703,12 @@ THREE.ShaderLib = {
THREE.ShaderChunk[ "shadowmap_pars_fragment" ],
THREE.ShaderChunk[ "specularmap_pars_fragment" ],
+
+
"void main() {",
+// "vec2 position = -1.0 + 2.0 * vUv;",
+
"gl_FragColor = vec4( vec3 ( 1.0 ), opacity );",
THREE.ShaderChunk[ "map_fragment" ],
@@ -18716,6 +18740,11 @@ THREE.ShaderLib = {
THREE.ShaderChunk[ "fog_fragment" ],
+ "float red = 0.;" ,
+ "float green = vSkinIndex.x/21.; ",
+ "float blue = 0.; ",
+ "gl_FragColor = vec4(red, green, blue, 1.0); ",
+
"}"
].join("\n")
@@ -23924,7 +23953,16 @@ THREE.WebGLRenderer = function ( parameters ) {
};
- material.program = buildProgram( shaderID, material.fragmentShader, material.vertexShader, material.uniforms, material.attributes, material.defines, parameters, material.index0AttributeName );
+ material.program = buildProgram(
+ shaderID,
+ material.fragmentShader,
+ material.vertexShader,
+ material.uniforms,
+ material.attributes,
+ material.defines,
+ parameters,
+ material.index0AttributeName
+ );
var attributes = material.program.attributes;
diff --git a/shaders.html b/shaders.html
new file mode 100644
index 0000000..0d77fd2
--- /dev/null
+++ b/shaders.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rigged Hand - Quickstart
+Bring your hand over the Leap, and you should see it displayed
+
+
+
+
+
\ No newline at end of file
diff --git a/src/leap.rigged-hand.coffee b/src/leap.rigged-hand.coffee
index 69750eb..cd0996a 100644
--- a/src/leap.rigged-hand.coffee
+++ b/src/leap.rigged-hand.coffee
@@ -227,11 +227,30 @@ Leap.plugin 'riggedHand', (scope = {})->
data.materials[0].emissive.setHex(0x888888)
data.materials[0].vertexColors = THREE.VertexColors
+ data.materials[0].vertexColors = THREE.NoColors;
data.materials[0].depthTest = true
+# "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP )",
+ m = data.materials[0]
+ console.log(m.map, m.lightMap, m.specularMap, m.envMap)
+# debugger
+
+
+# material = new THREE.ShaderMaterial({
+# uniforms: uniforms,
+# vertexShader: document.getElementById('vertexShader').innerHTML,
+# fragmentShader: document.getElementById('fragmentShader').innerHTML
+# });
+
+# material = new THREE.MeshLambertMaterial
+# material.skinning = true
+
+
_extend(data.materials[0], scope.materialOptions)
_extend(data.geometry, scope.geometryOptions)
+
handMesh = new THREE.SkinnedMesh(data.geometry, data.materials[0])
+
handMesh.scale.multiplyScalar(scope.scale)
handMesh.positionRaw = new THREE.Vector3
handMesh.fingers = handMesh.children[0].children