-
Notifications
You must be signed in to change notification settings - Fork 43
/
ColorShuffle.osl
51 lines (50 loc) · 1.7 KB
/
ColorShuffle.osl
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
// Adrian Cruceru
// Redshift Rendering Technologies 2020
// channel shuffler
// This file is licensed under Apache 2.0 license
shader ColorShuffle
[[ string help = "Shuffles Channels",
string label = "Shuffle Channels",
string category = "Color" ]]
(
color inColor = color(0,0,0)
[[ string label="Input" ]],
int inR = 0
[[ string label= "Red Channel",
string widget = "mapper",
string options = "Red:0|Green:1|Blue:2" ]],
float redScale = 1
[[ string label = "Red Scale",
float min = 0,
float max = 1]],
int inG = 1
[[ string label= "Green Channel",
string widget = "mapper",
string options = "Red:0|Green:1|Blue:2" ]],
float greenScale = 1
[[ string label = "Green Scale",
float min = 0,
float max = 1]],
int inB = 2
[[ string label= "Blue Channel",
string widget = "mapper",
string options = "Red:0|Green:1|Blue:2" ]],
float blueScale = 1
[[ string label = "Blue Scale",
float min = 0,
float max = 1]],
output float outRed = 1
[[ string label = "Red Output"]],
output float outGreen = 1
[[ string label = "Green Output"]],
output float outBlue = 1
[[ string label = "Blue Output"]],
output color outColor = 1
[[ string label = "Out Color"]]
)
{
outRed = inColor[inR]*redScale;
outGreen = inColor[inG]*greenScale;
outBlue = inColor[inB]*blueScale;
outColor = color(outRed,outGreen,outBlue);
}