Author Topic: Better VFB Contrast implementation  (Read 5409 times)

2016-07-12, 17:18:17

Juraj

  • Active Users
  • **
  • Posts: 4762
    • View Profile
    • studio website
Right now the Corona contrast function is extremely aggressive towards blacks, and slight highlights peak.

Artistically, it's not very nice and not commonly used either.
Here are Dubcat's graph comparisons between Corona's contrast and AdobeCameraRaw contrast, which is far more universally used (from Raw, to Lightroom, CaptureOne,..)

Corona on left, Beautiful CameraRaw on right


CameraRaw applied to linear gradient. Crisp, unclipped, lifted.




« Last Edit: 2016-07-12, 17:22:13 by Juraj_Talcik »
Please follow my new Instagram for latest projects, tips&tricks, short video tutorials and free models
Behance  Probably best updated portfolio of my work
lysfaere.com Please check the new stuff!

2016-08-03, 14:41:34
Reply #1

martinsik

  • Corona Team
  • Active Users
  • ****
  • Posts: 44
    • View Profile
I have discussed with Dubcat how these curves were obtained, I believe I can now explain why the Corona curve seems to be weird, but in reality it is IMHO not.

In order to obtain the curves, the following HALD_256 image was placed in Corona VFB.

Since Corona VFB doesn't support direct loading of images, the same effect was achieved by rendering plane lit by uniform environment map and using the above image as a texture.
This however introduced noise to the image, which then results in the non-smoothness of the obtained curve. Please note that the contrast curve that Corona uses in reality is perfectly smooth.

Once the above image has been displayed in Corona VFB and contrast was applied, it is then saved and the curve is extracted from it using the 3D LUT Creator Pro http://3dlutcreator.com/.
Unfortunately, the original Corona contrast curve can't be obtained this way. This is caused by the fact that Corona applies contrast in linear space, while the 3D LUT Creator Pro works in sRGB space.

This fact can be easily observed by the following experiment:
We took the above HALD_256 image, and we set all its values lower than 0.5 to 0. When we have computed the resulting curve, we obtained the following result:

As you can see, in the image the threshold below which all is set to 0 seems to be higher than 0.5. In fact it roughly corresponds to 0.5^(1 / 2.2).
If we first map HALD_256 image to linear space, apply the same thresholding and convert back we then receive this result, where the threshold seems to be at the middle as intended:


So when we apply the Corona contrast curve which works nicely in linear space and try to obtain it using the above way without considering linear/sRGB space, we recieve this mishapened curve:

If we first map HALD_256 image to linear space, use Corona curve and map it back, we can obtain the correct nicely shaped Corona contrast curve:


I hope this makes any sense to you guys :) If you think I have made some error in the above reasoning, let me know.

2016-08-03, 19:29:04
Reply #2

agentdark45

  • Active Users
  • **
  • Posts: 579
    • View Profile
Whatever's going on with the contrast curve it would be nice for it to be tweaked as I've noticed some issues with it too. Something very funny happens to the blacks and the saturation of colours goes a bit haywire > values of 2.5.

I think a better way around this is to have a simple curve editor or something similar to the Tone Curve rollout in lightroom. To get around the UI cluttering issue you could have these as "advanced" options in the VFB and for non-power users keep the regular contrast setting visible by default.
Vray who?

2016-08-04, 09:30:38
Reply #3

Christa Noel

  • Active Users
  • **
  • Posts: 911
  • God bless us everyone
    • View Profile
    • dionch.studio

2016-08-05, 10:01:57
Reply #4

Juraj

  • Active Users
  • **
  • Posts: 4762
    • View Profile
    • studio website


I see. But regardless of this being the correct curve, it's still ugly. It's still too close to clamping highlights and shadows. I think I will post renders instead between contrast in Corona and CameraRaw. The difference is simply too big.
Please follow my new Instagram for latest projects, tips&tricks, short video tutorials and free models
Behance  Probably best updated portfolio of my work
lysfaere.com Please check the new stuff!

2016-08-05, 14:05:13
Reply #5

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile


I see. But regardless of this being the correct curve, it's still ugly. It's still too close to clamping highlights and shadows. I think I will post renders instead between contrast in Corona and CameraRaw. The difference is simply too big.
ok, can you post the comparison and their curve? We can try to find another operator that works better for highlights/shadows
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2016-08-17, 21:40:54
Reply #6

vkiuru

  • Active Users
  • **
  • Posts: 320
    • View Profile
Juraj, do you think you could find the time somewhere in the near future to please revive this subject and show us the comparison between the curves since you seem pretty absolute on a significant difference? Very interesting stuff and you have an a huge amount of knowledge on so many aspects this would no doubt be of help in bettering Corona if there indeed is so much to improve here. :)

2016-10-03, 16:34:19
Reply #7

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
done
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)