Changeset dc19a39 in opengl-game for explosion.vert


Ignore:
Timestamp:
Apr 26, 2019, 4:20:37 PM (6 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
7e10667
Parents:
f97e638
Message:

Make explosion objects use the global model mat uniform buffer and a varying ubo index attribute to access it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • explosion.vert

    rf97e638 rdc19a39  
    44
    55uniform mat4 view, proj;
    6 uniform mat4 model_mat;
    76layout (std140) uniform models {
    87  mat4 model_mats[MAX_NUM_OBJECTS];
     
    1413layout (location = 0) in vec3 v_i; // initial velocity
    1514layout (location = 1) in float start_time;
    16 //layout(location = 2) in uint ubo_index;
     15layout(location = 2) in uint ubo_index;
    1716
    1817out float opacity;
     
    4039   p += normalize(v_i) * mod(t, duration) / duration * 0.3; // allow time to loop around so particle emitter keeps going
    4140
    42    //gl_Position = proj * view * model_mats[ubo_index] * vec4(p, 1.0);
    43    gl_Position = proj * view * model_mats[0] * vec4(p, 1.0);
     41   gl_Position = proj * view * model_mats[ubo_index] * vec4(p, 1.0);
    4442   gl_PointSize = 15.0; // size in pixels
    4543}
Note: See TracChangeset for help on using the changeset viewer.