-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathToParts.osl
65 lines (61 loc) · 1.93 KB
/
ToParts.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Copyright 2023 Laika, LLC. Authored by Mitch Prater.
*
* Licensed under the Apache License Version 2.0 http://apache.org/licenses/LICENSE-2.0,
* or the MIT license http://opensource.org/licenses/MIT, at your option.
*
* This program may not be copied, modified, or distributed except according to those terms.
*/
#include "LaD.h"
shader LaD_ToParts
[[
int rfm_nodeid = 1234263,
string rfm_classification = "rendernode/RenderMan/pattern/Laika"
]]
(
string Notes = ""
[[
int connectable = 0,
string help =
"Convert a LaSh Displacement (LaD) struct into its component parts: "
"<p>"
"<b>Mask</b>: the displacement mask. "
"<br/><b>Thickness</b> "
"<br/><b>Accumulation</b> "
"<br/><b>TauScale</b>: the optical density scale. "
"<br/><b>Nd</b>: the displaced surface normal. "
"<br/><b>DeltaP</b>: the vector displacement. "
"<br/><b>Bulk</b>: the displacement's accumulation bulk. "
"<p/>"
]],
float CascadeNormal = 1.0
[[
string label = "Cascade Normal",
int slider = 1, float slidermin = 0.0, float slidermax = 1.0,
string help =
"Pass-through the input <b>LaD</b>'s normal (1), "
"or replace it with the original surface normal (0). "
]],
LaD_struct LaD = LaD_INIT
[[
string readOnly = "True",
string help =
"A LaSh Displacement (LaD). "
]],
output float Mask = 1.0,
output float Thickness = 0.0,
output float Accumulation = 0.0,
output float TauScale = 1.0,
output normal Nd = N,
output vector DeltaP = vector(0.0),
output float Bulk = 0.0
)
{
Mask = LaD.Mask;
Thickness = LaD.Thickness;
Accumulation = LaD.Accumulation;
TauScale = LaD.TauScale;
Nd = normalize( mix( N, LaD.Nd, CascadeNormal ));
DeltaP = LaD.DeltaP;
Bulk = LaD.Bulk;
}