Loading...
Logo
Processing Forum

Processing and GPU

in General Discussion  •  Other  •  3 months ago  
Dear All,
 
I am simulating the second-order wave equation in Processing and was wondering if there a possibility / a way to parallelise the calcualtion to the computer's GPU from Processing?
 
Thank you.

Replies(4)

Re: Processing and GPU

3 months ago
Processing supports GLSL shaders.

See: File > Examples > Topics > Shaders

If you can write your program as a (fragment) shader you can run it directly on the GPU.
Great thank you for that, however can you 'get' information from the fragment shader into Processing, or does it just set the colour of the pixels on the screen?

Re: Processing and GPU

3 months ago
The latter. Alternatively you can use the vertex shader to for example change the color and position of vertices. Often shader-based programs (especially fragment shaders) move everything to the shader so the application won't need to get back any information, since CPU-GPU interactions are a bottleneck.

How the shaders operate under Processing isn't different from their regular task. So Processing just allows you to use shaders, the complexity of shaders themselves remains unchanged. See the world wide web for examples and information on GLSL shaders as such.

Re: Processing and GPU

3 months ago

Thank you very much.