Tonemappers make your image look better, and fix the problem of lights surpassing values of 1!
Youtube Video HERE!
- ❗ I talk about how cheap or expensive these tone mappers are but they are still something very cheap, especially for modern hardware
- ❗ Make sure you do gamma correction, and also AGX has the gamma correction step already applied so if you use that one, don't do
return pow(a, vec3(1.f/2.2));
at the end! - ⭐ I will add more tone mappers as I find them so consider starting this repo 💪!
- 🎁 I have a BONUS thing in the srgb folder, to make your game look even better!
- 📚 If you want to learn more here are some resources:
https://learnopengl.com/Advanced-Lighting/Gamma-Correction https://learnopengl.com/Advanced-Lighting/HDR https://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/#a-short-quiz https://developer.nvidia.com/gpugems/gpugems3/part-iv-image-effects/chapter-24-importance-being-linear https://learning.oreilly.com/library/view/real-time-rendering-fourth/9781351816144/xhtml/ch05.xhtml (section 5.6) https://thelittleengineerthatcould.blogspot.com/2017/10/srgb-versus-linear-colour-space.html https://medium.com/@tomforsyth/the-srgb-learning-curve-773b7f68cf7a https://bottosson.github.io/posts/colorwrong/
I like the uncharted tonemapper the most because it is the most balanced, and it is also cheap as a bonus.
Probably not obvious from this screenshot but no tone mapper also means all lights brighter than 1 are equal to 1, leading to ugly light clamping 😟
The Aces tone mapper is used in the film industry and it is very good, and it does indeed offer a filmic look. The best part about it is that it makes bright lights turn white no matter their original color. The only downside is that it may maybe too dramatic.
Zcam is a very neutral tone mapper, and more saturated in comparison with the others. Being neutral it is good to use to apply other effects on top. It is more expensive, and it does a binary search in the color space, but that isn't really a reason not to use it after all, it is still a small calculation done once per pixel, and as long as you don't have crazy overdraw, it won't be a problem. To remove overdraw completely without using deferred rendering or use a z pre pas!
Agx aims to be similar to ACES but less dramatic so may be more suitable for some games. It is also cheaper than ACES.
- (punchy setting)
This tone mapper aims to be very neutral, and it is more saturated in comparison to other tone mappers, and as the name suggests, aims to work well with physically based rendering and maintain realism. The very neutral look looks very good in my opinion and as with Zcam, a good starting point if you want to add your own extra effects on top!
This is another film tone mapper, and this one is very bright.
Yet another filmic tone mapper, I would say this is the most balanced of them all!