theme selection
[fishladder.git] / fishladder_resources.h
index 7b12859d44f94bb993c23fab06b9dd5627826e4f..d1f2210fe8b08d0362a676427627a3372507e7af 100644 (file)
@@ -119,14 +119,30 @@ vg_tex2d tex_ubuntu = { .path = "textures/ubuntu.qoi" };
 
 vg_tex2d tex_tile_data =       { .path = "textures/tileset.qoi" };
 vg_tex2d tex_tile_detail = { .path = "textures/tile_overlays.qoi" };
-vg_tex2d tex_wood =                    { .path = "textures/wood.qoi" };
+
+vg_tex2d tex_tiles_wood =      { .path = "textures/tile_wood.qoi" };
+vg_tex2d tex_tiles_min  =  { .path = "textures/tile_minimal.qoi" };
+vg_tex2d tex_tiles_lab  =  { .path = "textures/tile_lab.qoi" };
+
 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, &tex_sprites };
+vg_tex2d *texture_list[] = { 
+   &tex_tile_detail, 
+   &tex_tile_data, 
+   &tex_tiles_wood, 
+   &tex_tiles_min, 
+   &tex_tiles_lab, 
+   &tex_ball_noise, 
+   &tex_monofur, 
+   &tex_unkown, 
+   &tex_buttons, 
+   &tex_ubuntu, 
+   &tex_sprites 
+};
 
 #include "sprites_autocombine.h"
 
@@ -350,7 +366,8 @@ SHADER_DEFINE( shader_ball,
                "float shadow = exp(-((shadow_coords_sqr.x+shadow_coords_sqr.y)-0.0125)*15.0);"
                
                "vec3 marble_comp = uColour*0.9 + (noise_sample.x*0.7+pow(rim_light,3.0)*2.0) * 0.1;"
-               "vec4 colour_comp = mix( vec4(0.74,0.53,0.34,shadow), vec4(marble_comp,1.0), circle_factor );"
+               //"vec4 colour_comp = mix( vec4(0.74,0.53,0.34,shadow), vec4(marble_comp,1.0), circle_factor );"
+               "vec4 colour_comp = mix( vec4(0.2,0.2,0.2,shadow), vec4(marble_comp,1.0), circle_factor );"
                
                "FragColor = colour_comp;"
        "}"
@@ -408,13 +425,16 @@ SHADER_DEFINE( shader_tile_main,
        ""
        "void main()"
        "{"
-               "vec3 shadowing_colour = vec3( 0.93, 0.88536, 0.8184 ) * 0.97;"
+               //"vec3 shadowing_colour = vec3( 0.93, 0.88536, 0.8184 ) * 0.97;"
+               "vec3 shadowing_colour = vec3( 0.8, 0.8, 0.8 );"
+
                "vec4 glyph = texture( uTexGlyphs, aTexCoords.xy );"
                "vec4 wood = texture( uTexWood, aTexCoords.zw );"
                "vec4 wood_secondary = texture( uTexWood, aTexCoords.zw + 0.25 );"
                "vec3 wood_comp = mix( wood_secondary.rgb * shadowing_colour, wood.rgb, clamp( glyph.b * 2.0 - 1.0, 0.0, 1.0 ) );"
                
-               "vec3 shadows = mix( vec3( 0.85, 0.7344, 0.561 ), vec3(1.0,1.0,1.0), glyph.r );"
+               //"vec3 shadows = mix( vec3( 0.85, 0.7344, 0.561 ), vec3(1.0,1.0,1.0), glyph.r );"
+               "vec3 shadows = mix( shadowing_colour, vec3(1.0,1.0,1.0), glyph.r );"
                
                "vec4 output_regular = vec4( wood_comp * shadows, mix( glyph.a, glyph.b, uForeground ) );"
                
@@ -618,8 +638,8 @@ 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 vec4 uUv;"
+       "uniform vec3 uPos;"
        ""
        "uniform mat3 uPv;"
        ""
@@ -627,25 +647,24 @@ SHADER_DEFINE( shader_sprite,
        ""
        "void main()"
        "{"
-               "vec2 vertex_world = ins_uv.zw * a_co * ins_pos.z + ins_pos.xy;"
+               "vec2 vertex_world = uUv.zw * (a_co-0.5) * uPos.z + uPos.xy;"
                "gl_Position = vec4( uPv * vec3( vertex_world, 1.0 ), 1.0 );"
-               "aTexCoords = ins_uv.xy + (a_co+0.5)*ins_uv.zw;"
+               "aTexCoords = uUv.xy + a_co*uUv.zw;"
        "}",
        
        // FRAGMENT
        "uniform sampler2D uTexMain;"
-       "uniform vec4 uColour;"
        "out vec4 FragColor;"
        ""
        "in vec2 aTexCoords;"
        ""
        "void main()"
        "{"
-               "vec4 glyph = texture( uTexGlyphs, aTexCoords );"
-               "FragColor = glyph;"
+               "vec4 texture_sample = texture( uTexMain, aTexCoords );"
+               "FragColor = texture_sample;"
        "}"
        ,
-       UNIFORMS({ "uPv", "uTexMain", "uColour" })
+       UNIFORMS({ "uPv", "uTexMain", "uUv", "uPos" })
 )
 
 void vg_register(void)
@@ -657,6 +676,7 @@ void vg_register(void)
        SHADER_INIT( shader_wire );
        SHADER_INIT( shader_buttons );
        SHADER_INIT( shader_sdf );
+       SHADER_INIT( shader_sprite );
 }
 
 /*