Changeset fe5e3ca in opengl-game for explosion.vert


Ignore:
Timestamp:
Jan 11, 2019, 4:10:11 PM (6 years ago)
Author:
dportnoy15 <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
646f3f2, c5fb958
Parents:
8fbd34f
Message:

Apply the model, view, and projection matrices to explosions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • explosion.vert

    r8fbd34f rfe5e3ca  
    11#version 410 core
    22
    3 // TODO: Pass the explosion center in as a uniform
     3#define MAX_NUM_OBJECTS 1024
     4
     5uniform mat4 view, proj;
     6uniform mat4 model_mat;
     7
     8/*
     9layout (std140) uniform models {
     10  mat4 model_mats[MAX_NUM_OBJECTS];
     11};
     12*/
    413
    514uniform float explosion_start_time;
     
    817layout (location = 0) in vec3 v_i; // initial velocity
    918layout (location = 1) in float start_time;
     19//layout(location = 2) in uint ubo_index;
    1020
    1121out float opacity;
     
    3343   p += normalize(v_i) * mod(t, duration) / duration * 0.3; // allow time to loop around so particle emitter keeps going
    3444
    35    gl_Position = vec4(p, 1.0);
     45   //gl_Position = proj * view * model_mats[0] * vec4(p, 1.0);
     46   gl_Position = proj * view * model_mat * vec4(p, 1.0);
    3647   gl_PointSize = 15.0; // size in pixels
    3748}
Note: See TracChangeset for help on using the changeset viewer.