joshbrew / babylon_1000_lights_example

1000 lights on 1000 individual meshes at 60fps, can we get a proper web based forward+ engine now?

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

babylon_1000_lights_example

Capture

1000 lights on 1000 individual meshes + instances at 60fps, can we get a proper web based forward+ engine now?

Works about the same in WebGL or WebGPU. If I push it to 10K objects with 1000 light sources (so 10 instances per), then I get about 10FPS more on WebGPU, still about 55FPS on a single thread, not bad! Initial compilation time is just slow as you scale up. It starts getting VERY slow after 800 lights due to the recursive compilation process.

Note you can extend this with instances but each instance uses the same parent material so instanced meshes need to be close to the maximum of 4 light sources that can effect a single material. You can sort of fake a forward+ scene this way and reassign affected meshes on the fly CPU-side but this is not as efficient as proper modern lighting engines.

Just open the HTML file in browser, it will use cdn links to pull BabylonJS.

About

1000 lights on 1000 individual meshes at 60fps, can we get a proper web based forward+ engine now?


Languages

Language:HTML 100.0%