From be620b76116971a2b3a7b663bb8e8372b122b9fd Mon Sep 17 00:00:00 2001 From: sunag Date: Thu, 8 Jun 2023 16:20:57 -0300 Subject: [PATCH 1/2] Nodes: Fix uv attributes --- examples/jsm/nodes/accessors/UVNode.js | 2 +- examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/jsm/nodes/accessors/UVNode.js b/examples/jsm/nodes/accessors/UVNode.js index 63c5d943545948..74b507e4a604de 100644 --- a/examples/jsm/nodes/accessors/UVNode.js +++ b/examples/jsm/nodes/accessors/UVNode.js @@ -18,7 +18,7 @@ class UVNode extends AttributeNode { const index = this.index; - return 'uv' + ( index > 0 ? index + 1 : '' ); + return 'uv' + ( index > 0 ? index : '' ); } diff --git a/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js b/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js index c964db64284c80..eb7698de6252fd 100644 --- a/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js +++ b/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js @@ -501,7 +501,7 @@ class WebGLNodeBuilder extends NodeBuilder { for ( const attribute of attributes ) { // ignore common attributes to prevent redefinitions - if ( attribute.name === 'uv' || attribute.name === 'position' || attribute.name === 'normal' ) + if ( /^(position|normal|uv\d?)$/.test( attribute.name ) ) continue; snippet += `attribute ${attribute.type} ${attribute.name}; `; From 7fbcb17b9c45f53dabdecfaacc97ba3f55f7992e Mon Sep 17 00:00:00 2001 From: sunag Date: Thu, 8 Jun 2023 16:21:06 -0300 Subject: [PATCH 2/2] cleanup --- playground/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/playground/index.html b/playground/index.html index caf52018180e43..9f34831634ffa5 100644 --- a/playground/index.html +++ b/playground/index.html @@ -127,7 +127,6 @@ // renderer.setAnimationLoop( render ); - renderer.outputEncoding = THREE.sRGBEncoding; renderer.toneMapping = THREE.LinearToneMapping; renderer.toneMappingExposure = 1; document.body.appendChild( renderer.domElement );