¿Cómo puedo pedir matrices para el atlas de texturas usando Instanced Drawing en los juegos 2D?
https://webgl2fundamentals.org/webgl/lessons/webgl-instanced-drawing.html
#version 300 es uniform mat4 u_projection; uniform mat4 u_camera; in mat4 u_matrix;//<--Instanced Drawing in mat3 u_atlas;//<-- need to index out vec2 v_texcoord; const float xp[6] = float[](0.0, 0.0, 1.0, 1.0, 1.0, 0.0); const float yp[6] = float[](0.0, 1.0, 0.0, 1.0, 0.0, 1.0); void main() { float x = xp[gl_VertexID]; float y = yp[gl_VertexID]; gl_Position = u_projection * -u_camera * u_matrix * vec4(x,y,1,1); v_texcoord = vec3(u_atlas * vec3(x,y,1)).xy; }Editar
Render 1000 Square con 24 imágenes Perdóname por mi mal inglés