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
// ===========================================================================================================
"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 );"
"out vec4 FragColor;"
""
"in vec2 aTexCoords;"
- "in vec4 aColour;"
""
"void main()"
"{"
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 );
.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 = ""
}
};