switched to command based rendering
[fishladder.git] / fishladder_resources.h
index f0371c1eb78dd368d7e77e9fb2f10804f5144892..7b12859d44f94bb993c23fab06b9dd5627826e4f 100644 (file)
@@ -124,8 +124,11 @@ vg_tex2d tex_ball_noise =  { .path = "textures/bnoise.qoi" };
 vg_tex2d tex_monofur   =  { .path = "textures/ascii.qoi", .flags = VG_TEXTURE_NO_MIP };
 vg_tex2d tex_unkown            =  { .path = "textures/unkown.qoi" };
 vg_tex2d tex_buttons           =  { .path = "textures/buttons.qoi" };
+vg_tex2d tex_sprites           =  { .path = "textures/autocombine.qoi" };
 
-vg_tex2d *texture_list[] = { &tex_tile_detail, &tex_tile_data, &tex_wood, &tex_ball_noise, &tex_monofur, &tex_unkown, &tex_buttons, &tex_ubuntu };
+vg_tex2d *texture_list[] = { &tex_tile_detail, &tex_tile_data, &tex_wood, &tex_ball_noise, &tex_monofur, &tex_unkown, &tex_buttons, &tex_ubuntu, &tex_sprites };
+
+#include "sprites_autocombine.h"
 
 // AUDIO
 // ===========================================================================================================
@@ -463,6 +466,7 @@ SHADER_DEFINE( shader_background,
                "vec4 data_this_tile = texture( uTexMain, aTexCoords );"
                
                "ao_accum -= data_this_tile.r;"
+               "ao_accum *= uVisibility;"
                
                "vec3 colour_main = mix( vec3( 0.369768, 0.3654, 0.42 ), vec3( 0.275, 0.388, 0.553 ), data_this_tile.g * uVisibility );"
                
@@ -599,7 +603,6 @@ SHADER_DEFINE( shader_sdf,
        "out vec4 FragColor;"
        ""
        "in vec2 aTexCoords;"
-       "in vec4 aColour;"
        ""
        "void main()"
        "{"
@@ -611,6 +614,40 @@ SHADER_DEFINE( shader_sdf,
        UNIFORMS({ "uPv", "uTexGlyphs", "uColour" })
 )
 
+SHADER_DEFINE( shader_sprite,
+
+       // VERTEX
+       "layout (location=0) in vec2 a_co;" // quad mesh
+       "layout (location=1) in vec4 ins_uv;"  // instanced data (uv)
+       "layout (location=2) in vec3 ins_pos;" // position + scale
+       ""
+       "uniform mat3 uPv;"
+       ""
+       "out vec2 aTexCoords;"
+       ""
+       "void main()"
+       "{"
+               "vec2 vertex_world = ins_uv.zw * a_co * ins_pos.z + ins_pos.xy;"
+               "gl_Position = vec4( uPv * vec3( vertex_world, 1.0 ), 1.0 );"
+               "aTexCoords = ins_uv.xy + (a_co+0.5)*ins_uv.zw;"
+       "}",
+       
+       // FRAGMENT
+       "uniform sampler2D uTexMain;"
+       "uniform vec4 uColour;"
+       "out vec4 FragColor;"
+       ""
+       "in vec2 aTexCoords;"
+       ""
+       "void main()"
+       "{"
+               "vec4 glyph = texture( uTexGlyphs, aTexCoords );"
+               "FragColor = glyph;"
+       "}"
+       ,
+       UNIFORMS({ "uPv", "uTexMain", "uColour" })
+)
+
 void vg_register(void)
 {
        SHADER_INIT( shader_tile_colour );
@@ -927,6 +964,14 @@ static struct cmp_level cmp_levels_computer[] =
                .serial_id = 24,
                .title = "3 BIT ADDITION",
                .map_name = "cmp_add3b",
+               .description = "",
+
+               ._unlock = 25
+       },
+       {
+               .serial_id = 25,
+               .title = "3x3 PLOT",
+               .map_name = "cmp_plot3x3",
                .description = ""
        }
 };