Explorar el Código

fix triplanarTexture scale

sunag hace 2 años
padre
commit
7f2f808ba5

+ 1 - 1
examples/jsm/nodes/utils/TriplanarTexturesNode.js

@@ -55,7 +55,7 @@ class TriplanarTexturesNode extends Node {
 export default TriplanarTexturesNode;
 
 export const triplanarTextures = nodeProxy( TriplanarTexturesNode );
-export const triplanarTexture = ( texture, ...params ) => triplanarTextures( texture, texture, texture, ...params );
+export const triplanarTexture = ( ...params ) => triplanarTextures( ...params );
 
 addNodeElement( 'triplanarTexture', triplanarTexture );
 

+ 2 - 2
examples/webgpu_materials.html

@@ -29,7 +29,7 @@
 			import * as THREE from 'three';
 			import * as Nodes from 'three/nodes';
 
-			import { attribute, positionLocal, positionWorld, normalLocal, normalWorld, normalView, color, texture, ShaderNode, func, uv, vec2, vec3, vec4, oscSine, triplanarTexture, viewportBottomLeft, js, string, global, loop, MeshBasicNodeMaterial, NodeObjectLoader } from 'three/nodes';
+			import { attribute, positionLocal, positionWorld, normalLocal, normalWorld, normalView, color, texture, ShaderNode, func, uv, float, vec2, vec3, vec4, oscSine, triplanarTexture, viewportBottomLeft, js, string, global, loop, MeshBasicNodeMaterial, NodeObjectLoader } from 'three/nodes';
 
 			import WebGPU from 'three/addons/capabilities/WebGPU.js';
 			import WebGPURenderer from 'three/addons/renderers/webgpu/WebGPURenderer.js';
@@ -202,7 +202,7 @@
 
 				// Triplanar Texture Mapping
 				material = new MeshBasicNodeMaterial();
-				material.colorNode = triplanarTexture( texture( uvTexture ) );
+				material.colorNode = triplanarTexture( texture( uvTexture ), null, null, float( .01 ) );
 				materials.push( material );
 
 				// Screen Projection Texture