Tonemapping SDR kinda works! :)

  • Zavarka512
  • Topic Author
More
8 years 2 months ago - 8 years 2 months ago #1 by Zavarka512 Tonemapping SDR kinda works! :) was created by Zavarka512
Well, If using just HPD tonemapping in reshade everything looks dull and mushy, no contrast at all, BUT after white point balancing (or after stretching brightness/stretching HSV in gimp, they achieve quite the same) it looks pretty good!

A lot more detail in blacks!(look at the kitchen or sofa on the left and also the floor beneath it) Soft fall-off at whites, almost all details in whites are preserved, better color and contrast in dark areas, darker blacks.

The question is - can it be possible to add non-stop white-point balancing in reshade (for gaming)? Or if performance is an issue - maybe with adjustable frequency (25ms-1000ms or something), and with transitions for everything to look smooth. Or maybe constant brightness stretching/HSV stretching (HSV is contrast stretching that does not affect hue), white point balancing can sometimes alter colors and not in a nice way, that's why stretching maybe more appropriate in some cases.

First of all it will make tonemapping algorithms make sense for reshade, and second bonus - it will also work basically as eye adaptation - when you enter dark area - details will pop-up, kinda like night-vision, when you're in the light - you'll just get awesome filmic-pseudo-hdr look like in picture below. There's a concern that the game ui (if it's too bright) will mess up white balancing, but again - stretching may not have that issue, and I also doubt ui will mess up white-balancing too much to care.

I would want your thoughts on this, gentlemen.

Before


After HPD and white-point balancing
Last edit: 8 years 2 months ago by Zavarka512.

Please Log in or Create an account to join the conversation.

  • Kleio420
More
8 years 2 months ago - 8 years 2 months ago #2 by Kleio420 Replied by Kleio420 on topic Tonemapping SDR kinda works! :)

Zavarka512 wrote: Well, If using just HPD tonemapping in reshade everything looks dull and mushy, no contrast at all, BUT after white point balancing (or after s


framework pretty sure uses this as a base for some of the tonemap shaders , uncharted and watch dogs shaders are based off some of this if not fully. To your question are you asking about using an adaptive alg based off color input in the scene to change the tonemap say if the scene has more white or black in it. Really not an expert but i would think the game needs to support HDR for this to work from how i read your post, im sure few people are floating around who can give you a better answer tho
Last edit: 8 years 2 months ago by Kleio420.

Please Log in or Create an account to join the conversation.

  • kingeric1992
More
8 years 2 months ago #3 by kingeric1992 Replied by kingeric1992 on topic Tonemapping SDR kinda works! :)
no need to be HDR, but you need to find your own function to correspond overall light condition ( aka avg brightness, logavg, or max, or histogram based, or any value that can be used to determine how much to correct) and white point.

To be practical, discrete gain based on several but limited cases on different light condition with interpolators to smooth the nodes would be easier.

Please Log in or Create an account to join the conversation.

  • Kleio420
More
8 years 2 months ago #4 by Kleio420 Replied by Kleio420 on topic Tonemapping SDR kinda works! :)

kingeric1992 wrote: no need to be HDR, but you need to find your own function to correspond overall light condition ( aka avg brightness, logavg, or max, or histogram based, or any value that can be used to determine how much to correct) and white point.

To be practical, discrete gain based on several but limited cases on different light condition with interpolators to smooth the nodes would be easier.

so using hdr vs ldr , would that just be more of a performance and quality of life thing then

Please Log in or Create an account to join the conversation.

  • kingeric1992
More
8 years 2 months ago #5 by kingeric1992 Replied by kingeric1992 on topic Tonemapping SDR kinda works! :)
its about precision. banding would be super obvious in some cases.
To that extent, something like S-Curve is designed not to look good but to maximize precisioncy on shadow and bright area for post production.

btw, this is how the custom gain would looks like:
^ brightness gain
|
|---\
|    |
|    \____
|          \_
+---------------> overal brightness

Please Log in or Create an account to join the conversation.

  • Zavarka512
  • Topic Author
More
8 years 2 months ago - 8 years 2 months ago #6 by Zavarka512 Replied by Zavarka512 on topic Tonemapping SDR kinda works! :)
My point was to possibly inspire (:D) someone to make white-point balancing shader. The same stuff Gimp does to Reshade HPD Tonemaped image and "fixes it" from grey mush to a "normal" picture and produce kinda hdr results in the end. And of course it is sure possible with SDR(LDR) Images, because it's possible to apply it to any jpg in GIMP.

When it comes to me - I've found few combinations in pipeline that give cool results. Better then the picture above, and maybe it will sound braggy, but this setting gives positive results on practically almost any game or photo. Most importantly - it adds to older games effect indistinguishable to hdr, which gives them more modern look. It's
HPD /
Watchdogs tonemap /
Some color correction with liftgammagain if watchdogs tonemap is used, cause it adds annoying blue tint /
Tuning palette + Color LUT. Here I've tried to "emulate" using lut what white point balance would do to a tonemapped picture (I know it's stupid and it shouldn't work, but it does makes things more contrasty :D )

I mix these for each game/picture, sometimes all of them are on, sometimes there's no need for hpd etc.

I've made some screens to illustrate.
Look at the highlights - they're surely brighter, but the details are still there, no bloom-like effect, and at the same time - dark areas are even darker (and details are still preserved)







What I also realised (But I maybe wrong) is that there's a possibility that what I'm doing here can be accomplished just by curves, cause (at least how I understand it) tonemapping like hpd accomplishes just that - makes the histogram(or whatever it's called) - curvy. I will try some curves to produce the same effect right now.

Edit:
Reversed curves (negative values) does accomplish something very remotely similar, but it doesn't look that cool and the colors are weird
Last edit: 8 years 2 months ago by Zavarka512.

Please Log in or Create an account to join the conversation.

  • kingeric1992
More
8 years 2 months ago - 8 years 2 months ago #7 by kingeric1992 Replied by kingeric1992 on topic Tonemapping SDR kinda works! :)
what were the procedure you did to correct the image in GIMP?
Last edit: 8 years 2 months ago by kingeric1992.

Please Log in or Create an account to join the conversation.

  • Zavarka512
  • Topic Author
More
8 years 2 months ago #8 by Zavarka512 Replied by Zavarka512 on topic Tonemapping SDR kinda works! :)

kingeric1992 wrote: what exactly did you do to correct the image in GIMP?


Any of these four, they achieve marginally the same, white balance works best, but sometimes messes up colors not in a good way. Stretch HSV is my second choice and third and fourth is stretch contrast and normalize. But for majority of images white balance is the way to go.

Please Log in or Create an account to join the conversation.

  • kingeric1992
More
8 years 2 months ago - 8 years 2 months ago #9 by kingeric1992 Replied by kingeric1992 on topic Tonemapping SDR kinda works! :)
docs.gimp.org/en/gimp-layer-white-balance.html
I will see what I can do, but personally I think your corrected images are over contrasted.

Edit: or not over contrast but over bright?
Last edit: 8 years 2 months ago by kingeric1992.

Please Log in or Create an account to join the conversation.

  • Zavarka512
  • Topic Author
More
8 years 2 months ago #10 by Zavarka512 Replied by Zavarka512 on topic Tonemapping SDR kinda works! :)

kingeric1992 wrote: docs.gimp.org/en/gimp-layer-white-balance.html
I will see what I can do, but personally I think your corrected images are over contrasted.

Edit: or not over contrast but over bright?


The point is this, and that's what I like - there's no loss of detail in bright areas. of course details are more hard to see and that's intended, cause tonemapping adds soft fall-off, and I love soft fall-off, it makes lighting more realistic; but details are still there, no(or close to none) clipping. you can try just adding contrast instead, with none of this tonemapping stuff, and the lighting will be bloomy, unrealistic and details will be lost. my point is - I like soft fall-off at whites, it looks cool and realistic. here's some more examples.


Please Log in or Create an account to join the conversation.

  • TreyM
More
8 years 2 months ago - 8 years 2 months ago #11 by TreyM Replied by TreyM on topic Tonemapping SDR kinda works! :)
You can compensate for the crushed whites from using HPD tonemapping on LDR content by placing (SweetFX Shared) in the Pipeline.cfg after (ColorCorrection) and adjusting "Levels" in SweetFX to set the white output to 185 and leave black output to 0. I also find it sometimes necessary to set the gamma in SweetFX Tonemap section to 1.500.
Last edit: 8 years 2 months ago by TreyM.
The following user(s) said Thank You: Zavarka512

Please Log in or Create an account to join the conversation.

  • Marty McFly
More
8 years 2 months ago #12 by Marty McFly Replied by Marty McFly on topic Tonemapping SDR kinda works! :)
One could just make automated white point control for every tonemapper. Problem is, a pixel with maximum brightness 1.0 doesn't have 1.0 anymore after it went though the tonemapper. Now set alpha channel to 1.0 and let it calculate along and divide through it after the tonemapper. If a tonemapper puts full whites to 0.8, division through 0.8 will make them reach full 1.0 again.
The following user(s) said Thank You: Zavarka512

Please Log in or Create an account to join the conversation.

  • TreyM
More
8 years 2 months ago #13 by TreyM Replied by TreyM on topic Tonemapping SDR kinda works! :)
Does my method of compensating for the dynamic range crush with sweetfx levels applied after the tonemapper seem like overkill? Is there a simpler way to do it currently within the stock framework?

Please Log in or Create an account to join the conversation.

  • Marty McFly
More
8 years 2 months ago - 8 years 2 months ago #14 by Marty McFly Replied by Marty McFly on topic Tonemapping SDR kinda works! :)
No ,it's the only logical thing to do. What I wrote earlier would only do it automatically and correctly (you can only guess your eye if white point of 190 or 200 is correct so it will never be 100% accurate). However you can take a screenshot without the curves and put it in photoshop. Now pick an area where you are sure it should be plain white. If the color there is RGB 210 210 210, a white point of 210 is ideal so whites are whites again but no overexposure.
Last edit: 8 years 2 months ago by Marty McFly.
The following user(s) said Thank You: Zavarka512

Please Log in or Create an account to join the conversation.

  • TreyM
More
8 years 2 months ago #15 by TreyM Replied by TreyM on topic Tonemapping SDR kinda works! :)
Yeah, I found working from screenshots in Photoshop, that HPD smashed the whites down to about 180 (in Fallout 4), so I used 185 to be safe and avoid clipping in case I misjudged the white point. Also had to adjust the gamma a bit with the SFX Tonemap section.
The following user(s) said Thank You: Zavarka512

Please Log in or Create an account to join the conversation.

  • Zavarka512
  • Topic Author
More
8 years 1 month ago - 8 years 1 month ago #16 by Zavarka512 Replied by Zavarka512 on topic Tonemapping SDR kinda works! :)
TreyM, Can you please share your before/after screens of your method to deal with auto-correction?
Last edit: 8 years 1 month ago by Zavarka512.

Please Log in or Create an account to join the conversation.

  • Sekta
More
8 years 1 month ago - 8 years 1 month ago #17 by Sekta Replied by Sekta on topic Tonemapping SDR kinda works! :)
For anyone interested, you can make a really nice look when you enable a tonemap such as HPD and use Ninjafada's tool DX9IV to apply the effect to a picture, in this case a 4096x64 untouched LUT (since the tool only accepts 1920x1080, you need to split the LUT into 3 and combine them afterwards).

Afterwards in Photoshop, open the untouched LUT and on a new layer put your HPD LUT. Use Curves on the HPD LUT and use the Black Point and White Point eyedropper to select the top left and bottom right pixels to fix the whitepoint. Set the HPD LUT's blending mode to Soft Light or Overlay.

Create a new Curves adjustment layer and set its blending mode to Luminosity. Make another and set blending mode to Color. Duplicate the HPD LUT and place one above the Luminosity layer and one above the Color layer. Set them to Clipping Mask. Now adjust the opacity of the adjustment layers until the effect is as strong as you want it to be.

Save it as a PNG-24 (you can shrink the PNG size a lot by using the tool PNGGauntlet) and put it in the CustomFX texture folder. Enable the TUNINGPALETTE shader and enter the details of your LUT, the name, 4096x64 as the size. Use Ninjafada's DX9IV tool to check a game screenshot whenever you make changes until you get the perfect look.
Last edit: 8 years 1 month ago by Sekta.

Please Log in or Create an account to join the conversation.

  • Quentin-Tarantino
More
8 years 1 month ago - 8 years 1 month ago #18 by Quentin-Tarantino Replied by Quentin-Tarantino on topic Tonemapping SDR kinda works! :)

Sekta wrote: For anyone interested, you can make a really nice look when you enable a tonemap such as HPD and use Ninjafada's tool DX9IV to apply the effect to a picture, in this case a 4096x64 untouched LUT (since the tool only accepts 1920x1080, you need to split the LUT into 3 and combine them afterwards).

Afterwards in Photoshop, open the untouched LUT and on a new layer put your HPD LUT. Use Curves on the HPD LUT and use the Black Point and White Point eyedropper to select the top left and bottom right pixels to fix the whitepoint. Set the HPD LUT's blending mode to Soft Light or Overlay.

Create a new Curves adjustment layer and set its blending mode to Luminosity. Make another and set blending mode to Color. Duplicate the HPD LUT and place one above the Luminosity layer and one above the Color layer. Set them to Clipping Mask. Now adjust the opacity of the adjustment layers until the effect is as strong as you want it to be.

Save it as a PNG-24 (you can shrink the PNG size a lot by using the tool PNGGauntlet) and put it in the CustomFX texture folder. Enable the TUNINGPALETTE shader and enter the details of your LUT, the name, 4096x64 as the size. Use Ninjafada's DX9IV tool to check a game screenshot whenever you make changes until you get the perfect look.


I kinda do similar. I take a pic without any effects enabled and then make a Lut from that pic with Mediator offline preview then i open the pic in Photoshop and add different settings inside Photoshop then i save each setting with their own preset. Then i Load the Lut inside Photoshop and add each preset i made for the pic to the Lut. Then i overwrite the CFX_ColorLUTDst.png with the Lut then turn on TUNINGPALETTE and there you have the Enhanced pic look alike as a game Preset ;)

Quick Preset made from this method
Last edit: 8 years 1 month ago by Quentin-Tarantino.
The following user(s) said Thank You: Zavarka512

Please Log in or Create an account to join the conversation.

  • brussell
More
8 years 1 month ago #19 by brussell Replied by brussell on topic Tonemapping SDR kinda works! :)

Quentin-Tarantino wrote: I take a pic without any effects enabled and then make a Lut from that pic with Mediator offline preview

This step is unnecessary. The mediator doesn't create a lut from an image, it just applies the same effects on a neutral lut that it does apply on the sample image (no effects equals a neutral lut). So just load the neutral CFX_ColorLUTOrig.png into photoshop, apply your settings and save it to CFX_ColorLUTDst.png.

Please Log in or Create an account to join the conversation.

  • Quentin-Tarantino
More
8 years 1 month ago #20 by Quentin-Tarantino Replied by Quentin-Tarantino on topic Tonemapping SDR kinda works! :)

brussell wrote:

Quentin-Tarantino wrote: I take a pic without any effects enabled and then make a Lut from that pic with Mediator offline preview

This step is unnecessary. The mediator doesn't create a lut from an image, it just applies the same effects on a neutral lut that it does apply on the sample image (no effects equals a neutral lut). So just load the neutral CFX_ColorLUTOrig.png into photoshop, apply your settings and save it to CFX_ColorLUTDst.png.


Then why does the Lut be different before i put it into Photoshop. I used the CFX_ColorLUTDst.png as default on it's own and it has a brownish filter and when i made the Lut in the offline preview it was more clear?

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.