finishex exposing cam zoom settings to the wiget menu and the font size canvas scalaar

This commit is contained in:
2024-11-30 04:51:03 -05:00
parent dd2f6e9c71
commit 292d1b58b5
9 changed files with 209 additions and 22 deletions

View File

@ -31,8 +31,8 @@ import sg "thirdparty:sokol/gfx"
Bind slot: SMP_ve_blit_atlas_src_sampler => 0
*/
ATTR_ve_blit_atlas_v_position :: 0
ATTR_ve_blit_atlas_v_texture :: 1
UB_ve_blit_atlas_fs_params :: 0
ATTR_ve_blit_atlas_v_texture :: 1
UB_ve_blit_atlas_fs_params :: 0
IMG_ve_blit_atlas_src_texture :: 0
SMP_ve_blit_atlas_src_sampler :: 0
Ve_Blit_Atlas_Fs_Params :: struct #align(16) {

View File

@ -33,12 +33,14 @@ void main()
if ( down_sample == 1 )
{
// TODO(Ed): The original author made these consts, I want to instead expose as uniforms...
const vec2 texture_size = 1.0f / vec2( 2048.0f, 512.0f ); // VEFontCache.Context.buffer_width/buffer_height
const vec2 texture_size = 1.0f / vec2( 2048.0f, 512.0f ); // VEFontCache.Context.buffer_width/buffer_height
const float down_sample_scale = 1.0f / 4.0f;
alpha =
(texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler), uv + vec2( -0.5f, -0.5f) * texture_size ).x * 0.25f)
+ (texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler), uv + vec2( -0.5f, 0.5f) * texture_size ).x * 0.25f)
+ (texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler), uv + vec2( 0.5f, -0.5f) * texture_size ).x * 0.25f)
+ (texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler), uv + vec2( 0.5f, 0.5f) * texture_size ).x * 0.25f);
(texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler), uv + vec2( -0.5f, -0.5f) * texture_size ).x * down_sample_scale)
+ (texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler), uv + vec2( -0.5f, 0.5f) * texture_size ).x * down_sample_scale)
+ (texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler), uv + vec2( 0.5f, -0.5f) * texture_size ).x * down_sample_scale)
+ (texture(sampler2D( ve_draw_text_src_texture, ve_draw_text_src_sampler), uv + vec2( 0.5f, 0.5f) * texture_size ).x * down_sample_scale);
}
frag_color = vec4( colour.xyz, colour.a * alpha );
}