Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Chrome HDR mode for WebGPU #6980

Merged
merged 4 commits into from
Sep 23, 2024
Merged

Add support for Chrome HDR mode for WebGPU #6980

merged 4 commits into from
Sep 23, 2024

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Sep 20, 2024

Fixes #6975

This adds support for HDR displays for WebGPU (new in Chrome 129).

There is a new public constant that can be used to request HDR mode:
DISPLAYFORMAT_HDR // this is now public

also, new API to test if HDR is active:
GraphicsDevice.isHdr

Notes:

  • few examples were updated to test this.
  • old bloom was removed from the example as that is LDR implementation
  • WebGPU implements single non-specific tonemapping, so it does not exactly match our tonemapping options. They plan to expose additional options in the future.
  • there is an issue with some more advanced examples, I'll investigate more and likely open chromium issue, as the browser rendering gets broken in those cases.

@mvaligursky mvaligursky self-assigned this Sep 20, 2024
@mvaligursky mvaligursky added feature area: graphics Graphics related issue labels Sep 20, 2024
@mvaligursky mvaligursky requested a review from a team September 20, 2024 16:15
Copy link
Member

@slimbuck slimbuck left a comment

Choose a reason for hiding this comment

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

The naming is becoming a little confusing since we can already render to HDR backbuffer.

@mvaligursky
Copy link
Contributor Author

The naming is becoming a little confusing since we can already render to HDR backbuffer.

How can we already render to HDR backbuffer?

@slimbuck
Copy link
Member

SHADER_FORWARDHDR

@mvaligursky
Copy link
Contributor Author

mvaligursky commented Sep 20, 2024

ahh that .. that was removed in v2 .. confusion solved ;)
But that would not do rendering to HDR backbuffer, only HDR render target.

@slimbuck
Copy link
Member

HDR backbuffer, only HDR render target.

yeah this bit, confusing

@slimbuck
Copy link
Member

Only mentioning so we can perhaps make the difference explicit in docs. Though it may not be necessary since as you say, it's gone from v2.0.

@@ -104,6 +104,14 @@ class GraphicsDevice extends EventHandler {
*/
isWebGL2 = false;

/**
* True if the back-buffer is using HDR format, which means that the browser will display the
* rendered images in high dynamic range mode. This is true if the displayFormat is set to
Copy link
Contributor

Choose a reason for hiding this comment

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

Link displayFormat?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we cannot link to options.displayFormat directly I think, but I link a function accepting this options object.

@MAG-AdrianMeredith
Copy link
Contributor

kewl, this looks so much nicer than my hack from a while back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add HDR output support to WebGPU
4 participants