Prechádzať zdrojové kódy

fix node-material examples

sunag 7 rokov pred
rodič
commit
25c33dee95

+ 2 - 1
examples/js/nodes/materials/PhongNode.js

@@ -208,7 +208,8 @@ THREE.PhongNode.prototype.build = function ( builder ) {
 			'material.specularShininess = shininess;',
 			'material.specularStrength = specularStrength;',
 
-			"#include <lights_template>"
+			"#include <begin_lights_fragment>",
+			"#include <end_lights_fragment>"
 		);
 
 		if ( light ) {

+ 3 - 6
examples/js/nodes/materials/StandardNode.js

@@ -287,7 +287,8 @@ THREE.StandardNode.prototype.build = function ( builder ) {
 		}
 
 		output.push(
-			"#include <lights_template>"
+			"#include <begin_lights_fragment>",
+			"#include <end_lights_fragment>"
 		);
 
 		if ( light ) {
@@ -355,13 +356,9 @@ THREE.StandardNode.prototype.build = function ( builder ) {
 
 				output.push(
 					clearCoatEnv.code,
-					"vec3 clearCoatRadiance = " + clearCoatEnv.result + ";"
+					"clearCoatRadiance += " + clearCoatEnv.result + ";"
 				);
 
-			} else {
-
-				output.push( "vec3 clearCoatRadiance = vec3( 0.0 );" );
-
 			}
 
 			output.push( "RE_IndirectSpecular(" + environment.result + ", clearCoatRadiance, geometry, material, reflectedLight );" );