Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: RTX Real-Time Ray Tracing in JavaScript (github.com/maierfelix)
5 points by _s47s on March 25, 2019 | hide | past | favorite | 2 comments



I was under the impression that the main benefit of Vulcan was reduced CPU overhead and allow multithreading for GPU related code.

It seems like pairing it with node negates most of that advantage. Is that an accurate assumption?

If it is, why use a vulkan api rather than an OpenGL or WebGL api?


Vulkan has a very verbose setup phase, but after that you only make some tiny calls here and there (Draw a frame, update some UBOs), so the CPU load isn't that high because you record most things at start-up.

Multi-threading is possible with SharedArrayBuffers [0] and N-API allows to take the memory address of it. NVK is only a thin layer above Vulkan and JavaScript <-> C++ interopability is pretty fast. You only notice some overhead when making thousands of calls, because the C++ code cannot be inlined. But again, this is not something common in Vulkan.

Also JavaScript doesn't have essential features like Compute shaders for years now. Vulkan has all of it. Even though WebGPU [1] is in development, I don't expect it to give access to the Vulkan RTX pipeline anytime soon.

[0] SharedArrayBuffer: https://v8docs.nodesource.com/node-4.8/d4/db8/classv8_1_1_sh...

[1] WebGPU: https://github.com/gpuweb/gpuweb




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: