diff --git a/geometry.js b/geometry.js index 296e166..63a224e 100644 --- a/geometry.js +++ b/geometry.js @@ -28,7 +28,10 @@ function rasterize_and_pack(text, cycles) { return rasterized[key]; } - const tiles_needed = cycles - 1 + 1; // stage name + count from one + let cycles_total_padding = (cycles - 1) * config.padding; + let bonus_cells = Math.ceil(cycles_total_padding / config.w); + + const tiles_needed = cycles - 1 + 1 + bonus_cells; // stage name + count cycles from one if (tiles_needed > config.raster_texture_size / config.w - raster_tile.x) { raster_tile.x = 0; raster_tile.y += 1; @@ -42,20 +45,12 @@ function rasterize_and_pack(text, cycles) { gl.texSubImage2D(gl.TEXTURE_2D, 0, raster_tile.x * config.w, raster_tile.y * config.h, config.w, config.h, - gl.RGBA, gl.UNSIGNED_BYTE, c2d.canvas + gl.RGBA, gl.UNSIGNED_BYTE, + c2d.canvas ); - raster_tile.x += 1; - for (let i = 1; i <= cycles; ++i) { - rasterize(i); - gl.bindTexture(gl.TEXTURE_2D, textures['raster']); - gl.texSubImage2D(gl.TEXTURE_2D, 0, - raster_tile.x * config.w, raster_tile.y * config.h, - config.w, config.h, - gl.RGBA, gl.UNSIGNED_BYTE, c2d.canvas - ); - raster_tile.x += 1; - } + raster_tile.x += 1; + raster_tile.x += cycles + bonus_cells; if (raster_tile.x === config.raster_texture_size / config.w) { raster_tile.x = 0; @@ -101,18 +96,20 @@ function generate(trace_id) { } let [r, g, b] = get_color(stage.name); + let a = 255; if (!instruction.retired) { r = Math.max(50, r - 50); g = Math.max(50, g - 50); b = Math.max(50, b - 50); + a = 100; } const [u, v] = rasterize_and_pack(stage.name, stage_cycles); - sizes.push(stage_cycles * config.w, 1 * config.h); - positions.push(config.w * stage.c, config.h * y); - colors.push(r, g, b, 255); + sizes.push(stage_cycles * config.w + (stage_cycles - 1) * config.padding, 1 * config.h); + positions.push(config.w * stage.c + config.padding * (stage.c - 1), config.h * y + config.padding * (y - 1)); + colors.push(r, g, b, a); uvs.push(u, v); result.count++; diff --git a/ibm_vga8.woff2 b/ibm_vga8.woff2 new file mode 100644 index 0000000..489d4d2 Binary files /dev/null and b/ibm_vga8.woff2 differ diff --git a/index.html b/index.html index 9f42726..b031251 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@