-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAFXToneMap.gizmo
More file actions
100 lines (97 loc) · 2.69 KB
/
AFXToneMap.gizmo
File metadata and controls
100 lines (97 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#! /usr/local/Nuke10.5v1/libnuke-10.5.1.so -nx
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2012-2017, Ryan P. Wilson
#
# Authority FX, Inc.
# www.authorityfx.com
# Algorithms from https://github.com/AuthorityFX/afx-nuke-plugins/blob/master/src/afx_tone_map.cpp
version 10.5 v1
Gizmo {
inputs 2
addUserKnob {20 AFXToneMap}
addUserKnob {41 exposure l Exposure T Ctrls.exposure}
addUserKnob {41 darks l Darks T Ctrls.darks}
addUserKnob {41 clip l Clip T Ctrls.clip}
addUserKnob {41 knee l Knee T Ctrls.knee}
addUserKnob {41 metric l Metric T Ctrls.metric}
addUserKnob {41 red l Red -STARTLINE T Ctrls.red}
addUserKnob {41 green l Green -STARTLINE T Ctrls.green}
addUserKnob {41 blue l Blue -STARTLINE T Ctrls.blue}
addUserKnob {41 alpha l Alpha -STARTLINE T Ctrls.alpha}
}
Input {
inputs 0
name mask
xpos 314
ypos -293
number 1
}
Dot {
name Dot1
xpos 347
ypos -115
}
Input {
inputs 0
name Input
xpos 50
ypos -289
}
Dot {
name Dot2
xpos 83
ypos -205
}
set N70114d0 [stack 0]
Expression {
inputs 1+1
temp_name0 luma
temp_expr0 "0.3*r + 0.59*g + 0.11*b"
temp_name1 lightness
temp_expr1 "pow(0.2126*r + 0.7152*g + 0.0722*b, 1/3)"
temp_name2 metric
temp_expr2 "Ctrls.metric == 0 ? max(r, g, b) : Ctrls.metric == 1 ? luma : lightness"
temp_name3 scale
temp_expr3 "Ctrls.clip * pow(tanh(pow( pow(2.0, Ctrls.exposure) * (metric > 1 ? metric : pow(metric , clamp(1.0/Ctrls.darks, 0.008, 128))) / Ctrls.clip, Ctrls.knee)), 1.0 / Ctrls.knee) / max(metric, 0.000001)"
expr0 "Ctrls.red && metric > 0 ? r * scale : r"
expr1 "Ctrls.green && metric > 0 ? g * scale : g"
expr2 "Ctrls.blue && metric > 0 ? b * scale : b"
channel3 alpha
expr3 "Ctrls.alpha && a > 0 ? Ctrls.clip * pow(tanh(pow( pow(2.0, Ctrls.exposure) * (a > 1 ? a : pow(a , clamp(1.0/Ctrls.darks, 0.008, 128))) / Ctrls.clip, Ctrls.knee)), 1.0 / Ctrls.knee) : a"
name tone_map
selected true
xpos 50
ypos -119
}
Output {
name Output1
xpos 50
ypos -23
}
push $N70114d0
NoOp {
name Ctrls
xpos 183
ypos -209
addUserKnob {20 Controls}
addUserKnob {7 exposure l Exposure R -5 5}
addUserKnob {7 darks l Darks R 0 2}
darks 1
addUserKnob {7 clip l Clip R 0 10}
clip 5
addUserKnob {7 knee l Knee}
knee 0.5
addUserKnob {4 metric l Metric M {Value Luminance Lightness ""}}
metric Luminance
addUserKnob {6 red l Red -STARTLINE}
red true
addUserKnob {6 green l Green -STARTLINE}
green true
addUserKnob {6 blue l Blue -STARTLINE}
blue true
addUserKnob {6 alpha l Alpha -STARTLINE}
}
end_group