Skip to content

Texture: precision option for render targets (16-bit float on SDL3) - #989

Draft
foxnne wants to merge 3 commits into
david-vanderson:mainfrom
foxnne:push-yntosqsrssup
Draft

foxnne wants to merge 3 commits into
david-vanderson:mainfrom
foxnne:push-yntosqsrssup

Conversation

@foxnne

@foxnne foxnne commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

See #987.

Without the added precision, blurring and upscaling yields a posterized blur look, which I wasn't able to resolve without the precision.
Screenshot 2026-09-15 at 7 59 25 AM

With precision:
Screenshot 2026-09-15 at 8 06 53 AM

Please let me know of any changes you need!

Also just added support for on web as well, but I'd love your review on all of this, just wanted to get something working!

Screenshot 2026-09-16 at 7 48 21 AM

`Texture.CreateOptions.precision = .high` asks for a render target with more than
8 bits per channel, for targets rendered through several times (a blur pyramid),
where re-quantising dark content every pass steps into contour blobs. SDL3 makes
an RGBA64_FLOAT target with an explicit sRGB colorspace; any other backend, or a
renderer that refuses the format, gives the ordinary target. The result reports
the format asked for, so readTarget returns that.

`Backend.support_precise_targets` tells a caller whether .high means anything
here (sub-LSB dither into an 8-bit fallback rounds away). The proxy bridge
carries the field through to the host.
@foxnne
foxnne marked this pull request as draft September 15, 2026 18:50
@foxnne
foxnne force-pushed the push-yntosqsrssup branch 2 times, most recently from 7a80f9d to 46ff95a Compare September 16, 2026 13:07
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