Quote from: Lima on July 19, 2023, 02:14:49 AM
I'm very sorry! The information was clear in the docs. I really don't know why I didn't understand it when I read it at first. TextureInfo objects can only receive 4 images. It just ignores the rest if you add more.
varying vec2 texCoord;
uniform sampler2D textureUnit0;
uniform sampler2D textureUnit1;
uniform sampler2D textureUnit2;
uniform sampler2D textureUnit3;
uniform sampler2D textureUnit4;
const vec3 BLACK = vec3(0.0,0.0,0.0);
const vec3 YELLOW = vec3(0.5,0.5,0.0);
void main (){
vec2 newTexCoords = texCoord * 20.0;
vec4 map = texture2D(textureUnit0, texCoord);
vec4 asphalt = texture2D(textureUnit1, newTexCoords);
vec4 grass = texture2D(textureUnit2, newTexCoords);
vec4 ground = texture2D(textureUnit3, newTexCoords);
vec4 wall = texture2D(textureUnit4, newTexCoords);
vec3 a = mix(BLACK, asphalt.rgb, map.r);
vec3 b = mix(BLACK, grass.rgb, map.g);
vec3 c = mix(BLACK, ground.rgb, map.b);
vec3 d = mix(BLACK, wall.rgb, map.a);
vec3 result = a+b+c+d;
gl_FragColor = vec4(result,1.0);
}
vec3 result = a+b+c+d;
vec3 result = a+b+c+mix(BLACK, YELLOW, map.a);
Config.maxTextureLayers = 10;
Page created in 0.028 seconds with 12 queries.