Chaos Corona for 3ds Max > [Max] Corona Goodies - User Contributions

Highlight Compression Macros for Eyeon Fusion + Foundry Nuke

(1/8) > >>

racoonart:
Ondra was so kind to give me the function for coronas highlight compression and I made a little fusion macro from that. So you can render your stuff without tone-mapping and apply it later in the post.

Corona Highlight compression:

--- Code: ---{
Tools = ordered() {
CoronaHighlightCompression1 = MacroOperator {
Inputs = ordered() {
MainInput1 = InstanceInput {
SourceOp = "CoronaHighlighCompression",
Source = "Image1",
},
Input1 = InstanceInput {
SourceOp = "CoronaHighlighCompression",
Source = "NumberIn1",
Name = "HighlightCompression",
MinScale = 1,
MaxScale = 10,
},
},
Outputs = {
MainOutput1 = InstanceOutput {
SourceOp = "CoronaHighlighCompression",
Source = "Output",
},
},
ViewInfo = GroupInfo {
Name = "CoronaHighlightCompression",
Pos = { 0, 0, },
},
Tools = ordered() {
CoronaHighlighCompression = Custom {
CtrlWZoom = false,
CtrlWShown = false,
NameSet = true,
Inputs = {
NumberIn1 = Input { Value = 1, },
LUTIn1 = Input {
SourceOp = "CustomTool1LUTIn1",
Source = "Value",
},
LUTIn2 = Input {
SourceOp = "CustomTool1LUTIn2",
Source = "Value",
},
LUTIn3 = Input {
SourceOp = "CustomTool1LUTIn3",
Source = "Value",
},
LUTIn4 = Input {
SourceOp = "CustomTool1LUTIn4",
Source = "Value",
},
RedExpression = Input { Value = "r1 * (1+r1/(n1*n1))/(1+r1)\r\n", },
GreenExpression = Input { Value = "g1 * (1+g1/(n1*n1))/(1+g1)\r\n", },
BlueExpression = Input { Value = "b1 * (1+b1/(n1*n1))/(1+b1)\r\n", },
NumberControls = Input { Value = 1, },
ShowNumber2 = Input { Value = 0, },
ShowNumber3 = Input { Value = 0, },
ShowNumber4 = Input { Value = 0, },
ShowNumber5 = Input { Value = 0, },
ShowNumber6 = Input { Value = 0, },
ShowNumber7 = Input { Value = 0, },
ShowNumber8 = Input { Value = 0, },
PointControls = Input { Value = 1, },
ShowPoint1 = Input { Value = 0, },
ShowPoint2 = Input { Value = 0, },
ShowPoint3 = Input { Value = 0, },
ShowPoint4 = Input { Value = 0, },
LUTControls = Input { Value = 1, },
ShowLUT1 = Input { Value = 0, },
ShowLUT2 = Input { Value = 0, },
ShowLUT3 = Input { Value = 0, },
ShowLUT4 = Input { Value = 0, },
},
ViewInfo = OperatorInfo { Pos = { 1045, 115.5, }, },
},
CustomTool1LUTIn1 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
},
},
SplineColor = { Red = 204, Green = 0, Blue = 0, },
CtrlWShown = false,
},
CustomTool1LUTIn2 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
},
},
SplineColor = { Red = 0, Green = 204, Blue = 0, },
CtrlWShown = false,
},
CustomTool1LUTIn3 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
},
},
SplineColor = { Red = 0, Green = 0, Blue = 204, },
CtrlWShown = false,
},
CustomTool1LUTIn4 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
},
},
SplineColor = { Red = 204, Green = 204, Blue = 204, },
CtrlWShown = false,
},
},
},
},
ActiveTool = "CoronaHighlightCompression1",
}
--- End code ---

Filmic Tonemapping:

--- Code: ---{
Tools = ordered() {
FilmicTonemapping1 = MacroOperator {
CtrlWZoom = false,
NameSet = true,
Inputs = ordered() {
Comments = Input { Value = "Filmic tonemap operator is based on John Hable's work for Unchartered 2:  http://filmicgames.com/archives/75\r\n\r\nCopyright 2013 Martin Geupel\r\nThanks goes to Simon Lundberg for the respective Nuke Gizmo!\r\nFeel free to re-use, adapt, distribute and change tool to suit your needs, but please don't sell it.", },
MainInput1 = InstanceInput {
SourceOp = "FilmicTonemapping",
Source = "Image1",
},
Input1 = InstanceInput {
SourceOp = "FilmicTonemapping",
Source = "NumberIn1",
},
Input2 = InstanceInput {
SourceOp = "FilmicTonemapping",
Source = "NumberIn2",
},
Input3 = InstanceInput {
SourceOp = "FilmicTonemapping",
Source = "NumberIn3",
},
Input4 = InstanceInput {
SourceOp = "FilmicTonemapping",
Source = "NumberIn4",
},
Input5 = InstanceInput {
SourceOp = "FilmicTonemapping",
Source = "NumberIn5",
},
Input6 = InstanceInput {
SourceOp = "FilmicTonemapping",
Source = "NumberIn6",
},
Input7 = InstanceInput {
SourceOp = "FilmicTonemapping",
Source = "NumberIn7",
MaxScale = 20,
},
},
Outputs = {
MainOutput1 = InstanceOutput {
SourceOp = "FilmicTonemapping",
Source = "Output",
},
},
ViewInfo = GroupInfo { Pos = { 1045, 247.5, }, },
Tools = ordered() {
FilmicTonemapping = Custom {
CtrlWZoom = false,
CtrlWShown = false,
NameSet = true,
Inputs = {
NumberIn1 = Input { Value = 0.22, },
NumberIn2 = Input { Value = 0.3, },
NumberIn3 = Input { Value = 0.1, },
NumberIn4 = Input { Value = 0.2, },
NumberIn5 = Input { Value = 0.01, },
NumberIn6 = Input { Value = 0.3, },
NumberIn7 = Input { Value = 11.2, },
LUTIn1 = Input {
SourceOp = "FilmicTonemappingLUTIn1",
Source = "Value",
},
LUTIn2 = Input {
SourceOp = "FilmicTonemappingLUTIn2",
Source = "Value",
},
LUTIn3 = Input {
SourceOp = "FilmicTonemappingLUTIn3",
Source = "Value",
},
LUTIn4 = Input {
SourceOp = "FilmicTonemappingLUTIn4",
Source = "Value",
},
Setup1 = Input { Value = "n5/n6", },
Setup2 = Input { Value = "n4*n6", },
Setup3 = Input { Value = "n4*n5", },
Setup4 = Input { Value = "n3*n2", },
Intermediate1 = Input { Value = "( ( (n7*(n2*n7+s4)+s3) / (n7*(n1*n7+n2)+s2) ) - s1) ", },
RedExpression = Input { Value = "( ( (r1*(n2*r1+s4)+s3) / (r1*(n1*r1+n2)+s2) ) - s1) *i1", },
GreenExpression = Input { Value = "( ( (g1*(n2*g1+s4)+s3) / (g1*(n1*g1+n2)+s2) ) - s1) *i1", },
BlueExpression = Input { Value = "( ( (b1*(n2*b1+s4)+s3) / (b1*(n1*b1+n2)+s2) ) - s1) *i1", },
NumberControls = Input { Value = 1, },
NameforNumber1 = Input { Value = "Shoulder Str.", },
NameforNumber2 = Input { Value = "Linear Str.", },
NameforNumber3 = Input { Value = "Linear Angle", },
NameforNumber4 = Input { Value = "Toe Str.", },
NameforNumber5 = Input { Value = "Toe Num.", },
NameforNumber6 = Input { Value = "Toe Denum.", },
NameforNumber7 = Input { Value = "White Point", },
ShowNumber8 = Input { Value = 0, },
ShowPoint1 = Input { Value = 0, },
ShowPoint2 = Input { Value = 0, },
ShowPoint3 = Input { Value = 0, },
ShowPoint4 = Input { Value = 0, },
ShowLUT1 = Input { Value = 0, },
ShowLUT2 = Input { Value = 0, },
ShowLUT3 = Input { Value = 0, },
ShowLUT4 = Input { Value = 0, },
Comments = Input { Value = "Filmic tonemap operator is based on John Hable's work for Unchartered 2:  http://filmicgames.com/archives/75\r\n\r\nCopyright 2013 Martin Geupel\r\nThanks goes to Simon Lundberg for the respective Nuke Gizmo!\r\nFeel free to re-use, adapt, distribute and change tool to suit your needs, but please don't sell it.", },
},
ViewInfo = OperatorInfo { Pos = { 0, 10.15, }, },
},
FilmicTonemappingLUTIn1 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
},
},
SplineColor = { Red = 204, Green = 0, Blue = 0, },
CtrlWShown = false,
},
FilmicTonemappingLUTIn2 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
},
},
SplineColor = { Red = 0, Green = 204, Blue = 0, },
CtrlWShown = false,
},
FilmicTonemappingLUTIn3 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
},
},
SplineColor = { Red = 0, Green = 0, Blue = 204, },
CtrlWShown = false,
},
FilmicTonemappingLUTIn4 = LUTBezier {
KeyColorSplines = {
[0] = {
[0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
[1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
},
},
SplineColor = { Red = 204, Green = 204, Blue = 204, },
CtrlWShown = false,
},
},
},
},
ActiveTool = "FilmicTonemapping1",
}
--- End code ---

Just copy the code to your flow window or save it as a .setting in your usermacro folder.
Btw, all macros should be used with linear (gamma 1.0) input!


[EDIT]
Captain Obvious added a macro for Nuke!
For download and more details see Post #6
forum.corona-renderer.com/index.php/topic,1807.msg13558#msg13558

[Another EDIT]
Added the Filmic Curve tonemapping as a separate Tool. Big thanks to Captain Obvious for the idea and the guideline ;)

Juraj:
I am more and more inclined to have a look at Fusion. The guys at Uniform shown it and it did seemed simplier than maybe I feared/expected (I have a nightmare even from opening Nuke).

I had a brief look at the script but still have hard time envisioning how it works exactly. I have very mixed feelings about the look it produces. Not that I liked Reinhard (quite opposite..) but there's something about it I can't put my finger at, and prefer to do the tonemapping through curves in post.

Captain Obvious:
Great, thanks! I implemented it in my Nuke tone mapper gizmo as well. I can post it if anyone's interested.


Corona's tonemapper produces exactly the same results as Reinhard tonemapping. It's just that the settings work differently.

Juraj:

--- Quote from: Captain Obvious on 2013-10-17, 15:40:37 ---Great, thanks! I implemented it in my Nuke tone mapper gizmo as well. I can post it if anyone's interested.


Corona's tonemapper produces exactly the same results as Reinhard tonemapping. It's just that the settings work differently.

--- End quote ---

Is that really so ? I thought the result with Reinhard became somehow more saturated instead.

racoonart:
Fusion is pretty easy to learn, imho way more intuitive than nuke. It's btw relatively easy to use nuke if you know fusion - the concepts are mostly the same - but the overall usage is a lot easier to learn by trying things out in fusion. Nuke has some pitfalls here and there which are simply not existing in fusion (or you don't notice at first ;) ) and scare new users. I love fusion and it's such a pleasure to work with it. I can't imagine to do my work in any layer based compositing program like AE (totally pain in the ass)

The tone-mapping stuff is something I use very rarely, never in max directly (just in corona while rendering and playing with the values). I always save my images linear and do curves in the post. For me it's just a very useful thing to be able to achieve the exact same highlight compression in fusion than the way it is in corona - in case I liked what I saw when playing with the values at render time (or my boss or client etc).
The problem with this kind of compression is (imho) the reduced contrast in the midtones. I tend to reduce the compression just to the highlights with little influence into the midtones (for the soft transition).


--- Quote from: Captain Obvious on 2013-10-17, 15:40:37 ---Great, thanks! I implemented it in my Nuke tone mapper gizmo as well. I can post it if anyone's interested.

--- End quote ---

Why not, I'd appreciate if we could complete this thread for all different kind of compositing packages :) I'd modify the topic name then :)

Navigation

[0] Message Index

[#] Next page

Go to full version