This commit is contained in:
alessandro bason 2026-03-05 16:45:29 +01:00
parent 507d635433
commit 1c13514a4d
45 changed files with 2615 additions and 2014 deletions

67
data/batcher.glsl Normal file
View file

@ -0,0 +1,67 @@
@ctype vec2 vec2
@ctype vec4 vec4
@vs vs
layout(binding=0) uniform render_data {
vec2 one_over_window_size;
float zoom;
};
in vec4 quad;
in vec4 tex_quad;
in vec4 colour;
out vec2 uv;
out vec4 fs_colour;
const int indices[6] = {
0, 1, 2, 2, 3, 0,
};
const vec3 positions[4] = {
vec3(0, 0, 0),
vec3(0, 1, 0),
vec3(1, 1, 0),
vec3(1, 0, 0),
};
const vec2 uvs[4] = {
vec2(0.0f, 0.0f),
vec2(0.0f, 1.0f),
vec2(1.0f, 1.0f),
vec2(1.0f, 0.0f),
};
void main() {
int vtx = indices[gl_VertexIndex];
vec3 pos = positions[vtx];
uv = uvs[vtx];
pos.xy = ((pos.xy * quad.zw) + quad.xy) * zoom;
pos.xy = (pos.xy * one_over_window_size) * 2.0 - 1.0;
pos.y = -pos.y;
uv *= tex_quad.zw;
uv += tex_quad.xy;
gl_Position = vec4(pos, 1);
fs_colour = colour;
}
@end
@fs fs
layout(binding=0) uniform texture2D tex;
layout(binding=0) uniform sampler smp;
in vec2 uv;
in vec4 fs_colour;
out vec4 frag_colour;
void main() {
vec4 c = texture(sampler2D(tex, smp), uv) * fs_colour;
if (c.a < 1) discard;
frag_colour = c;
}
@end
@program batcher vs fs

Binary file not shown.

BIN
data/font.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

View file

@ -1,5 +1,5 @@
@ctype mat4 HMM_Mat4
@ctype vec3 HMM_Vec3
@ctype mat4 mat4
@ctype vec3 vec3
@vs vs
layout(binding=0) uniform vs_params {

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1,011 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

View file

@ -1,22 +0,0 @@
@vs vs
in vec4 position;
in vec4 color0;
out vec4 color;
void main() {
gl_Position = position;
color = color0;
}
@end
@fs fs
in vec4 color;
out vec4 frag_color;
void main() {
frag_color = color;
}
@end
@program triangle vs fs