Skip to content

fix multi-window issues + add accessors to configure various rendering features (textures, shadows, anti-aliasing) - #413

Merged
sebcrozet merged 7 commits into
masterfrom
fix-shared-window-managers
Oct 3, 2026
Merged

sebcrozet merged 7 commits into
masterfrom
fix-shared-window-managers

Conversation

@sebcrozet

Copy link
Copy Markdown
Member

New Features

  • OffscreenSurface renders with MSAA: OffscreenSurface::set_samples / samples, or
    CanvasSetup::samples through with_setup. OffscreenSurface::new stays single-sampled.
    Offscreen frames used to ignore the canvas sample count and always render one sample.
  • OffscreenSurface::set_shadow_softness / shadow_softness and set_shadows_enabled /
    shadows_enabled, mirroring the Window methods.
  • ShadowMapper::set_atlas_layers (Window / OffscreenSurface::set_shadow_atlas_layers)
    allocates fewer than the 16 shadow atlas layers, which makes a finer shadow resolution
    affordable when a scene only lights with one or two directional lights.
  • TextureManager::set_anisotropy: anisotropic filtering (up to 16x) for textures loaded with
    mipmaps and linear filtering, which keeps floors and other grazing-angle textures sharp.
  • Window and OffscreenSurface expose the directional cascade layout that only the
    ShadowMapper had: set_shadow_distance / shadow_distance and
    set_first_cascade_far_bound / first_cascade_far_bound.
  • Added the offscreen_msaa example: an antialiased, hard-shadowed offscreen render.

Bug Fixes

  • Creating a second Window or OffscreenSurface on a thread that already has one no longer replaces the global mesh, texture and material managers. Objects created before the new surface kept the previous default material, which the per-frame begin_frame / flush no longer reached, so its per-object uniform buffer grew until wgpu rejected the dynamic offsets (a validation error after 256 draws). The managers are now created once per context and reused until the last window closes.
  • Added the offscreen_shared_managers example exercising a scene built before its offscreen surface, with shaded renders interleaved with depth and segmentation read-backs.

@sebcrozet
sebcrozet merged commit 53daefc into master Oct 3, 2026
8 checks passed
@sebcrozet
sebcrozet deleted the fix-shared-window-managers branch October 3, 2026 15:09
@sebcrozet
sebcrozet restored the fix-shared-window-managers branch October 3, 2026 15:09
@sebcrozet sebcrozet mentioned this pull request Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant