2021-12-16 14:17:01 +00:00
|
|
|
#version 450
|
2022-11-21 11:02:18 +00:00
|
|
|
#extension GL_GOOGLE_include_directive : enable
|
2023-01-22 10:23:15 +00:00
|
|
|
#extension GL_EXT_multiview : enable
|
2021-12-16 14:17:01 +00:00
|
|
|
|
2022-11-21 11:02:18 +00:00
|
|
|
layout (set = 0, binding = 0) uniform
|
|
|
|
#include "matrices.h"
|
|
|
|
;
|
2022-11-28 13:57:22 +00:00
|
|
|
layout (set = 1, binding = 0) uniform sampler2D Palette;
|
2021-12-16 14:17:01 +00:00
|
|
|
|
|
|
|
layout (push_constant) uniform PushConstants {
|
|
|
|
mat4 Model;
|
|
|
|
};
|
|
|
|
|
|
|
|
layout (location = 0) in vec4 position;
|
|
|
|
layout (location = 1) in vec4 velocity;
|
|
|
|
layout (location = 2) in vec4 color;
|
|
|
|
layout (location = 3) in vec4 ramp;
|
|
|
|
|
|
|
|
layout (location = 0) out vec4 o_velocity;
|
|
|
|
layout (location = 1) out vec4 o_color;
|
|
|
|
layout (location = 2) out vec4 o_ramp;
|
|
|
|
|
|
|
|
void
|
|
|
|
main (void)
|
|
|
|
{
|
2022-11-28 01:21:20 +00:00
|
|
|
// geometry shader will take care of Projection
|
2023-01-22 10:23:15 +00:00
|
|
|
gl_Position = View[gl_ViewIndex] * (Model * position);
|
|
|
|
o_velocity = View[gl_ViewIndex] * (Model * velocity);
|
2022-11-28 13:57:22 +00:00
|
|
|
uint c = floatBitsToInt (color.x);
|
|
|
|
uint x = c & 0x0f;
|
|
|
|
uint y = (c >> 4) & 0x0f;
|
|
|
|
o_color = texture (Palette, vec2 (x, y) / 15.0);
|
2021-12-16 14:17:01 +00:00
|
|
|
o_ramp = ramp;
|
|
|
|
}
|