Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

101
Views
WebGL2 Instanced Drawing indexed

how can I order matrices for texture atlas by using Instanced Drawing in the 2D games?

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;
}

Edit

my sprite sheet

Render 1000 Square with 24 image Forgive me for my bad English

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!