Settings are an object used to create an instance of
HTMLCanvasElement. Optional. For sharing canvas. Example: use THREE.js and GPU.js on same canvas.
WebGLRenderingContext. For sharing rendering context. Example: use THREE.js and GPU.js on same rendering context.
Sometimes, you want to produce a
canvas image instead of doing numeric computations. To achieve this, set the
true and the output dimensions to
. The thread identifiers will now refer to the
y coordinate of the pixel you are producing. Inside your kernel function, use
this.color(r,g,b,a) to specify the color of the pixel.
To strongly type a function you may use settings. Settings take an optional hash values:
returnType: optional, defaults to float, the value you’d like to return from the function
argumentTypes: optional, defaults to float for each param, a hash of param names with values of the return types.
Please find many more examples here.