/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{IDENTITY as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{glsl as e}from"../../shaderModules/glsl.js";import{Matrix3PassUniform as o}from"../../shaderModules/Matrix3PassUniform.js";function a(a,s){s.hasColorTextureTransform?(a.varyings.add("colorUV","vec2"),a.vertex.uniforms.add(new o("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??r)).code.add(e`void forwardColorUV(){
colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
}`)):a.vertex.code.add(e`void forwardColorUV(){}`)}function s(a,s){s.hasNormalTextureTransform&&0!==s.textureCoordinateType?(a.varyings.add("normalUV","vec2"),a.vertex.uniforms.add(new o("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??r)).code.add(e`void forwardNormalUV(){
normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
}`)):a.vertex.code.add(e`void forwardNormalUV(){}`)}function i(a,s){s.hasEmissionTextureTransform&&0!==s.textureCoordinateType?(a.varyings.add("emissiveUV","vec2"),a.vertex.uniforms.add(new o("emissiveTextureTransformMatrix",e=>e.emissiveTextureTransformMatrix??r)).code.add(e`void forwardEmissiveUV(){
emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
}`)):a.vertex.code.add(e`void forwardEmissiveUV(){}`)}function d(a,s){s.hasOcclusionTextureTransform&&0!==s.textureCoordinateType?(a.varyings.add("occlusionUV","vec2"),a.vertex.uniforms.add(new o("occlusionTextureTransformMatrix",e=>e.occlusionTextureTransformMatrix??r)).code.add(e`void forwardOcclusionUV(){
occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
}`)):a.vertex.code.add(e`void forwardOcclusionUV(){}`)}function t(a,s){s.hasMetallicRoughnessTextureTransform&&0!==s.textureCoordinateType?(a.varyings.add("metallicRoughnessUV","vec2"),a.vertex.uniforms.add(new o("metallicRoughnessTextureTransformMatrix",e=>e.metallicRoughnessTextureTransformMatrix??r)).code.add(e`void forwardMetallicRoughnessUV(){
metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
}`)):a.vertex.code.add(e`void forwardMetallicRoughnessUV(){}`)}export{a as colorTextureUV,i as emissiveTextureUV,t as metallicRoughnessTextureUV,s as normalTextureUV,d as occlusionTextureUV};
