2
0
sunag 7 жил өмнө
parent
commit
bcbeb2f4f6

+ 6 - 6
examples/js/nodes/effects/BlurNode.js

@@ -8,12 +8,12 @@ import { FloatNode } from '../inputs/FloatNode.js';
 import { Vector2Node } from '../inputs/Vector2Node.js';
 import { UVNode } from '../accessors/UVNode.js';
 
-function BlurNode( value, coord, radius, size ) {
+function BlurNode( value, uv, radius, size ) {
 
 	TempNode.call( this, 'v4' );
 
 	this.value = value;
-	this.coord = coord || new UVNode();
+	this.uv = uv || new UVNode();
 	this.radius = new Vector2Node( 1, 1 );
 
 	this.size = size;
@@ -101,13 +101,13 @@ BlurNode.prototype.generate = function ( builder, output ) {
 		
 		if ( this.blurX ) {
 
-			blurCode.push( blurX + '( ' + this.value.build( builder, 'sampler2D' ) + ', ' + this.coord.build( builder, 'v2' ) + ', ' + this.horizontal.build( builder, 'f' ) + ' )' );
+			blurCode.push( blurX + '( ' + this.value.build( builder, 'sampler2D' ) + ', ' + this.uv.build( builder, 'v2' ) + ', ' + this.horizontal.build( builder, 'f' ) + ' )' );
 
 		}
 
 		if ( this.blurY ) {
 
-			blurCode.push( blurY + '( ' + this.value.build( builder, 'sampler2D' ) + ', ' + this.coord.build( builder, 'v2' ) + ', ' + this.vertical.build( builder, 'f' ) + ' )' );
+			blurCode.push( blurY + '( ' + this.value.build( builder, 'sampler2D' ) + ', ' + this.uv.build( builder, 'v2' ) + ', ' + this.vertical.build( builder, 'f' ) + ' )' );
 
 		}
 
@@ -132,7 +132,7 @@ BlurNode.prototype.copy = function ( source ) {
 	TempNode.prototype.copy.call( this, source );
 	
 	this.value = source.value;
-	this.coord = source.coord;
+	this.uv = source.uv;
 	this.radius = source.radius;
 
 	if ( source.size !== undefined ) this.size = new THREE.Vector2( source.size.x, source.size.y );
@@ -151,7 +151,7 @@ BlurNode.prototype.toJSON = function ( meta ) {
 		data = this.createJSONNode( meta );
 
 		data.value = this.value.toJSON( meta ).uuid;
-		data.coord = this.coord.toJSON( meta ).uuid;
+		data.uv = this.uv.toJSON( meta ).uuid;
 		data.radius = this.radius.toJSON( meta ).uuid;
 
 		if ( this.size ) data.size = { x: this.size.x, y: this.size.y };

+ 7 - 7
examples/js/nodes/inputs/CubeTextureNode.js

@@ -5,12 +5,12 @@
 import { InputNode } from '../core/InputNode.js';
 import { ReflectNode } from '../accessors/ReflectNode.js';
 
-function CubeTextureNode( value, coord, bias ) {
+function CubeTextureNode( value, uv, bias ) {
 
 	InputNode.call( this, 'v4', { shared: true } );
 
 	this.value = value;
-	this.coord = coord || new ReflectNode();
+	this.uv = uv || new ReflectNode();
 	this.bias = bias;
 
 };
@@ -34,7 +34,7 @@ CubeTextureNode.prototype.generate = function ( builder, output ) {
 	}
 
 	var cubetex = this.getTexture( builder, output );
-	var coord = this.coord.build( builder, 'v3' );
+	var uv = this.uv.build( builder, 'v3' );
 	var bias = this.bias ? this.bias.build( builder, 'f' ) : undefined;
 
 	if ( bias === undefined && builder.context.bias ) {
@@ -45,8 +45,8 @@ CubeTextureNode.prototype.generate = function ( builder, output ) {
 
 	var code;
 
-	if ( bias ) code = 'texCubeBias( ' + cubetex + ', ' + coord + ', ' + bias + ' )';
-	else code = 'texCube( ' + cubetex + ', ' + coord + ' )';
+	if ( bias ) code = 'texCubeBias( ' + cubetex + ', ' + uv + ', ' + bias + ' )';
+	else code = 'texCube( ' + cubetex + ', ' + uv + ' )';
 
 	code = builder.getTexelDecodingFunctionFromTexture( code, this.value );
 
@@ -60,7 +60,7 @@ CubeTextureNode.prototype.copy = function ( source ) {
 	
 	if ( source.value ) this.value = source.value;
 
-	this.coord = source.coord;
+	this.uv = source.uv;
 
 	if ( source.bias ) this.bias = source.bias;
 	
@@ -75,7 +75,7 @@ CubeTextureNode.prototype.toJSON = function ( meta ) {
 		data = this.createJSONNode( meta );
 
 		data.value = this.value.uuid;
-		data.coord = this.coord.toJSON( meta ).uuid;
+		data.uv = this.uv.toJSON( meta ).uuid;
 
 		if ( this.bias ) data.bias = this.bias.toJSON( meta ).uuid;
 

+ 5 - 5
examples/js/nodes/inputs/ReflectorNode.js

@@ -28,10 +28,10 @@ ReflectorNode.prototype.setMirror = function ( mirror ) {
 
 	this.localPosition = new PositionNode( PositionNode.LOCAL );
 
-	this.coord = new OperatorNode( this.textureMatrix, this.localPosition, OperatorNode.MUL );
-	this.coordResult = new OperatorNode( null, this.coord, OperatorNode.ADD );
+	this.uv = new OperatorNode( this.textureMatrix, this.localPosition, OperatorNode.MUL );
+	this.uvResult = new OperatorNode( null, this.uv, OperatorNode.ADD );
 
-	this.texture = new TextureNode( this.mirror.material.uniforms.tDiffuse.value, this.coord, null, true );
+	this.texture = new TextureNode( this.mirror.material.uniforms.tDiffuse.value, this.uv, null, true );
 
 };
 
@@ -39,8 +39,8 @@ ReflectorNode.prototype.generate = function ( builder, output ) {
 	
 	if ( builder.isShader( 'fragment' ) ) {
 
-		this.coordResult.a = this.offset;
-		this.texture.coord = this.offset ? this.coordResult : this.coord;
+		this.uvResult.a = this.offset;
+		this.texture.uv = this.offset ? this.uvResult : this.uv;
 
 		if ( output === 'sampler2D' ) {
 

+ 2 - 2
examples/js/nodes/inputs/ScreenNode.js

@@ -5,9 +5,9 @@
 import { InputNode } from '../core/InputNode.js';
 import { TextureNode } from './TextureNode.js';
 
-function ScreenNode( coord ) {
+function ScreenNode( uv ) {
 
-	TextureNode.call( this, undefined, coord );
+	TextureNode.call( this, undefined, uv );
 
 };
 

+ 7 - 7
examples/js/nodes/inputs/TextureNode.js

@@ -6,12 +6,12 @@ import { InputNode } from '../core/InputNode.js';
 import { NodeBuilder } from '../core/NodeBuilder.js';
 import { UVNode } from '../accessors/UVNode.js';
 
-function TextureNode( value, coord, bias, project ) {
+function TextureNode( value, uv, bias, project ) {
 
 	InputNode.call( this, 'v4', { shared: true } );
 
 	this.value = value;
-	this.coord = coord || new UVNode();
+	this.uv = uv || new UVNode();
 	this.bias = bias;
 	this.project = project !== undefined ? project : false;
 
@@ -36,7 +36,7 @@ TextureNode.prototype.generate = function ( builder, output ) {
 	}
 
 	var tex = this.getTexture( builder, output ),
-		coord = this.coord.build( builder, this.project ? 'v4' : 'v2' ),
+		uv = this.uv.build( builder, this.project ? 'v4' : 'v2' ),
 		bias = this.bias ? this.bias.build( builder, 'f' ) : undefined;
 
 	if ( bias == undefined && builder.context.bias ) {
@@ -50,8 +50,8 @@ TextureNode.prototype.generate = function ( builder, output ) {
 	if ( this.project ) method = 'texture2DProj';
 	else method = bias ? 'tex2DBias' : 'tex2D';
 
-	if ( bias ) code = method + '( ' + tex + ', ' + coord + ', ' + bias + ' )';
-	else code = method + '( ' + tex + ', ' + coord + ' )';
+	if ( bias ) code = method + '( ' + tex + ', ' + uv + ', ' + bias + ' )';
+	else code = method + '( ' + tex + ', ' + uv + ' )';
 
 	code = builder.getTexelDecodingFunctionFromTexture( code, this.value );
 
@@ -65,7 +65,7 @@ TextureNode.prototype.copy = function ( source ) {
 	
 	if ( source.value ) this.value = source.value;
 
-	this.coord = source.coord;
+	this.uv = source.uv;
 
 	if ( source.bias ) this.bias = source.bias;
 	if ( source.project !== undefined ) this.project = source.project;
@@ -82,7 +82,7 @@ TextureNode.prototype.toJSON = function ( meta ) {
 
 		if ( this.value ) data.value = this.value.uuid;
 
-		data.coord = this.coord.toJSON( meta ).uuid;
+		data.uv = this.uv.toJSON( meta ).uuid;
 		data.project = this.project;
 
 		if ( this.bias ) data.bias = this.bias.toJSON( meta ).uuid;

+ 2 - 2
examples/js/nodes/misc/BumpMapNode.js

@@ -106,7 +106,7 @@ BumpMapNode.prototype.generate = function ( builder, output ) {
 			var bumpToNormal = builder.include( BumpMapNode.Nodes.bumpToNormal );
 		
 			return builder.format( bumpToNormal + '( ' + this.value.build( builder, 'sampler2D' ) + ', ' +
-				this.value.coord.build( builder, 'v2' ) + ', ' +
+				this.value.uv.build( builder, 'v2' ) + ', ' +
 				this.scale.build( builder, 'f' ) + ' )', this.getType( builder ), output );
 				
 		} else {
@@ -118,7 +118,7 @@ BumpMapNode.prototype.generate = function ( builder, output ) {
 			this.position = this.position || new PositionNode( PositionNode.VIEW );
 		
 			var derivativeHeightCode = derivativeHeight + '( ' + this.value.build( builder, 'sampler2D' ) + ', ' +
-				this.value.coord.build( builder, 'v2' ) + ', ' +
+				this.value.uv.build( builder, 'v2' ) + ', ' +
 				this.scale.build( builder, 'f' ) + ' )';
 
 			return builder.format( perturbNormalArb + '( -' + this.position.build( builder, 'v3' ) + ', ' +

+ 6 - 6
examples/js/nodes/misc/TextureCubeNode.js

@@ -5,12 +5,12 @@
 import { TempNode } from '../core/TempNode.js';
 import { TextureCubeUVNode } from './TextureCubeUVNode.js';
  
-function TextureCubeNode( value, coord ) {
+function TextureCubeNode( value, uv ) {
 
 	TempNode.call( this, 'v4' );
 
 	this.value = value;
-	this.coord = coord || new TextureCubeUVNode();
+	this.uv = uv || new TextureCubeUVNode();
 
 };
 
@@ -22,9 +22,9 @@ TextureCubeNode.prototype.generate = function ( builder, output ) {
 
 	if ( builder.isShader( 'fragment' ) ) {
 
-		var uv_10 = this.coord.build( builder ) + '.uv_10',
-			uv_20 = this.coord.build( builder ) + '.uv_20',
-			t = this.coord.build( builder ) + '.t';
+		var uv_10 = this.uv.build( builder ) + '.uv_10',
+			uv_20 = this.uv.build( builder ) + '.uv_20',
+			t = this.uv.build( builder ) + '.t';
 		
 		var color10 = builder.getTexelDecodingFunctionFromTexture( 'texture2D( ' + this.value.build( builder, 'sampler2D' ) + ', ' + uv_10 + ' )', this.value.value ),
 			color20 = builder.getTexelDecodingFunctionFromTexture( 'texture2D( ' + this.value.build( builder, 'sampler2D' ) + ', ' + uv_20 + ' )', this.value.value );
@@ -49,7 +49,7 @@ TextureCubeNode.prototype.toJSON = function ( meta ) {
 
 		data = this.createJSONNode( meta );
 
-		data.coord = this.coord.toJSON( meta ).uuid;
+		data.uv = this.uv.toJSON( meta ).uuid;
 		data.textureSize = this.textureSize.toJSON( meta ).uuid;
 		data.blinnExponentToRoughness = this.blinnExponentToRoughness.toJSON( meta ).uuid;
 

+ 4 - 4
examples/js/nodes/misc/TextureCubeUVNode.js

@@ -10,11 +10,11 @@ import { ReflectNode } from '../accessors/ReflectNode.js';
 import { FloatNode } from '../inputs/FloatNode.js';
 import { BlinnExponentToRoughnessNode } from '../bsdfs/BlinnExponentToRoughnessNode.js';
  
-function TextureCubeUVNode( coord, textureSize, blinnExponentToRoughness ) {
+function TextureCubeUVNode( uv, textureSize, blinnExponentToRoughness ) {
 
 	TempNode.call( this, 'TextureCubeUVData' ); // TextureCubeUVData is type as StructNode
 
-	this.coord = coord || new ReflectNode( ReflectNode.VECTOR );
+	this.uv = uv || new ReflectNode( ReflectNode.VECTOR );
 	this.textureSize = textureSize || new FloatNode( 1024 );
 	this.blinnExponentToRoughness = this.blinnExponentToRoughness || new BlinnExponentToRoughnessNode();
 
@@ -174,7 +174,7 @@ TextureCubeUVNode.prototype.generate = function ( builder, output ) {
 
 		var textureCubeUV = builder.include( TextureCubeUVNode.Nodes.textureCubeUV );
 	
-		return builder.format( textureCubeUV + '( ' + this.coord.build( builder, 'v3' ) + ', ' +
+		return builder.format( textureCubeUV + '( ' + this.uv.build( builder, 'v3' ) + ', ' +
 			this.blinnExponentToRoughness.build( builder, 'f' ) + ', ' +
 			this.textureSize.build( builder, 'f' ) + ' )', this.getType( builder ), output );
 			
@@ -196,7 +196,7 @@ TextureCubeUVNode.prototype.toJSON = function ( meta ) {
 
 		data = this.createJSONNode( meta );
 
-		data.coord = this.coord.toJSON( meta ).uuid;
+		data.uv = this.uv.toJSON( meta ).uuid;
 		data.textureSize = this.textureSize.toJSON( meta ).uuid;
 		data.blinnExponentToRoughness = this.blinnExponentToRoughness.toJSON( meta ).uuid;
 

+ 5 - 5
examples/js/nodes/procedural/NoiseNode.js

@@ -6,11 +6,11 @@ import { TempNode } from '../core/TempNode.js';
 import { FunctionNode } from '../core/FunctionNode.js';
 import { UVNode } from '../accessors/UVNode.js';
 
-function NoiseNode( coord ) {
+function NoiseNode( uv ) {
 
 	TempNode.call( this, 'f' );
 
-	this.coord = coord || new UVNode();
+	this.uv = uv || new UVNode();
 
 };
 
@@ -38,7 +38,7 @@ NoiseNode.prototype.generate = function ( builder, output ) {
 
 	var snoise = builder.include( NoiseNode.Nodes.snoise );
 
-	return builder.format( snoise + '( ' + this.coord.build( builder, 'v2' ) + ' )', this.getType( builder ), output );
+	return builder.format( snoise + '( ' + this.uv.build( builder, 'v2' ) + ' )', this.getType( builder ), output );
 
 };
 
@@ -46,7 +46,7 @@ NoiseNode.prototype.copy = function ( source ) {
 			
 	TempNode.prototype.copy.call( this, source );
 	
-	this.coord = source.coord;
+	this.uv = source.uv;
 	
 };
 
@@ -58,7 +58,7 @@ NoiseNode.prototype.toJSON = function ( meta ) {
 
 		data = this.createJSONNode( meta );
 
-		data.coord = this.coord.toJSON( meta ).uuid;
+		data.uv = this.uv.toJSON( meta ).uuid;
 
 	}
 

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
examples/nodes/displace.json


+ 3 - 3
examples/webgl_materials_nodes.html

@@ -867,8 +867,8 @@
 					var scale = new THREE.Vector2( 1, 1 );
 
 					var texture = new THREE.TextureNode( getTexture( "brick" ) );
-					texture.coord = new THREE.UVTransformNode();
-					//texture.coord.uv = new THREE.UVNode( 1 ); // uv2 for example
+					texture.uv = new THREE.UVTransformNode();
+					//texture.uv.uv = new THREE.UVNode( 1 ); // uv2 for example
 
 					mtl.color = texture;
 
@@ -876,7 +876,7 @@
 
 					function updateUVTransform() {
 
-						texture.coord.setUvTransform( translate.x, translate.y, scale.x, scale.y, THREE.Math.degToRad( rotate ) );
+						texture.uv.setUvTransform( translate.x, translate.y, scale.x, scale.y, THREE.Math.degToRad( rotate ) );
 
 					}
 

+ 2 - 2
examples/webgl_mirror_nodes.html

@@ -138,8 +138,8 @@
 
 			var blurMirror = new THREE.BlurNode( mirror );
 			blurMirror.size = new THREE.Vector2( WIDTH, HEIGHT );
-			blurMirror.coord = new THREE.FunctionNode( "projCoord.xyz / projCoord.q", "vec3" );
-			blurMirror.coord.keywords[ "projCoord" ] = new THREE.OperatorNode( mirror.offset, mirror.coord, THREE.OperatorNode.ADD );
+			blurMirror.uv = new THREE.FunctionNode( "projCoord.xyz / projCoord.q", "vec3" );
+			blurMirror.uv.keywords[ "projCoord" ] = new THREE.OperatorNode( mirror.offset, mirror.uv, THREE.OperatorNode.ADD );
 			blurMirror.radius.x = blurMirror.radius.y = 0;
 
 			gui.add( { blur: blurMirror.radius.x }, "blur", 0, 25 ).onChange( function ( v ) {

+ 2 - 2
examples/webgl_postprocessing_nodes.html

@@ -390,7 +390,7 @@
 							THREE.Math1Node.FLOOR
 						);
 
-						var coord = new THREE.OperatorNode(
+						var mosaicUV = new THREE.OperatorNode(
 							blocksSize,
 							scale,
 							THREE.OperatorNode.DIV
@@ -398,7 +398,7 @@
 
 						var fadeScreen = new THREE.Math3Node(
 							uv,
-							coord,
+							mosaicUV,
 							fade,
 							THREE.Math3Node.MIX
 						);

+ 3 - 3
examples/webgl_sprites_nodes.html

@@ -141,14 +141,14 @@
 			sprite1.scale.x = spriteWidth;
 			sprite1.scale.y = spriteHeight;
 			sprite1.material.color = new THREE.TextureNode( walkingManTexture );
-			sprite1.material.color.coord = createHorizontalSpriteSheetNode( 8, 10 );
+			sprite1.material.color.uv = createHorizontalSpriteSheetNode( 8, 10 );
 
 			scene.add( sprite2 = new THREE.Mesh( plane, new THREE.SpriteNodeMaterial() ) );
 			sprite2.position.x = 30;
 			sprite2.scale.x = spriteWidth;
 			sprite2.scale.y = spriteHeight;
 			sprite2.material.color = new THREE.TextureNode( walkingManTexture );
-			sprite2.material.color.coord = createHorizontalSpriteSheetNode( 8, 30 );
+			sprite2.material.color.uv = createHorizontalSpriteSheetNode( 8, 30 );
 			sprite2.material.color = new THREE.Math1Node( sprite2.material.color, THREE.Math1Node.INVERT );
 			sprite2.material.spherical = false; // look at camera horizontally only, very used to vegetation
 			// horizontal zigzag sprite
@@ -177,7 +177,7 @@
 			sprite3.scale.x = spriteWidth;
 			sprite3.scale.y = spriteHeight;
 			sprite3.material.color = new THREE.TextureNode( walkingManTexture );
-			sprite3.material.color.coord = new THREE.FunctionCallNode( sineWaveFunction, {
+			sprite3.material.color.uv = new THREE.FunctionCallNode( sineWaveFunction, {
 				"uv": createHorizontalSpriteSheetNode( 8, 0 ),
 				"phase": new THREE.TimerNode()
 			} );

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно