feature/imgui-sdl
points-test
Last change
on this file since 683dd55 was 1908591, checked in by Dmitry Portnoy <dmp1488@…>, 5 years ago |
Update the OpenGLReference project to include the shaders that were moved to the gl-shaders folder, and update the VulkanGame project to include the ship shader copied from the original OpenGL game
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[1908591] | 1 | #version 450
|
---|
| 2 | #extension GL_ARB_separate_shader_objects : enable
|
---|
| 3 |
|
---|
| 4 | layout (binding = 0) uniform UniformBufferObject {
|
---|
| 5 | mat4 model;
|
---|
| 6 | mat4 view;
|
---|
| 7 | mat4 proj;
|
---|
| 8 | } ubo;
|
---|
| 9 |
|
---|
| 10 | layout(location = 0) in vec3 vertex_position;
|
---|
| 11 | layout(location = 1) in vec3 vertex_color;
|
---|
| 12 |
|
---|
| 13 | //out vec3 position_eye, normal_eye, color, light_position_eye, light2_position_eye;
|
---|
| 14 | layout(location = 0) out vec3 position_eye;
|
---|
| 15 | layout(location = 1) out vec3 color;
|
---|
| 16 |
|
---|
| 17 | // fixed point light position
|
---|
| 18 | //vec3 light_position_world = vec3(0.0, 0.0, 2.0);
|
---|
| 19 | //vec3 light2_position_world = vec3(0.0, 1.5, -0.1);
|
---|
| 20 |
|
---|
| 21 | void main() {
|
---|
| 22 | // ORIG: position_eye = vec3(view * model_mats[ubo_index] * vec4(vertex_position, 1.0));
|
---|
| 23 | position_eye = vec3(ubo.view * ubo.model * vec4(vertex_position, 1.0));
|
---|
| 24 | //normal_eye = normalize(vec3(view * model_mats[ubo_index] * vec4(vertex_normal, 0.0)));
|
---|
| 25 | color = vertex_color;
|
---|
| 26 | //light_position_eye = vec3(view * vec4(light_position_world, 1.0));
|
---|
| 27 | //light2_position_eye = vec3(view * vec4(light2_position_world, 1.0));
|
---|
| 28 |
|
---|
| 29 | gl_Position = ubo.proj * vec4(position_eye, 1.0);
|
---|
| 30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.