Scripts: Srcgen

This commit is contained in:
Isuru Samarathunga
2025-11-01 01:23:31 +05:30
parent 9d85e3d822
commit dd2d2e1ae8
21 changed files with 456 additions and 9 deletions

View File

@ -0,0 +1 @@
Roboto.ttf was downloaded from Google Fonts (Original Filename: Roboto-Black.ttf)

View File

@ -0,0 +1,26 @@
#version 450
#extension GL_ARB_separate_shader_objects : enable
layout(location = 0) in vec2 inTexCoord;
layout(location = 1) in vec4 inVertexColor;
layout(location = 0) out vec4 outColor;
layout(set = 2, binding = 0) uniform sampler2D texSampler;
layout(set = 3, binding = 0) uniform UniformBufferObject {
bool flippedH;
bool flippedV;
vec2 uvOffset;
vec4 colorOverlay;
} ubo;
void main()
{
vec2 uv = inTexCoord;
uv += ubo.uvOffset;
if(ubo.flippedH) uv.x = 1.0 - uv.x;
if(ubo.flippedV) uv.y = 1.0 - uv.y;
outColor = texture(texSampler, uv) * inVertexColor * ubo.colorOverlay;
if(outColor.w < 0.1)
discard;
}

View File

@ -0,0 +1,26 @@
#version 450
#extension GL_ARB_separate_shader_objects : enable
layout (location = 0) in vec2 inPosition;
layout (location = 1) in vec2 inTexCoord;
layout (location = 2) in vec4 inVertexColor;
layout(location = 0) out vec2 outTexCoord;
layout(location = 1) out vec4 outVertexColor;
layout(set = 1, binding = 0) uniform UBO_Vertex_PerScene {
mat4 projection;
} uboPerScene;
layout(set = 1, binding = 1) uniform UBO_Vertex_PerFrame {
mat4 view;
} uboPerFrame;
layout(set = 1, binding = 2) uniform UBO_Vertex_PerDraw {
mat4 model;
} uboPerDraw;
void main()
{
gl_Position = uboPerScene.projection * uboPerFrame.view * uboPerDraw.model * vec4(inPosition, 0.0f, 1.0f);
outTexCoord = inTexCoord;
outVertexColor = inVertexColor;
}