source: opengl-game/shaders/scene.vert@ cf727ca

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

In VulkanGame, use SSBOs in the ship and scene shaders to store per-object data (currently just the model matrix)

  • Property mode set to 100644
File size: 638 bytes
RevLine 
[4befb76]1#version 450
[de32fda]2#extension GL_ARB_separate_shader_objects : enable
3
[055750a]4struct Object {
[de32fda]5 mat4 model;
[055750a]6};
7
8layout (binding = 0) uniform UniformBufferObject {
[de32fda]9 mat4 view;
10 mat4 proj;
11} ubo;
[4befb76]12
[055750a]13layout(binding = 1) readonly buffer StorageBufferObject {
14 Object objects[];
15} sbo;
16
[adcd252]17layout(location = 0) in vec3 inPosition;
[80edd70]18layout(location = 1) in vec3 inColor;
[fba08f2]19layout(location = 2) in vec2 inTexCoord;
[4befb76]20
[80edd70]21layout(location = 0) out vec3 fragColor;
[fba08f2]22layout(location = 1) out vec2 fragTexCoord;
[4befb76]23
24void main() {
[f00ee54]25 fragColor = inColor;
[fba08f2]26 fragTexCoord = inTexCoord;
[f00ee54]27
[055750a]28 gl_Position = ubo.proj * ubo.view * sbo.objects[0].model * vec4(inPosition, 1.0);
[f00ee54]29}
Note: See TracBrowser for help on using the repository browser.