@@ -37,8 +37,8 @@ async function main() {
37
37
center : CENTER
38
38
} )
39
39
40
- const result = await getLidarStreamer ( device , 'https://nyc-lidar-demo.s3.amazonaws.com/987210.bin' )
41
- // const result = await getLidarStreamer(device, 'https://nyc-lidar-demo.s3.amazonaws.com/midtown-sampled-xl.bin')
40
+ // const result = await getLidarStreamer(device, 'https://nyc-lidar-demo.s3.amazonaws.com/987210.bin')
41
+ const result = await getLidarStreamer ( device , 'https://nyc-lidar-demo.s3.amazonaws.com/midtown-sampled-xl.bin' )
42
42
// const result = await getLidarStreamer(device, 'https://nyc-lidar-demo.s3.amazonaws.com/manhattan-sampled-lg.bin')
43
43
44
44
const { getCurrentPointCount, offset, buffer : vertexBuffer } = result
@@ -155,9 +155,9 @@ async function main() {
155
155
} ,
156
156
primitive : { topology : 'point-list' } ,
157
157
depthStencil :{
158
- format : " depth24plus" ,
158
+ format : ' depth24plus' ,
159
159
depthWriteEnabled : true ,
160
- depthCompare : " less"
160
+ depthCompare : ' less'
161
161
}
162
162
} )
163
163
@@ -185,21 +185,22 @@ async function main() {
185
185
]
186
186
} )
187
187
188
+ const depthTexture = device . createTexture ( {
189
+ size : { width : canvas . width , height : canvas . height } ,
190
+ format : 'depth24plus' ,
191
+ usage : GPUTextureUsage . RENDER_ATTACHMENT
192
+ } )
193
+
188
194
requestAnimationFrame ( function render ( t ) {
189
195
requestAnimationFrame ( render )
190
196
191
197
const commandEncoder = device . createCommandEncoder ( )
192
198
const curTexture = context . getCurrentTexture ( )
193
199
const textureView = curTexture . createView ( )
194
200
const { width, height } = curTexture
195
- const depthTexture = device . createTexture ( {
196
- size : [ width , height , 1 ] ,
197
- format : 'depth24plus' ,
198
- usage : GPUTextureUsage . RENDER_ATTACHMENT
199
- } )
200
201
201
- camera . up = [ 0 , 0 , 1 ]
202
202
camera . tick ( )
203
+ camera . up = [ 0 , 0 , 1 ]
203
204
const projection = mat4 . perspective ( new Float32Array ( 16 ) , Math . PI / 4 , width / height , 1 , 1000000 )
204
205
const view = camera . matrix
205
206
const fadeHeightStart = minZ + 1200 // 2100
0 commit comments