Skip to content

Commit

Permalink
TSL: use vec3 for DataArrayTexture UV coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
zonkypop committed Feb 21, 2025
1 parent a759c34 commit f243ca6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/nodes/accessors/TextureNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,15 @@ class TextureNode extends UniformNode {
*/
generateUV( builder, uvNode ) {

return uvNode.build( builder, this.sampler === true ? 'vec2' : 'ivec2' );
let vecType = ( this.sampler === true ) ? 'vec2' : 'ivec2';

if ( this.value.isDataArrayTexture ) {

vecType = 'vec3';

}

return uvNode.build( builder, vecType );

}

Expand Down

0 comments on commit f243ca6

Please sign in to comment.