From 5a43ac3be6d788e6c662213710b36b36bce93478 Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 8 Apr 2021 17:45:30 +0530 Subject: add day 19 of devlog --- docs/index.html | 4 ++-- docs/index.xml | 7 ++++++- docs/posts/SDL2_devlog/index.html | 11 ++++++++--- docs/posts/index.html | 4 ++-- posts/SDL2_devlog.md | 15 +++++++++++++++ 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/docs/index.html b/docs/index.html index 49a7494..2ab91b8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@
- 04/04 — 2021 + 08/04 — 2021
SDL2 Devlog @@ -50,7 +50,7 @@ - 9.1 + 9.6 min diff --git a/docs/index.xml b/docs/index.xml index 8a4e57f..e0ae321 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -14,6 +14,11 @@ SDL2 Devlog <p>I have been working on an editor for the <a href="https://git.peppe.rs/graphics/obi/about">One Bit Image</a> file format in Rust and SDL2. This entry in my blog follows my progress on the editor. The days are listed in reverse chronological order, begin from the bottom, if this is your first time on this page.</p> +<h3 id="day-19">Day 19</h3> +<p>Attempted <a href="https://peppe.rs/art/conduit.png">some isometric art</a> within the editor. The angles displayed alongside the line brush are handly, however, having only a rectangular grid did not help. I implemented an isometric grid today. Isometric grids in pixel art differ in that the tangent of the isometric angle is exactly 0.5! For every pixel down, you go exactly two pixels sideways. The math works out really well in the drawing procedures too, dealing with floating points is a pain.</p> +<figure> +<img src="https://u.peppe.rs/1Kb.png" alt="Day 19" /><figcaption aria-hidden="true">Day 19</figcaption> +</figure> <h3 id="day-18">Day 18</h3> <p>I added basic support for guides, they can be added and activated from the <code>lisp</code> REPL. Another long standing improvement I wanted to make was reworking the pixmap drawing procedure. The old procedure draws a square for each pixel in the pixmap, coloured according to its value in the pixmap. Naturally, this means, for an <strong>NxN</strong> pixmap, there are <strong>N²</strong> calls to SDL! I reworked this procedure to compress each line of the pixmap using RLE (run length encoding), and call out to SDL for each run in the line. This drastically improved drawing speeds on larger grids. The following is a comparison between the two procedures, the leftmost picture is the rendered image, the middle picture is the optimized drawing procedure (draws each run instead of pixel), and the right most picture is the primitive drawing procedure (draws each pixel):</p> <figure> @@ -139,7 +144,7 @@ <img src="https://u.peppe.rs/Ma.png" alt="Day 1" /><figcaption aria-hidden="true">Day 1</figcaption> </figure> https://peppe.rs/posts/SDL2_devlog/ -Sun, 04 Apr 2021 16:01:00 +0000 +Thu, 08 Apr 2021 12:09:00 +0000 https://peppe.rs/posts/SDL2_devlog/ diff --git a/docs/posts/SDL2_devlog/index.html b/docs/posts/SDL2_devlog/index.html index 5bfbaf6..85ab1af 100644 --- a/docs/posts/SDL2_devlog/index.html +++ b/docs/posts/SDL2_devlog/index.html @@ -25,15 +25,15 @@ ">View Raw
- 04/04 — 2021 + 08/04 — 2021
- 114.29 + 120.28 cm   - 9.1 + 9.6 min
@@ -43,6 +43,11 @@

I have been working on an editor for the One Bit Image file format in Rust and SDL2. This entry in my blog follows my progress on the editor. The days are listed in reverse chronological order, begin from the bottom, if this is your first time on this page.

+

Day 19

+

Attempted some isometric art within the editor. The angles displayed alongside the line brush are handly, however, having only a rectangular grid did not help. I implemented an isometric grid today. Isometric grids in pixel art differ in that the tangent of the isometric angle is exactly 0.5! For every pixel down, you go exactly two pixels sideways. The math works out really well in the drawing procedures too, dealing with floating points is a pain.

+
+Day 19 +

Day 18

I added basic support for guides, they can be added and activated from the lisp REPL. Another long standing improvement I wanted to make was reworking the pixmap drawing procedure. The old procedure draws a square for each pixel in the pixmap, coloured according to its value in the pixmap. Naturally, this means, for an NxN pixmap, there are calls to SDL! I reworked this procedure to compress each line of the pixmap using RLE (run length encoding), and call out to SDL for each run in the line. This drastically improved drawing speeds on larger grids. The following is a comparison between the two procedures, the leftmost picture is the rendered image, the middle picture is the optimized drawing procedure (draws each run instead of pixel), and the right most picture is the primitive drawing procedure (draws each pixel):

diff --git a/docs/posts/index.html b/docs/posts/index.html index 92e5869..028db12 100644 --- a/docs/posts/index.html +++ b/docs/posts/index.html @@ -27,7 +27,7 @@
- 04/04 — 2021 + 08/04 — 2021
SDL2 Devlog @@ -35,7 +35,7 @@ - 9.1 + 9.6 min diff --git a/posts/SDL2_devlog.md b/posts/SDL2_devlog.md index 04ac928..569fdba 100644 --- a/posts/SDL2_devlog.md +++ b/posts/SDL2_devlog.md @@ -5,6 +5,21 @@ on the editor. The days are listed in reverse chronological order, begin from the bottom, if this is your first time on this page. +### Day 19 + +Attempted [some isometric +art](https://peppe.rs/art/conduit.png) within the editor. +The angles displayed alongside the line brush are handly, +however, having only a rectangular grid did not help. I +implemented an isometric grid today. Isometric grids in +pixel art differ in that the tangent of the isometric angle +is exactly 0.5! For every pixel down, you go exactly two +pixels sideways. The math works out really well in the +drawing procedures too, dealing with floating points is a +pain. + +![Day 19](https://u.peppe.rs/1Kb.png) + ### Day 18 I added basic support for guides, they can be added and -- cgit v1.2.3