Skip to content

feat: high-res screenshot#218

Merged
dvdkouril merged 12 commits intomainfrom
highres-screenshot
Feb 4, 2026
Merged

feat: high-res screenshot#218
dvdkouril merged 12 commits intomainfrom
highres-screenshot

Conversation

@dvdkouril
Copy link
Member

@dvdkouril dvdkouril commented Feb 4, 2026

This PR adds capability to take higher resolution screenshots.

Previously the users were expected to simply make the canvas as large as possible for larger screenshots. This is obviously limited by the physical size of their display. The new feature uses an OffscreenCanvas to render the scene at an arbitrary size.

The canvas background is kept transparent, making it easier to manipulate the images in post-production.

Usage:

// Use canvas dimensions
await renderer.screenshot();

// Specify width, calculate height from canvas aspect
await renderer.screenshot({ width: 1920 });

// Specify height, calculate width from canvas aspect
await renderer.screenshot({ height: 1080 });

// Exact dimensions (may change aspect ratio)
await renderer.screenshot({ width: 1920, height: 1080 });

// Any of the above with quality multiplier
await renderer.screenshot({ width: 4000, quality: 2 });

TODOs:

  • aspect ratio of the actual canvas is not respected, leads to deformation when users don't specify width/height with the same ratio
  • quality param > 1: the SSAO visuals change significantly

@changeset-bot
Copy link

changeset-bot bot commented Feb 4, 2026

⚠️ No Changeset found

Latest commit: 4b2bda1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dvdkouril dvdkouril changed the title highres screenshot High-res screenshot Feb 4, 2026
@dbmi-svc-checkmarx
Copy link

dbmi-svc-checkmarx commented Feb 4, 2026

Logo
Checkmarx One – Scan Summary & Details6b22ac87-2d15-42c2-9c8c-be170204106f

Great job! No new security vulnerabilities introduced in this pull request


Use @Checkmarx to interact with Checkmarx PR Assistant.
Examples:
@Checkmarx how are you able to help me?
@Checkmarx rescan this PR

it actually kinda doesn't make sense to have it on the top level of the library, since you need some kind of a reference to the renderer to get the current state (like camera position)
the setup script should detect the version based on project dependencies
@dvdkouril dvdkouril changed the title High-res screenshot feat: high-res screenshot Feb 4, 2026
steps:
- uses: actions/checkout@v5
- uses: biomejs/setup-biome@v2
with:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By deleting the fixed version specifier, the setup script will look at what version is declared as dependency in the project

@dvdkouril dvdkouril merged commit 14cb183 into main Feb 4, 2026
5 checks passed
@dvdkouril dvdkouril deleted the highres-screenshot branch February 4, 2026 18:49
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.

2 participants