-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
142 lines (137 loc) · 4.33 KB
/
settings.py
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
import open3d.visualization.gui as gui
import open3d.visualization.rendering as rendering
class Settings:
UNLIT = "defaultUnlit"
LIT = "defaultLit"
NORMALS = "normals"
DEPTH = "depth"
DEFAULT_PROFILE_NAME = "Bright day with sun at +Y [default]"
POINT_CLOUD_PROFILE_NAME = "Cloudy day (no direct sun)"
CUSTOM_PROFILE_NAME = "Custom"
LIGHTING_PROFILES = {
DEFAULT_PROFILE_NAME: {
"ibl_intensity": 45000,
"sun_intensity": 45000,
"sun_dir": [0.577, -0.577, -0.577],
# "ibl_rotation":
"use_ibl": True,
"use_sun": True,
},
"Bright day with sun at -Y": {
"ibl_intensity": 45000,
"sun_intensity": 45000,
"sun_dir": [0.577, 0.577, 0.577],
# "ibl_rotation":
"use_ibl": True,
"use_sun": True,
},
"Bright day with sun at +Z": {
"ibl_intensity": 45000,
"sun_intensity": 45000,
"sun_dir": [0.577, 0.577, -0.577],
# "ibl_rotation":
"use_ibl": True,
"use_sun": True,
},
"Less Bright day with sun at +Y": {
"ibl_intensity": 35000,
"sun_intensity": 50000,
"sun_dir": [0.577, -0.577, -0.577],
# "ibl_rotation":
"use_ibl": True,
"use_sun": True,
},
"Less Bright day with sun at -Y": {
"ibl_intensity": 35000,
"sun_intensity": 50000,
"sun_dir": [0.577, 0.577, 0.577],
# "ibl_rotation":
"use_ibl": True,
"use_sun": True,
},
"Less Bright day with sun at +Z": {
"ibl_intensity": 35000,
"sun_intensity": 50000,
"sun_dir": [0.577, 0.577, -0.577],
# "ibl_rotation":
"use_ibl": True,
"use_sun": True,
},
POINT_CLOUD_PROFILE_NAME: {
"ibl_intensity": 60000,
"sun_intensity": 50000,
"use_ibl": True,
"use_sun": False,
# "ibl_rotation":
},
}
DEFAULT_MATERIAL_NAME = "Polished ceramic [default]"
PREFAB = {
DEFAULT_MATERIAL_NAME: {
"metallic": 0.0,
"roughness": 0.7,
"reflectance": 0.5,
"clearcoat": 0.2,
"clearcoat_roughness": 0.2,
"anisotropy": 0.0
},
"Metal (rougher)": {
"metallic": 1.0,
"roughness": 0.5,
"reflectance": 0.9,
"clearcoat": 0.0,
"clearcoat_roughness": 0.0,
"anisotropy": 0.0
},
"Metal (smoother)": {
"metallic": 1.0,
"roughness": 0.3,
"reflectance": 0.9,
"clearcoat": 0.0,
"clearcoat_roughness": 0.0,
"anisotropy": 0.0
},
"Plastic": {
"metallic": 0.0,
"roughness": 0.5,
"reflectance": 0.5,
"clearcoat": 0.5,
"clearcoat_roughness": 0.2,
"anisotropy": 0.0
},
"Glazed ceramic": {
"metallic": 0.0,
"roughness": 0.5,
"reflectance": 0.9,
"clearcoat": 1.0,
"clearcoat_roughness": 0.1,
"anisotropy": 0.0
},
"Clay": {
"metallic": 0.0,
"roughness": 1.0,
"reflectance": 0.5,
"clearcoat": 0.1,
"clearcoat_roughness": 0.287,
"anisotropy": 0.0
},
}
def __init__(self):
self.mouse_model = gui.SceneWidget.Controls.ROTATE_CAMERA
self.bg_color = gui.Color(1, 1, 1)
self.show_skybox = False
self.show_axes = False
self.use_ibl = True
self.use_sun = True
self.new_ibl_name = None # clear to None after loading
self.ibl_intensity = 45000
self.sun_intensity = 45000
self.sun_dir = [0.577, -0.577, -0.577]
self.sun_color = gui.Color(1, 1, 1)
self.apply_material = True # clear to False after processing
self._materials = {
Settings.LIT: rendering.MaterialRecord(),
}
self._materials[Settings.LIT].base_color = [0.9, 0.9, 0.9, 1.0]
self._materials[Settings.LIT].shader = Settings.LIT
self.material = self._materials[Settings.LIT]