Welcome, Guest.
Username: Password: Remember me

TOPIC: Tonemapping SDR kinda works! :)

Tonemapping SDR kinda works! :) 10 months 1 week ago #1

  • Zavarka512
  • Zavarka512's Avatar
  • Offline
  • Posts: 14
  • Thank you received: 1
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: 10 months 1 week ago by Zavarka512.
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 10 months 6 days ago #2

  • Kleio420
  • Kleio420's Avatar
  • Offline
  • Posts: 216
  • Thank you received: 28
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: 10 months 6 days ago by Kleio420.
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 10 months 5 days ago #3

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.
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 10 months 5 days ago #4

  • Kleio420
  • Kleio420's Avatar
  • Offline
  • Posts: 216
  • Thank you received: 28
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
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 10 months 5 days ago #5

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
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 10 months 5 days ago #6

  • Zavarka512
  • Zavarka512's Avatar
  • Offline
  • Posts: 14
  • Thank you received: 1
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: 10 months 5 days ago by Zavarka512.
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 10 months 4 days ago #7

what were the procedure you did to correct the image in GIMP?
Last Edit: 10 months 4 days ago by kingeric1992.
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 10 months 4 days ago #8

  • Zavarka512
  • Zavarka512's Avatar
  • Offline
  • Posts: 14
  • Thank you received: 1
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.
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 10 months 4 days ago #9

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: 10 months 4 days ago by kingeric1992.
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 9 months 3 weeks ago #10

  • Zavarka512
  • Zavarka512's Avatar
  • Offline
  • Posts: 14
  • Thank you received: 1
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.


The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 9 months 3 weeks ago #11

  • TreyM
  • TreyM's Avatar
  • Offline
  • Posts: 28
  • Thank you received: 7
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: 9 months 3 weeks ago by TreyM.
The administrator has disabled public write access.
The following user(s) said Thank You: Zavarka512

Tonemapping SDR kinda works! :) 9 months 3 weeks ago #12

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 717
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 administrator has disabled public write access.
The following user(s) said Thank You: Zavarka512

Tonemapping SDR kinda works! :) 9 months 3 weeks ago #13

  • TreyM
  • TreyM's Avatar
  • Offline
  • Posts: 28
  • Thank you received: 7
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?
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 9 months 3 weeks ago #14

  • Marty McFly
  • Marty McFly's Avatar
  • Offline
  • We've tried nothing and we're all out of ideas!
  • Posts: 609
  • Thank you received: 717
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: 9 months 3 weeks ago by Marty McFly.
The administrator has disabled public write access.
The following user(s) said Thank You: Zavarka512

Tonemapping SDR kinda works! :) 9 months 3 weeks ago #15

  • TreyM
  • TreyM's Avatar
  • Offline
  • Posts: 28
  • Thank you received: 7
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 administrator has disabled public write access.
The following user(s) said Thank You: Zavarka512

Tonemapping SDR kinda works! :) 9 months 2 weeks ago #16

  • Zavarka512
  • Zavarka512's Avatar
  • Offline
  • Posts: 14
  • Thank you received: 1
TreyM, Can you please share your before/after screens of your method to deal with auto-correction?
Last Edit: 9 months 2 weeks ago by Zavarka512.
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 9 months 2 weeks ago #17

  • Sekta
  • Sekta's Avatar
  • Offline
  • Posts: 20
  • Thank you received: 5
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: 9 months 2 weeks ago by Sekta.
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 9 months 2 weeks ago #18

  • Quentin-Tarantino
  • Quentin-Tarantino's Avatar
  • Offline
  • If there is no struggle, there is no progress.
  • Posts: 351
  • Thank you received: 218
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: 9 months 2 weeks ago by Quentin-Tarantino.
The administrator has disabled public write access.
The following user(s) said Thank You: Zavarka512

Tonemapping SDR kinda works! :) 9 months 2 weeks ago #19

  • brussell
  • brussell's Avatar
  • Offline
  • Posts: 139
  • Thank you received: 113
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.
The administrator has disabled public write access.

Tonemapping SDR kinda works! :) 9 months 2 weeks ago #20

  • Quentin-Tarantino
  • Quentin-Tarantino's Avatar
  • Offline
  • If there is no struggle, there is no progress.
  • Posts: 351
  • Thank you received: 218
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?
The administrator has disabled public write access.
  • Page:
  • 1
  • 2