-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhuman.mdl
executable file
·161 lines (157 loc) · 4.33 KB
/
human.mdl
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
mdl 1.4;
using df import *;
using state import *;
using base import *;
using math import *;
using anno import *;
using daz_3d::property_annotations import *;
using sss import *;
using human::constants import *;
using human::hair import *;
using human::fluid import *;
using human::layer import *;
export enum scattering_profile {
black,
fluid,
hair,
iris,
nail,
sclera,
skin,
tooth
};
const float corrective_factor = 100;
export material human(
uniform scattering_profile profile = skin
[[
display_name("Scattering Profile"),
in_group("Base")
]],
color base_color = color(1.0)
[[
display_name("Base Color"),
in_group("Base"),
internal_name("Diffuse Color")
]],
float opacity_mask = 0.0
[[
display_name("Opacity Mask"),
in_group("Base"),
hard_range(0.0, 1.0)
]],
float glossy_weight = 1.0
[[
display_name("Glossy Weight"),
in_group("Glossy"),
hard_range(0.0, 1.0),
internal_name("Glossy Color")
]],
uniform float base_glossiness = 0.7
[[
display_name("Base Glossiness"),
in_group("Glossy"),
hard_range(0.0, 1.0)
]],
uniform float highlight_glossiness = 1.0
[[
display_name("Highlight Glossiness"),
in_group("Glossy"),
hard_range(0.0, 1.0)
]],
uniform float glossy_ior = 1.49
[[
display_name("Glossy IOR"),
in_group("Glossy")
]],
float3 base_bump = normal()
[[
display_name("Bump"),
in_group("Geometry"),
internal_name("Bump Strength")
]],
float3 base_normal = normal()
[[
display_name("Normal"),
in_group("Geometry"),
internal_name("Normal Map")
]],
float3 displacement = float3(0.0)
[[
display_name("Displacement"),
in_group("Geometry"),
internal_name("Displacement Strength")
]],
float cutout_opacity = 1.0
[[
display_name("Cutout Opacity"),
in_group("Geometry"),
internal_name("Cutout Opacity")
]],
uniform bool thin_walled = false
[[
display_name("Thin Walled"),
in_group("Geometry"),
internal_name("Thin Walled")
]]
) =
profile == black ?
material():
profile == fluid ?
fluid_material(
ior: glossy_ior,
thin_walled: thin_walled
):
profile == hair ?
hair_material(
base_color: base_color,
base_glossiness: base_glossiness,
highlight_glossiness: highlight_glossiness,
base_bump: base_bump,
displacement: displacement,
cutout_opacity: cutout_opacity,
thin_walled: thin_walled
):
/* default */
layered_material(
base_color: base_color,
opacity_mask: opacity_mask,
glossy_weight: glossy_weight,
base_glossiness: base_glossiness,
highlight_glossiness: highlight_glossiness,
glossy_ior: glossy_ior,
base_bump: base_bump,
base_normal: base_normal,
displacement: displacement,
cutout_opacity: cutout_opacity,
thin_walled: thin_walled,
absorption_coefficient:
profile == skin || profile == nail ?
dermis_absorption*corrective_factor:
profile == iris ?
iris_absorption*corrective_factor:
profile == sclera ?
base_skin_absorption*corrective_factor:
/* profile == tooth */
color(0.0),
scattering_coefficient:
profile == iris ?
iris_scattering*corrective_factor:
profile == sclera ?
iris_scattering*10*corrective_factor:
/* default */
dermis_scattering*corrective_factor,
anisotropy:
profile == skin || profile == nail ?
dermis_anisotropy:
profile == iris || profile == sclera ?
eye_anisotropy:
/* default */
0.0,
ior:
profile == iris || profile == sclera ?
eye_ior:
profile == nail || profile == tooth ?
hair_ior:
/* default */
skin_ior
);