Add PBR Neutral tone mapping#23761
Conversation
|
Welcome, new contributor! Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨ |
|
I think that something like this should exist, and this looks like a solid, standard option. |
alice-i-cecile
left a comment
There was a problem hiding this comment.
I'm moderately confident that the math is correctly translated here, but we can clean it up to more closely match the actual equations we're referencing.
|
@alice-i-cecile I'm happy to make these suggested changes. Thanks for the review. Just to be clear, generally your preference is to match the symbols/names from the equation in the linked readme, not the glsl source nor descriptive names? |
My preference is to use descriptive names, ideally with comments mapping them onto the glsl source and equation names. Be sure to link the GLSL source directly if you're translating it for attribution reasons. |
atlv24
left a comment
There was a problem hiding this comment.
1<<8 overflows the current reserved bit count for tonemapping variants, it needs to be increased if you want this to work.
The URL to the GLSL source is already there in the comment, right above the WGSL function. |
- Edit inline documentation, with linked source URL - Rename and comment shader function variables - Fix bit mask constants
Designed to faithfully reproduce base color under neutral lighting, for e-commerce, architecture and CAD applications. https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral - Added to 2d and 3d materials, deferred and forward rendering - Added to bloom_2d example - Added to tonemapping example
- Edit inline documentation, with linked source URL - Rename and comment shader function variables - Fix bit mask constants
3c096f8 to
d34ed3d
Compare
|
I've done my best to pick names and write comments for the various values/variables in the shader code, based on my understanding of this article by the original author. Some of them are artifacts of the arithmetic optimization so aren't in the definitive equations. What I've written is more descriptive than either those equations or the provided GLSL code. |
alice-i-cecile
left a comment
There was a problem hiding this comment.
Good, much clearer :) Thanks!
Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
|
Woo hoo! Thanks for the quick review! |
# Objective Add a tonemapping option for for e-commerce, architecture and CAD applications. ## Solution Implemented [PBR Neutral](https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral) tone mapping - Added to 2d and 3d materials, deferred and forward rendering - Added to bloom_2d example - Added to tonemapping example ## Testing Run bloom_2d and tonemapping examples --------- Co-authored-by: Brian Chirls <brian.chirls@ambr.net> Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
Objective
Add a tonemapping option for for e-commerce, architecture and CAD applications.
Solution
Implemented PBR Neutral tone mapping
Testing
Run bloom_2d and tonemapping examples