|
@@ -321,7 +321,7 @@ class WGSLNodeBuilder extends NodeBuilder {
|
|
|
*/
|
|
*/
|
|
|
generateWrapFunction( texture ) {
|
|
generateWrapFunction( texture ) {
|
|
|
|
|
|
|
|
- const functionName = `tsl_coord_${ wrapNames[ texture.wrapS ] }S_${ wrapNames[ texture.wrapT ] }_${texture.isData3DTexture ? '3d' : '2d'}T`;
|
|
|
|
|
|
|
+ const functionName = `tsl_coord_${ wrapNames[ texture.wrapS ] }S_${ wrapNames[ texture.wrapT ] }_${ texture.isData3DTexture ? '3d' : '2d' }T`;
|
|
|
|
|
|
|
|
let nodeCode = wgslCodeCache[ functionName ];
|
|
let nodeCode = wgslCodeCache[ functionName ];
|
|
|
|
|
|
|
@@ -331,7 +331,7 @@ class WGSLNodeBuilder extends NodeBuilder {
|
|
|
|
|
|
|
|
// For 3D textures, use vec3f; for texture arrays, keep vec2f since array index is separate
|
|
// For 3D textures, use vec3f; for texture arrays, keep vec2f since array index is separate
|
|
|
const coordType = texture.isData3DTexture ? 'vec3f' : 'vec2f';
|
|
const coordType = texture.isData3DTexture ? 'vec3f' : 'vec2f';
|
|
|
- let code = `fn ${functionName}( coord : ${coordType} ) -> ${coordType} {\n\n\treturn ${coordType}(\n`;
|
|
|
|
|
|
|
+ let code = `fn ${ functionName }( coord : ${ coordType } ) -> ${ coordType } {\n\n\treturn ${ coordType }(\n`;
|
|
|
|
|
|
|
|
const addWrapSnippet = ( wrap, axis ) => {
|
|
const addWrapSnippet = ( wrap, axis ) => {
|
|
|
|
|
|
|
@@ -516,7 +516,7 @@ class WGSLNodeBuilder extends NodeBuilder {
|
|
|
const textureDimension = this.generateTextureDimension( texture, textureProperty, levelSnippet );
|
|
const textureDimension = this.generateTextureDimension( texture, textureProperty, levelSnippet );
|
|
|
|
|
|
|
|
const vecType = texture.isData3DTexture ? 'vec3' : 'vec2';
|
|
const vecType = texture.isData3DTexture ? 'vec3' : 'vec2';
|
|
|
- const coordSnippet = `${vecType}<u32>(${wrapFunction}(${uvSnippet}) * ${vecType}<f32>(${textureDimension}))`;
|
|
|
|
|
|
|
+ const coordSnippet = `${ vecType }<u32>(${ wrapFunction }(${ uvSnippet }) * ${ vecType }<f32>(${ textureDimension }))`;
|
|
|
|
|
|
|
|
return this.generateTextureLoad( texture, textureProperty, coordSnippet, depthSnippet, levelSnippet );
|
|
return this.generateTextureLoad( texture, textureProperty, coordSnippet, depthSnippet, levelSnippet );
|
|
|
|
|
|