Ver código fonte

2 single node examples

sunag 7 anos atrás
pai
commit
4f71b42f76
1 arquivos alterados com 52 adições e 0 exclusões
  1. 52 0
      examples/webgl_materials_nodes.html

+ 52 - 0
examples/webgl_materials_nodes.html

@@ -192,6 +192,8 @@
 					'adv / expression': 'expression',
 					'adv / sss': 'sss',
 					'adv / translucent': 'translucent',
+					'node / position': 'node-position',
+					'node / normal': 'node-normal',
 					'misc / smoke': 'smoke',
 					'misc / firefly': 'firefly',
 					'misc / reserved-keywords': 'reserved-keywords',
@@ -2039,6 +2041,56 @@
 
 						break;
 
+					case 'node-position':
+
+						// MATERIAL
+
+						var node = new THREE.PositionNode();
+
+						mtl = new THREE.PhongNodeMaterial();
+						mtl.color = node;
+
+						// GUI
+
+						addGui( 'scope', {
+							local: THREE.PositionNode.LOCAL,
+							world: THREE.PositionNode.WORLD,
+							view: THREE.PositionNode.VIEW
+						}, function ( val ) {
+
+							node.scope = val;
+
+							mtl.needsUpdate = true;
+
+						} );
+
+						break;
+
+					case 'node-normal':
+
+						// MATERIAL
+
+						var node = new THREE.NormalNode();
+
+						mtl = new THREE.PhongNodeMaterial();
+						mtl.color = node;
+
+						// GUI
+
+						addGui( 'scope', {
+							local: THREE.NormalNode.LOCAL,
+							world: THREE.NormalNode.WORLD,
+							view: THREE.NormalNode.VIEW
+						}, function ( val ) {
+
+							node.scope = val;
+
+							mtl.needsUpdate = true;
+
+						} );
+
+						break;
+
 					case 'varying':
 
 						// MATERIAL