This commit is contained in:
2021-08-15 22:34:29 +02:00
parent c619f945a3
commit 40aa7f635e
11 changed files with 273 additions and 56 deletions

26
shaders/text.frag Normal file
View File

@@ -0,0 +1,26 @@
#version 450
#extension GL_ARB_separate_shader_objects : enable
layout(push_constant) uniform PushConstants {
mat4 model;
} push;
layout(binding = 0) uniform ObjectUniformData {
mat4 view;
mat4 projection;
float time;
vec3 light_position;
vec3 light_directional_rotation;
vec3 camera_position;
} ubo;
layout(binding = 1) uniform sampler2D diffuse_tex;
layout(location = 0) in vec2 tex_coords;
layout(location = 0) out vec4 out_color;
void main() {
out_color = vec4(1., 1., 1., 1.);
// out_color = vec4(1., 1., 1., texture(diffuse_tex, tex_coords).r);
}

BIN
shaders/text.frag.spv Normal file

Binary file not shown.

33
shaders/text.vert Normal file
View File

@@ -0,0 +1,33 @@
#version 450
#extension GL_ARB_separate_shader_objects : enable
layout(push_constant) uniform PushConstants {
mat4 model;
} push;
layout(binding = 0) uniform ObjectUniformData {
mat4 view;
mat4 projection;
float time;
vec3 light_position;
vec3 light_directional_rotation;
vec3 camera_position;
} ubo;
layout(location = 0) in vec3 position;
layout(location = 1) in vec2 uv;
layout(location = 2) in vec3 normal;
layout(location = 0) out vec2 tex_coords;
out gl_PerVertex {
vec4 gl_Position;
};
void main() {
// Vertex position in camera
gl_Position = ubo.projection * ubo.view * push.model * vec4(position, 1.0);
// Just interpolate UV coords, no transformation needed
tex_coords = uv;
}

BIN
shaders/text.vert.spv Normal file

Binary file not shown.