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

Render to a HDR framebuffer and tonemap to the device buffer #6

Merged
merged 9 commits into from May 23, 2022

Conversation

expenses
Copy link
Owner

We want tonemapping to be able to handle HDR. We could do the tonemapping inline at the end of regular shaders, but this would mean that we couldn't do HDR post processing such as bloom, as well as other effects like accurate transmissive rendering.

This does cause some problems for AR, because by default we're blitting the entire HDR framebuffer to the output framebuffer, which writes over the camera image. I'm not sure if it's possible to copy the camera image to the HDR framebuffer first (need to check) but a better solution is to probably use stencil testing for this so we only blit pixels we've written to.

@expenses
Copy link
Owner Author

but a better solution is to probably use stencil testing for this so we only blit pixels we've written to.

Utgh, we can't actually do this in the case of bloom anwyay.

@expenses
Copy link
Owner Author

I think this is the way to go, but I need to make some wgpu PRs first (for rendering to a float16 texture, multiview support etc.).

@expenses
Copy link
Owner Author

Think we're gonna need to make a patch for naga that adds layout (num_views = X) in; to multiview shaders. Spirv-cross does something similar:

https://github.com/KhronosGroup/SPIRV-Cross/blob/940efca099afd08bf9ef1679239b5040976d2cb2/main.cpp#L791

@expenses
Copy link
Owner Author

I'm happy with this! Need to test on android and have something working there and then we're good to merge.

@expenses
Copy link
Owner Author

expenses commented May 22, 2022

... So according to https://webglreport.com/?v=2, OVR_multiview2 works on:

  • Chrome on desktop
  • Firefox on android

but not on:

  • Chrome on android
  • Firefox on desktop

unbelievable.

@expenses expenses marked this pull request as ready for review May 23, 2022 01:34
@expenses expenses merged commit daac7ba into master May 23, 2022
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.

None yet

1 participant