feat: allow bigger render distance in 3d view

This commit is contained in:
2026-09-25 09:46:36 +02:00
parent ba385be18d
commit 583a535806
3 changed files with 37 additions and 7 deletions
+3 -2
View File
@@ -29,7 +29,8 @@ const DATA_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Rgba32Float;
/// Cap on the interactive cache's pixel count (the texture is scaled down,
/// aspect kept, above it). Each pixel costs 36 bytes across the data, AA and
/// colour textures, and the 3D view renders at 2× per axis, so a HiDPI screen
/// colour textures, and the 3D view renders at a configurable multiple per axis
/// (default 2×), so a HiDPI screen
/// in 3D would otherwise want 0.5 GB+. Browsers cap WebGPU memory well below
/// what native gets, so the web budget is ~4K (≈300 MB); native, ~8K.
#[cfg(target_arch = "wasm32")]
@@ -1411,7 +1412,7 @@ impl egui_wgpu::CallbackTrait for FractalCallback {
// Clamp to the device's texture-size limit, keeping the aspect ratio
// (the iterate pass maps pixels through NDC, so the view is unchanged;
// the blit just upsamples). The 2× 3D supersample on a large/HiDPI
// the blit just upsamples). The 3D supersample (default 2×) on a large/HiDPI
// screen can otherwise exceed it.
// Also cap the total pixel count (`MAX_CACHE_PIXELS`), same way.
let max_dim = device.limits().max_texture_dimension_2d;