I have two texture maps of different sizes.
colorMap - 1024x1024 px
alphaMap - 32x32 px
I want to use the color from the colorMap and the transparency from the alphaMap.
However, I get the result, as if the maps passed to the shader are the same. If I use the cards individually, then everything works in the expected way.
varying vec3 vWorldPosition;
varying vec2 vUv;
uniform sampler2D colorMap;
uniform sampler2D alphaMap;
void main(){
gl_FragColor.rgb = texture2D(colorMap, vUv).rgb;
gl_FragColor.a = texture2D(alphaMap, vUv).a;
}
I also tried mixing two cards. As a result, I get a duplication of a lower resolution map
void main(){
gl_FragColor = mix(texture2D(colorMap, vUv), texture2D(alphaMap, vUv), 0.5);
}
I would appreciate any help on my issue.