gpu.js icon indicating copy to clipboard operation
gpu.js copied to clipboard

using GLSL vec2 and vec3 types and their accelerated functions

Open itsKaspar opened this issue 5 years ago • 2 comments

Is there a way to use vector types, accelerated functions and basic operators that are usually provided by GLSL ?

Right now I'm recoding my own functions to calculate distances between points, to calculate vector magnitudes, and each time I want to divide a vector by a scalar, I have to divide the x, y and z component individually.

Is there something that I'm missing ?

Some issues mention that this support has been added but I can not find anything about it in the doc, are there any examples ?

itsKaspar avatar Dec 30 '20 21:12 itsKaspar

@itsKaspar I found this comment in another issue with example usage of glsl builtin functions. https://github.com/gpujs/gpu.js/issues/385#issuecomment-432861373

Chlor87 avatar Mar 16 '21 20:03 Chlor87

as shown by the demo if you really want to these features I'd suggest gpu.addNativeFunction()

valen214 avatar Apr 05 '22 02:04 valen214