Changeset de32fda in opengl-game for shaders


Ignore:
Timestamp:
Jul 24, 2019, 4:34:02 AM (5 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
c7fb883
Parents:
cae7a2c
git-author:
Dmitry Portnoy <dmp1488@…> (07/24/19 04:28:46)
git-committer:
Dmitry Portnoy <dmp1488@…> (07/24/19 04:34:02)
Message:

Create a ubo and update it with the MVP matrix every frame

File:
1 edited

Legend:

Unmodified
Added
Removed
  • shaders/shader.vert

    rcae7a2c rde32fda  
    11#version 450
     2#extension GL_ARB_separate_shader_objects : enable
     3
     4layout (binding = 0) uniform UniformBufferObject {
     5   mat4 model;
     6   mat4 view;
     7   mat4 proj;
     8} ubo;
    29
    310layout(location = 0) in vec2 inPosition;
     
    714
    815void main() {
    9    gl_Position = vec4(inPosition, 0.0, 1.0);
     16   gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 0.0, 1.0);
    1017   fragColor = inColor;
    1118}
Note: See TracChangeset for help on using the changeset viewer.