
Show HN: Vulkan bindings for JavaScript - Schampu
https://github.com/maierfelix/node-vulkan
======
TekMol
Is there a benefit of using Vulkan over WebGL?

I would think you can achieve similar speed using WebGL in the browser and
then have all the comfortable functionality of the browser for free.

~~~
maeln
This is for Node.js, so it's for desktop app, not web app (it's not possible
to use Vulkan on the Web).

For the web, you have no choice but to use WebGL.

~~~
paraboul
The future is WebGPU.

If you're interested on why a Vulkan binding for the web is not a good idea, I
found this doc (from two engineers working at Google) quite interesting :
[https://docs.google.com/document/d/1-lAvR9GXaNJiqUIpm3N2XuGU...](https://docs.google.com/document/d/1-lAvR9GXaNJiqUIpm3N2XuGUWv_JrkpGizDN0bNq7wY/edit#)

~~~
maeln
Thank you for the document !

Definitely, having some form of GPGPU on the web is the next step. It is
currently one of my few complaint with WebGL: The lack of compute shader.

~~~
fulafel
You can do GPU compute without the OpenGL "compute shader" feature. WebGL 2
has much improved features for it vs WebGL 1.

There are existing GPGPU things running on WebGL, see eg
[https://github.com/tensorflow/tfjs-core](https://github.com/tensorflow/tfjs-
core) and [https://magenta.tensorflow.org/demos/#web-
apps](https://magenta.tensorflow.org/demos/#web-apps)

~~~
maeln
But WebGL compute shader are under an extension which, as far as I know,
doesn't have much support yet :/

------
Yoric
Pretty cool!

------
AnonymousMouse
What is the point of using a low overhead graphics API like Vulkan if you're
just gonna crush performance with JavaScript?

~~~
worldsayshi
The performance critical aspects of an app shouldn't need to run on the
topmost abstraction layer.

JavaScript should tell the CPU what to do, not how to do it.

Edit: If there are CPU intensive tasks that also need to be customized for a
particular app we should perhaps have some way to define those tasks in a way
that gives you as developer more control of performance characteristics. I
guess this is one of the intentions behind WebAssembly?

