瀏覽代碼

nodepass.value -> nodepass.input and webgl_postprocessing_nodes to webgl_postprocessing_nodes_pass

sunag 7 年之前
父節點
當前提交
e59f7c06c5
共有 2 個文件被更改,包括 13 次插入16 次删除
  1. 3 6
      examples/js/nodes/postprocessing/NodePass.js
  2. 10 10
      examples/webgl_postprocessing_nodes_pass.html

+ 3 - 6
examples/js/nodes/postprocessing/NodePass.js

@@ -2,9 +2,7 @@
  * @author sunag / http://www.sunag.com.br/
  */
 
-import { NodeUtils } from '../core/NodeUtils.js';
 import { NodeMaterial } from '../materials/NodeMaterial.js';
-import { RawNode } from '../materials/nodes/RawNode.js';
 import { ScreenNode } from '../inputs/ScreenNode.js';
 
 function NodePass() {
@@ -18,10 +16,9 @@ function NodePass() {
 
 	this.textureID = 'renderTexture';
 
-	this.fragment = new RawNode( new ScreenNode() );
+	this.input = new ScreenNode();
 
 	this.material = new NodeMaterial();
-	this.material.fragment = this.fragment;
 
 	this.needsUpdate = true;
 
@@ -30,14 +27,14 @@ function NodePass() {
 NodePass.prototype = Object.create( THREE.ShaderPass.prototype );
 NodePass.prototype.constructor = NodePass;
 
-NodeUtils.addShortcuts( NodePass.prototype, 'fragment', [ 'value' ] );
-
 NodePass.prototype.render = function () {
 
 	if ( this.needsUpdate ) {
 
 		this.material.dispose();
 
+		this.material.fragment.value = this.input;
+
 		this.needsUpdate = false;
 
 	}

+ 10 - 10
examples/webgl_postprocessing_nodes.html → examples/webgl_postprocessing_nodes_pass.html

@@ -154,7 +154,7 @@
 						var brightnessNode = new THREE.ColorAdjustmentNode( vibranceNode, brightness, THREE.ColorAdjustmentNode.BRIGHTNESS );
 						var contrastNode = new THREE.ColorAdjustmentNode( brightnessNode, contrast, THREE.ColorAdjustmentNode.CONTRAST );
 
-						nodepass.value = contrastNode;
+						nodepass.input = contrastNode;
 
 						// GUI
 
@@ -204,7 +204,7 @@
 							THREE.Math3Node.MIX
 						);
 
-						nodepass.value = fade;
+						nodepass.input = fade;
 
 						// GUI
 
@@ -238,7 +238,7 @@
 							THREE.Math3Node.MIX
 						);
 
-						nodepass.value = fade;
+						nodepass.input = fade;
 
 						// GUI
 
@@ -260,7 +260,7 @@
 							THREE.OperatorNode.ADD
 						);
 
-						nodepass.value = multiply;
+						nodepass.input = multiply;
 
 						// GUI
 
@@ -298,7 +298,7 @@
 						saturation.inputs.rgb = screen;
 						saturation.inputs.adjustment = sat;
 
-						nodepass.value = saturation;
+						nodepass.input = saturation;
 
 						// GUI
 
@@ -351,7 +351,7 @@
 
 						var screen = new THREE.ScreenNode( offsetCoord );
 
-						nodepass.value = screen;
+						nodepass.input = screen;
 
 						// GUI
 
@@ -403,7 +403,7 @@
 							THREE.Math3Node.MIX
 						);
 
-						nodepass.value = new THREE.ScreenNode( fadeScreen );
+						nodepass.input = new THREE.ScreenNode( fadeScreen );
 
 						// GUI
 
@@ -438,7 +438,7 @@
 						var blurScreen = new THREE.BlurNode( new THREE.ScreenNode() );
 						blurScreen.size = new THREE.Vector2( size.width, size.height );
 
-						nodepass.value = blurScreen;
+						nodepass.input = blurScreen;
 
 						// GUI
 
@@ -468,7 +468,7 @@
 
 				var json = nodepass.toJSON();
 
-				nodepass.value = new THREE.NodeMaterialLoader( null, library ).parse( json ).value;
+				nodepass.input = new THREE.NodeMaterialLoader( null, library ).parse( json ).value;
 */
 			}
 
@@ -556,4 +556,4 @@
 		</script>
 
 	</body>
-</html>
+</html>