Changeset fd6f465 in opengl-game for laser.vert


Ignore:
Timestamp:
Jul 20, 2018, 1:42:00 AM (7 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
3effd81
Parents:
9f9f9a7
Message:

Change the laser rendering algorithm to draw lasers starting from the origin and then translate them into the correct position using the model matrix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • laser.vert

    r9f9f9a7 rfd6f465  
    11#version 410
     2
     3#define MAX_NUM_OBJECTS 1024
    24
    35uniform mat4 view, proj;
    46
     7layout (std140) uniform models {
     8  mat4 model_mats[MAX_NUM_OBJECTS];
     9};
     10
    511layout(location = 0) in vec3 vertex_position;
    612layout(location = 1) in vec2 vt;
     13layout(location = 2) in uint ubo_index;
    714
    815out vec2 texture_coordinates;
     
    1017
    1118void main() {
    12   position_eye = vec3(view * vec4(vertex_position, 1.0));
     19  position_eye = vec3(view * model_mats[ubo_index] * vec4(vertex_position, 1.0));
    1320  texture_coordinates = vt;
    1421
Note: See TracChangeset for help on using the changeset viewer.