|
|
@@ -457,31 +457,19 @@ ${ flowData.code }
|
|
|
*/
|
|
|
generateTexture( texture, textureProperty, uvSnippet, depthSnippet, offsetSnippet ) {
|
|
|
|
|
|
- if ( texture.isDepthTexture ) {
|
|
|
-
|
|
|
- if ( depthSnippet ) uvSnippet = `vec4( ${ uvSnippet }, ${ depthSnippet } )`;
|
|
|
-
|
|
|
- if ( offsetSnippet ) {
|
|
|
+ if ( depthSnippet ) uvSnippet = `vec3( ${ uvSnippet }, ${ depthSnippet } )`;
|
|
|
|
|
|
- return `textureOffset( ${ textureProperty }, ${ uvSnippet }, ${ offsetSnippet } ).x`;
|
|
|
+ if ( texture.isDepthTexture ) {
|
|
|
|
|
|
- }
|
|
|
+ if ( offsetSnippet ) return `textureOffset( ${ textureProperty }, ${ uvSnippet }, ${ offsetSnippet } ).x`;
|
|
|
|
|
|
return `texture( ${ textureProperty }, ${ uvSnippet } ).x`;
|
|
|
|
|
|
- } else {
|
|
|
-
|
|
|
- if ( depthSnippet ) uvSnippet = `vec3( ${ uvSnippet }, ${ depthSnippet } )`;
|
|
|
-
|
|
|
- if ( offsetSnippet ) {
|
|
|
-
|
|
|
- return `textureOffset( ${ textureProperty }, ${ uvSnippet }, ${ offsetSnippet } )`;
|
|
|
-
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- return `texture( ${ textureProperty }, ${ uvSnippet } )`;
|
|
|
+ if ( offsetSnippet ) return `textureOffset( ${ textureProperty }, ${ uvSnippet }, ${ offsetSnippet } )`;
|
|
|
|
|
|
- }
|
|
|
+ return `texture( ${ textureProperty }, ${ uvSnippet } )`;
|
|
|
|
|
|
}
|
|
|
|