git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

commit3379dac111dae3cddf14673a620387f23ad65d0c
parent318cb73759
authorLucas Galante <lsgalante12@gmail.com>
date2026-09-29 16:59
feat: the viewport's image is mipmapped

A page composed at 300 DPI is drawn at about a fifth of its size, where
bilinear sampling alone made a ruled sheet moire head-on and at a slant.

Needs cce-ui's upload_rgba_mipmapped.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

 CLAUDE.md     | 6 +++++-
 src/render.rs | 4 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/CLAUDE.md b/CLAUDE.md
index 77552bd..9f3f7dc 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -1599,7 +1599,11 @@ when that is a millimetre (`PageShown::world_size`, the one place a length
 is converted INTO world units). It is staged after the furniture and the
 markers and before the geometry, whose fill may be translucent over it, and
 the shader discards a texel that shows nothing so a transparent page does
-not hide what is behind it. `State::page_shown` is what the stage pass
+not hide what is behind it. The image is uploaded MIPMAPPED
+(`cce_ui::vk::upload_rgba_mipmapped`, since 2026-09-29) and sampled with
+anisotropy where the device has it: a Letter sheet at 300 DPI is drawn at
+about a fifth of its size in an ordinary pane, and without a mip chain a
+ruled page was moiré head-on and worse at a slant. `State::page_shown` is what the stage pass
 places it by. Until then a pane of its own (`PAGE_IDX`, an `ImageView`)
 took the viewport's rect whenever the level held a page, so a picture and
 a model could not be seen together. The path tracer does not draw it.
diff --git a/src/render.rs b/src/render.rs
index c38cf7f..420058d 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -1151,7 +1151,9 @@ impl State {
                     cce_ui::vk::update_pixels(id, page.to_rgba8(), w, h, cce_ui::vk::PixelFormat::Rgba);
                     id
                 }
-                None => cce_ui::vk::upload_rgba(page.to_rgba8(), w, h),
+                // Mipmapped: a sheet composed at 300 DPI is drawn at a fifth
+                // of its size in an ordinary pane, and its hairlines crawl.
+                None => cce_ui::vk::upload_rgba_mipmapped(page.to_rgba8(), w, h),
             });
             self.update_status_text(&format!(
                 "Image: {} x {} {} at {} DPI ({}x{} px)",