-
Notifications
You must be signed in to change notification settings - Fork 8
/
scene.yaml
196 lines (186 loc) · 5.91 KB
/
scene.yaml
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
import:
- styles/popup.yaml
- styles/breathe.yaml
- styles/dots.yaml
- styles/halftone.yaml
- styles/halftone.yaml
- styles/windows.yaml
sources:
mapzen:
type: MVT
url: https://tile.nextzen.org/tilezen/vector/v1/512/all/{z}/{x}/{y}.mvt
url_params:
api_key: NaqqS33fTUmyQcvbuIUCKA
tile_size: 512
max_zoom: 16
cameras:
perspective:
type: perspective
# focal_length: 1
focal_length: [[16, 2], [17, 2.5], [18, 3], [19, 4], [20, 6]] # pairs of [zoom, focal len]
vanishing_point: [-250, -250] # relative to center of screen, in pixels
isometric:
type: isometric
axis: [0,1]
lights:
key:
type: directional
direction: [-.2, 1, -1]
diffuse: 1
ambient: .6
styles:
rainbow:
base: polygons
animated: true
shaders:
blocks:
global: |
// hue-saturation-value to RGB color space converter, to allow hue cycling
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
color: |
// set an hsv value with hue varied by z-position (aka height) and by time
// then convert to rgb and set pixel color
vec3 c = vec3(worldPosition().z * .003 + u_time / 10., 1.0, 1.0);
color.rgb = hsv2rgb(c);
elevator:
base: polygons
animated: true
shaders:
blocks:
position: |
// Elevator buildings
if (position.z > 0.01) {
position.z *= (sin(position.z + u_time) + 1.0);
}
layers:
earth:
data:
source: mapzen
layer: earth
draw:
polygons:
order: function() { return feature.sort_rank; }
color: [0.175, 0.175, 0.175]
landuse:
data:
source: mapzen
layer: landuse
draw:
polygons:
order: function() { return feature.sort_rank; }
color: [0.5, 0.875, 0.5]
pitch:
filter:
kind: ['pitch', 'garden', 'playground']
draw:
polygons:
color: [0.3, 0.675, 0.3]
water:
data:
source: mapzen
layer: water
draw:
polygons:
order: function() { return feature.sort_rank; }
color: [0.5, 0.5, 0.875]
outline:
# don't draw outlines on ocean or riverbank features
filter: {not: {kind: [ocean, river, riverbank]}}
draw:
lines:
color: [0.6, 0.6, 0.975]
order: function() { return feature.sort_rank; }
width: function () {
return (
$zoom >= 16 && (2.5 * Math.log($zoom))
);
}
roads:
data:
source: mapzen
layer: roads
draw:
lines:
order: function () { return feature.sort_rank; }
outline:
color: [0.7, 0.7, 0.7]
width: 1
highway:
filter: { kind: highway }
draw:
lines:
color: [1.0, 1.0, 1.0]
width: 9
tunnel:
filter: { is_tunnel: yes }
draw:
lines:
color: '#333'
width: 6
outline:
order: 352 # magic number
color: white
width: 1
major_road:
filter: { kind: major_road }
draw:
lines:
color: [0.5, 0.5, 0.5]
width: 5
minor_road:
filter: { kind: minor_road }
draw:
lines:
color: [0.65, 0.65, 0.65]
width: 4
path:
filter:
kind: path
draw:
lines:
color: [0.8, 0.8, 0.8]
width: 3
rail:
filter:
kind: rail
not: { is_tunnel: yes }
draw:
lines:
color: [0.5, 0.0, 0.0]
width: 3
outline:
order: 352 # magic number
width: .5
buildings:
data:
source: mapzen
layer: buildings
filter: { $geometry: polygon } # filter out address points in buildings layer
draw:
polygons:
order: function() { return feature.sort_rank; }
color: [.6, .6, .6]
# at z15, only extrude buildings over 20 m; at z16 and higher, extrude all buildings
extrude: function () { return (($zoom >= 15 && feature.height > 20) || $zoom >= 16) }
# buildings with a name only
namedBuildings:
filter: { name: true }
draw:
polygons:
color: [.6, .2, .2]
# buildings with a name and a kind
namedKindBuildings:
filter: { kind: true }
draw:
polygons:
color: [.6, .2, .6]
# buildings with a kind only
kindBuildings:
filter: { name: false, kind: true }
draw:
polygons:
color: [.2, .2, .6]