remvoing ve_ prefix from glsl and generated odin code, not necessary to have

This commit is contained in:
2025-02-13 16:13:29 -05:00
parent d806fc6083
commit 1ed9d48a71
7 changed files with 1294 additions and 1320 deletions

View File

@@ -4,7 +4,7 @@
@header package ve_sokol
@header import sg "thirdparty:sokol/gfx"
@vs ve_draw_text_vs
@vs draw_text_vs
in vec2 v_position;
in vec2 v_texture;
out vec2 uv;
@@ -20,14 +20,14 @@ void main()
}
@end
@fs ve_draw_text_fs
@fs draw_text_fs
in vec2 uv;
out vec4 frag_color;
layout(binding = 0) uniform texture2D ve_draw_text_src_texture;
layout(binding = 0) uniform sampler ve_draw_text_src_sampler;
layout(binding = 0) uniform texture2D draw_text_src_texture;
layout(binding = 0) uniform sampler draw_text_src_sampler;
layout(binding = 0) uniform ve_draw_text_fs_params {
layout(binding = 0) uniform draw_text_fs_params {
vec2 glyph_buffer_size;
float over_sample;
vec4 colour;
@@ -35,18 +35,18 @@ layout(binding = 0) uniform ve_draw_text_fs_params {
void main()
{
float alpha = texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler ), uv ).x;
float alpha = texture(sampler2D( draw_text_src_texture, draw_text_src_sampler ), uv ).x;
const vec2 texture_size = glyph_buffer_size;
const float down_sample = 1.0f / over_sample;
alpha =
(texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler), uv + vec2( -0.5f, -0.5f) * texture_size ).x * down_sample)
+ (texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler), uv + vec2( -0.5f, 0.5f) * texture_size ).x * down_sample)
+ (texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler), uv + vec2( 0.5f, -0.5f) * texture_size ).x * down_sample)
+ (texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler), uv + vec2( 0.5f, 0.5f) * texture_size ).x * down_sample);
(texture(sampler2D( draw_text_src_texture, draw_text_src_sampler), uv + vec2( -0.5f, -0.5f) * texture_size ).x * down_sample)
+ (texture(sampler2D( draw_text_src_texture, draw_text_src_sampler), uv + vec2( -0.5f, 0.5f) * texture_size ).x * down_sample)
+ (texture(sampler2D( draw_text_src_texture, draw_text_src_sampler), uv + vec2( 0.5f, -0.5f) * texture_size ).x * down_sample)
+ (texture(sampler2D( draw_text_src_texture, draw_text_src_sampler), uv + vec2( 0.5f, 0.5f) * texture_size ).x * down_sample);
frag_color = vec4( colour.xyz, colour.a * alpha );
}
@end
@program ve_draw_text ve_draw_text_vs ve_draw_text_fs
@program draw_text draw_text_vs draw_text_fs