Skip to content
Snippets Groups Projects
Select Git revision
  • 669a2a627be1352040cfc387342f4a3e1bbb914a
  • main default protected
  • correction_video
  • going_further
  • ImprovedMouseInteraction
  • final2023
  • template
  • ModifGUI
8 results

CoordinateIterator.java

Blame
  • Forked from YAGOUBI Rim / Game of life Template
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Sprite.frag 463 B
    #version 450 core
    out vec4 FragColor;
    
    uniform sampler2D uSampler[32];
    uniform int uTextures[128];
    uniform vec4 uFrames[128];
    uniform vec2 uSizes[128];
    
    in vec2 Texture;
    flat in int Id;
    
    void main() {
        vec2 coord = vec2(
            (uFrames[Id].x / uSizes[Id].x) + (uFrames[Id].z / uSizes[Id].x) *  Texture.x, 
            (uFrames[Id].y / uSizes[Id].y) + (uFrames[Id].w / uSizes[Id].y) *  Texture.y  
        );
        FragColor = texture(uSampler[uTextures[Id]], coord);
    }