CUDA or WebCL with Cesium

  1. Are there any plans to integrate WebCl such as into cesium. What would be the best approach for starting such a piece of work-can you recommend anyone who would be interested in such a project. Do you have any advice as to the best WebCl implementation to choose: Nokia vs Samsung?

Same as 1. above but using the below repo to expose CUDA functionality. Or is there a better option that people can recommend

Hi Per,

Although I haven’t looked at WebCL in a while, last time I did, we could not share buffers between WebCL and WebGL, which means that if we compute positions, for example, in WebCL, we would have to bring them back to CPU memory and then re-upload them to the GPU for use with WebGL. This will hurt performance, of course.

As for node-cuda, this is the first I’ve heard of it so I really can’t speak to it. Sounds cool though.

If you can do interop with WebGL buffers, the code to look at in Cesium is in Buffer.js.


seems to be keeping it on the device. so, with that in mind what is the advice on the most “Cesium” way to integrate this

We’ve used Cesium with node.js for non-WebGL things. I suppose the first thing to do is to get Cesium fully running with node.js perhaps with node-webgl, if you haven’t already. Then we’ll need to know more about what your trying to achieve, but most likely you’ll be computing positions or other data in a WebCL kernel that you’ll want to access as WebGL buffers in Cesium. We’ll need to know what type of rendering you want before we can point you in the right direction.

You can also checkout the renderer section of the Architecture Guide, which is a bit dated, but still a reasonable overview.


you’re spot on, say i have a list of towns(3000ish) and another list of vehicles(14000ish) scattered all over the globe, then I want to compute kNN for all vehicles and then have those k towns glow or something on the map when i hover over a vehicle. the calc will be trivial on the gpu if is anything to go by.

To do this well, you’re probably going to want custom rendering code like in this Sandcastle example. Then, as I mentioned before, the WebCL/WebGL buffer interop changes can happen in Buffer.js and perhaps a bit of VertexArray.js and createBuffer in Context.js.

Alternitively, you could try to hook into the buffer management in BillboardCollection.js, for example, but it will require a fair amount of work.

To prototype, consider bringing the WebCL data back to the CPU first - just don’t look at the performance numbers!