WebGPURenderer: Add .outputType backend parameter #30320
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Step toward #29573. Adds an independent parameter allowing the user to configure a float16 drawing buffer on a WebGPU canvas. For WebGL backends this does nothing, but my understanding is that WebGL will eventually support higher bit depth output as well.
Example:
A quick way to test the result is to modify the TSL editor example, widen the preview renderer to at least 800px x 200px, and draw a dark gradient:
On a good monitor (for some unspecified definition of "good"; a modern Macbook Pro display will certainly do) you will see banding with
outputType: UnsignedByteType
, and the banding disappears withoutputType: HalfFloatType
.EDIT: I removed the screenshot, as it's difficult to get a reliable capture of the difference. I thought I had one taken correctly, but the bands seem to have disappeared (under compression on upload to Github?).