CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.67k stars 3.43k forks source link

PointCloud rendering performance a lot worse for opaque rendering than transparent #9239

Open conradlempert opened 3 years ago

conradlempert commented 3 years ago

The performance of rendering 3D tilesets (point clouds) is much better when rendering with a transparent style compared to opaque. In my case it was especially apparent with multiple point clouds rendered at the same position with a lot of overlap. (Use case: multitemporal point clouds).

My machine is a 2016 MacBook Pro with a 2GHz i5, 8 GB RAM and an integrated Intel Iris 540 graphics card with 1.5GB VRAM.

I could reproduce it in a sandcastle on Cesium 1.75. I basically added the point cloud 50 times to make performance critical on my machine. You can switch between opaque and transparent with the transparent variable.

https://sandcastle.cesium.com/#c=dVTbbts4EP2VgVugMuqlJEuylNYNGrgINkCCGHZ2+6IXWhrHbCnSJSlnvUX+fYeS3bXTVg8iObczc2bIMJxroRzMpG5rWO1hbvSawRwdGriSEtUIZlq2zUpw+EuJHRor3B4WeqWdqCzc8hWDZcWVEurRB7iS+IWr2mh4MLqqtBRAR7jjDgXMhK64kQJZqXbcwE7gEwF9AIVPMEMr2ob93cmCclB155lWjguFphyM4HupACg1QxLKdCdqNO+OjpVBAvmsjawfepNgOCrV8/B9qXo4JyRadOd4/ZJ8euiVQYfRGvkj7o1WC7S6NRWytdHNlSWzmzqIJ+k4foFg3V7i/eoLVh7FhyIGNOVYDhrxT/D6++z+9n7xPOrFwZtX1933ZgQRi4bdPx6WA4p5HvL3KS+9OjjB7ZMJQ5htuHpEcBthwWmwiLBFs9am4apCqMV6jQZpW6pKK+vAGa7slpPMJ+9Mi8dQN8qTazH8hP0GFI0EdU6vj6Ra4NRtU/sxILQ98UVFNtvWT9IJbqloF/jCBIFE72mZQubXt2+HHWP9UDBboUK2NaIRjubOMl7XwQHM1whiHZxkPDwMR2/Ajqx1q7d+Jk47Sk+jG/zWonULVDRId7rG/+s+s6tx1T4uN/rp2vAG7RzNEomz+pSmM4eKzAxnlIkf536makISijuh1buzbnLjaMdVEngzgDSN4jxN2SRN4zRL4nTUy8fjLMpilsZRXlzEcZSND4o0u8jSccSSPM2LNE0SLx52Sm0EkfMz6J/IfavmwlWbhZbyAJ0R6CRPkiLKouQiz/IDwh8RG+eTSZTHWVIkF0UxOSgmbFzElEuRZ2kURUV2hD5cisFoMO16cNnbA3wUzVYb569YwFjosNlKurc2XLXVV+pcZW3XXvqm4anrtBY7EPWHX7wMUEluLWnWrZRL8S+Wg8tpSPY/uUrd1X1PD5nke2+2iS9veyFjbBrS8deeTmu54uZF5P8A

lilleyse commented 3 years ago

I actually see the opposite on my machine (Nvidia 2070). But if I had to guess the depth write is becoming a synchronization bottleneck point when there's many overlapping points, which wouldn't happen in the translucent pass.

conradlempert commented 3 years ago

I tested again on other graphics cards on my Windows working station, and experienced the same results as you did when you tried the Nvidia 2070, opaque was better than transparent. Seems to be a specific problem with the Intel HD 540.

For my MacBook with the Intel HD 540, switching between Chrome/Safari doesn't make a difference. I also verified that macOS isn't the problem since I also tried Windows 10 on my MacBook Pro, on Chrome and Edge, and both gave the same results.

GPU / opaque FPS / transparent FPS / OS

Intel HD 540 / 7 FPS / 35 FPS / macOS Intel HD 540 / 7 FPS / 20 FPS / Windows Intel HD 610 / 20 FPS / 15 FPS / Windows (rendered with only 10 point clouds since this card is weak) AMD RX 480 / 60 FPS / 40 FPS / Windows