feature/imgui-sdl
points-test
|
Last change
on this file since 1f81ecc was 6385d0f, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 6 years ago |
|
Change all shaders to have 3-space indentation
|
-
Property mode
set to
100644
|
|
File size:
685 bytes
|
| Line | |
|---|
| 1 | #version 450
|
|---|
| 2 | #extension GL_ARB_separate_shader_objects : enable
|
|---|
| 3 |
|
|---|
| 4 | struct Object {
|
|---|
| 5 | mat4 model;
|
|---|
| 6 | };
|
|---|
| 7 |
|
|---|
| 8 | layout (binding = 0) uniform UniformBufferObject {
|
|---|
| 9 | mat4 view;
|
|---|
| 10 | mat4 proj;
|
|---|
| 11 | } ubo;
|
|---|
| 12 |
|
|---|
| 13 | layout(binding = 1) readonly buffer StorageBufferObject {
|
|---|
| 14 | Object objects[];
|
|---|
| 15 | } sbo;
|
|---|
| 16 |
|
|---|
| 17 | layout(location = 0) in vec3 inPosition;
|
|---|
| 18 | layout(location = 1) in vec3 inColor;
|
|---|
| 19 | layout(location = 2) in vec2 inTexCoord;
|
|---|
| 20 | layout(location = 3) in uint obj_index;
|
|---|
| 21 |
|
|---|
| 22 | layout(location = 0) out vec3 fragColor;
|
|---|
| 23 | layout(location = 1) out vec2 fragTexCoord;
|
|---|
| 24 |
|
|---|
| 25 | void main() {
|
|---|
| 26 | fragColor = inColor;
|
|---|
| 27 | fragTexCoord = inTexCoord;
|
|---|
| 28 |
|
|---|
| 29 | gl_Position = ubo.proj * ubo.view * sbo.objects[obj_index].model * vec4(inPosition, 1.0);
|
|---|
| 30 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.