source: opengl-game/shaders/ship.vert@ 8e02b6b

feature/imgui-sdl points-test
Last change on this file since 8e02b6b was 8e02b6b, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 5 years ago

To move to a more generic way of updating the scene, rename updateUniformBuffers() to updateScene() in VulkanGame and move the code to copy the data into a new copyDataToMemory() function in VulkanUtils.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1#version 450
2#extension GL_ARB_separate_shader_objects : enable
3
4// TODO: Figure out if the UniformBufferObject label is necessary and, if not, remove it
5layout (binding = 0) uniform UniformBufferObject {
6 mat4 model;
7 mat4 view;
8 mat4 proj;
9} ubo;
10
11layout(location = 0) in vec3 vertex_position;
12layout(location = 1) in vec3 vertex_color;
13//layout(location = 2) in vec3 vertex_normal;
14//layout(location = 3) in uint ubo_index;
15
16//out vec3 position_eye, normal_eye, color, light_position_eye, light2_position_eye;
17layout(location = 0) out vec3 position_eye;
18layout(location = 1) out vec3 color;
19
20// fixed point light position
21//vec3 light_position_world = vec3(0.0, 0.0, 2.0);
22//vec3 light2_position_world = vec3(0.0, 1.5, -0.1);
23
24void main() {
25 //position_eye = vec3(view * model_mats[ubo_index] * vec4(vertex_position, 1.0));
26 position_eye = vec3(ubo.view * ubo.model * vec4(vertex_position, 1.0));
27 //normal_eye = normalize(vec3(view * model_mats[ubo_index] * vec4(vertex_normal, 0.0)));
28 color = vertex_color;
29 //light_position_eye = vec3(view * vec4(light_position_world, 1.0));
30 //light2_position_eye = vec3(view * vec4(light2_position_world, 1.0));
31
32 gl_Position = ubo.proj * vec4(position_eye, 1.0);
33}
Note: See TracBrowser for help on using the repository browser.