Skip to content

Commit 04444c9

Browse files
endankegithub-actions[bot]
authored andcommitted
Multiply model material override opacity with layer opacity
GitOrigin-RevId: 802f9105503be30263d0b52efba98ea3042106c9
1 parent 8a4f097 commit 04444c9

File tree

3 files changed

+105
-1
lines changed

3 files changed

+105
-1
lines changed

3d-style/render/program/model_program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const modelUniformValues = (
130130
colorMix.b = materialOverride.color.b;
131131
colorMix.a = materialOverride.colorMix;
132132
emissiveStrength = materialOverride.emissionStrength;
133-
opacity = materialOverride.opacity;
133+
opacity = materialOverride.opacity * opacity;
134134
}
135135

136136
const uniformValues = {
5.17 KB
Loading
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"version": 8,
3+
"metadata": {
4+
"test": {
5+
"width": 128,
6+
"height": 128,
7+
"allowed": 0.0015
8+
}
9+
},
10+
"lights": [
11+
{
12+
"type": "ambient",
13+
"id": "environment",
14+
"properties": {
15+
"intensity": 0.4
16+
}
17+
},
18+
{
19+
"type": "directional",
20+
"id": "sun_light",
21+
"properties": {
22+
"intensity": 0.6,
23+
"cast-shadows": true,
24+
"shadow-intensity": 1.0
25+
}
26+
}
27+
],
28+
"sources": {
29+
"3d-model-source": {
30+
"type": "model",
31+
"models": {
32+
"ego-car-2" : {
33+
"uri": "local://models/ego_car.glb",
34+
"position": [-74.0136, 40.7153],
35+
"orientation": [0, 0, 0],
36+
"materialOverrides": {
37+
"lights_brakes": {
38+
"model-color": [0.88, 0.0, 0.0],
39+
"model-color-mix-intensity": 1.0,
40+
"model-emissive-strength": 0.8,
41+
"model-opacity": 1.0
42+
},
43+
"lights-brakes_reverse": {
44+
"model-color": [0.88, 0.0, 0.0],
45+
"model-color-mix-intensity": 1.0,
46+
"model-emissive-strength": 0.8,
47+
"model-opacity": 1.0
48+
},
49+
"lights_brakes_volume": {
50+
"model-color": [0.88, 0.0, 0.0],
51+
"model-color-mix-intensity": 1.0,
52+
"model-emissive-strength": 0.8,
53+
"model-opacity": 1.0
54+
},
55+
"lights-brakes_reverse_volume": {
56+
"model-color": [0.88, 0.0, 0.0],
57+
"model-color-mix-intensity": 1.0,
58+
"model-emissive-strength": 0.8,
59+
"model-opacity": 1.0
60+
}
61+
},
62+
"nodeOverrides": {
63+
"trunk": {
64+
"orientation": [-45.0, 0.0, 0.0]
65+
}
66+
}
67+
}
68+
}
69+
}
70+
},
71+
"pitch": 55,
72+
"zoom": 17.50,
73+
"bearing": 0,
74+
"center": [
75+
-74.01362,
76+
40.7153
77+
],
78+
"camera": {
79+
"camera-projection": "orthographic"
80+
},
81+
"layers": [
82+
{
83+
"id": "background",
84+
"type": "background",
85+
"paint": {
86+
"background-color": "lightgray"
87+
}
88+
},
89+
{
90+
"id": "3d-model-layer",
91+
"type": "model",
92+
"source": "3d-model-source",
93+
"paint": {
94+
"model-scale": [
95+
10,
96+
10,
97+
10
98+
],
99+
"model-type": "location-indicator",
100+
"model-opacity": 0.2
101+
}
102+
}
103+
]
104+
}

0 commit comments

Comments
 (0)