There are some examples on the site of compute shades in the gallery section though it makes use of g4l and is therefore not necessarily accessible to everyone.

You could alternatively create a sketch with multiple pairs of canvas elements or pimage elements.

One for numbers before the decimal and another for numbers after the decimal.

Using base 256 multiplication combined with modulus you could update the canvas to store a very large numbee. This could then be sent to the shader to do calculations.

```
Int a = floor(num *256*256*256*256) %256 would for example locate the red pixel and the number could the be stored there using
col = color(a, g, b, alpha) ;
```

Note that you would need to repeat the process four times to completely fill the pixel.

Then shader would retrieve all the values in a format of 0-1.0 so you would need to multiply everything by 255 then revers the process to restore the value, in the shader, however you could just use normal shader operations.

The next part is maybe a little bit more difficult as you need to either use simple operations or make use of Ann evaluation parser which you write in the shader itself unless you wanted to hardcode the operations required directly in the shader.

This is something I’ve been attempting to do recently I’ve coded the base 256 conversion, currently writing a parser although there are lots floating around on the internet and you therefore don’t need to reinvent the wheel unless you want a coding exercise.

As for sending the parser operations and variables to the shader I haven’t got that far yet, the parser is still incomplete, operations include

/-+*^() sin cos tan simple, these should be the basics required and it also stores variables but is limited to the range of the alphabet.

After that you need to consider how to send the order of operations to the shader and how to retrieve them in order the variables etc, and whether or not you are making use of dynamic or static variables. Static are set outside the shader and so parts of the expression could be calculated outside the shader then imported, and dynamic variables would be set outside the shader but updated during the shades calculations.

So begin with setting some arrays in the shader, for operations and variables, note that shades do not have dynamic arrays and so you would need to set a maximum size, then set them in the sketch and send them to the shader.

Then finally when all operations are completed you retrieve the values back in the sketch by reversing the base 256 operations. If you are creating a particle shader then this might not be necessary as once you’ve initialised the positions and velocities vertices. The shader would then update continuously until you needed to read the positions.

There’s probably more to it I have quite finished yet and my code is likely to bery confusing.