Hacker News new | ask | show | jobs
by tehsauce 3116 days ago
Compute shaders are not supported in webgl, but is possible to perform vector operations by rendering to a texture with the fragment shader. It's basically a hack. The trick is rendering an image without putting it on the screen, storing arbitrary data into the pixels. This has limitations, but is actually good enough for many vector and matrix operations. I believe this method was even used with desktop opengl when gpus were first being used for general computing and didn't have more flexible apis yet like opencl/cuda