瀏覽代碼

fix triplanarTexture scale

sunag 2 年之前
父節點
當前提交
7f2f808ba5
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      examples/jsm/nodes/utils/TriplanarTexturesNode.js
  2. 2 2
      examples/webgpu_materials.html

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

@@ -55,7 +55,7 @@ class TriplanarTexturesNode extends Node {
 export default TriplanarTexturesNode;
 export default TriplanarTexturesNode;
 
 
 export const triplanarTextures = nodeProxy( 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 );
 addNodeElement( 'triplanarTexture', triplanarTexture );
 
 

+ 2 - 2
examples/webgpu_materials.html

@@ -29,7 +29,7 @@
 			import * as THREE from 'three';
 			import * as THREE from 'three';
 			import * as Nodes from 'three/nodes';
 			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 WebGPU from 'three/addons/capabilities/WebGPU.js';
 			import WebGPURenderer from 'three/addons/renderers/webgpu/WebGPURenderer.js';
 			import WebGPURenderer from 'three/addons/renderers/webgpu/WebGPURenderer.js';
@@ -202,7 +202,7 @@
 
 
 				// Triplanar Texture Mapping
 				// Triplanar Texture Mapping
 				material = new MeshBasicNodeMaterial();
 				material = new MeshBasicNodeMaterial();
-				material.colorNode = triplanarTexture( texture( uvTexture ) );
+				material.colorNode = triplanarTexture( texture( uvTexture ), null, null, float( .01 ) );
 				materials.push( material );
 				materials.push( material );
 
 
 				// Screen Projection Texture
 				// Screen Projection Texture