3 ms·
> Texture upload is a great choice because it means your particle update routine can be a pixel shader that you run the current 'state' texture through to produ
by exDM69 13y ago
> Texture upload is a great choice because it means your particle update routine can be a pixel shader that you run the current 'state' texture through to produce a new 'state' texture.
Yep. This is how GPGPU programs were done some 10 years ago when there was no API to deal with GPU buffers in a more flexible way.
These days we've got Transform Feedback (aka. Stream Out in D3D) and Compute Shaders that are more flexible. And Cuda and OpenCL, of course.
One thing you should be aware of when doing this kind of texture-to-texture GPGPU is that the internal GPU pipeline in GLES2 (and thus, WebGL) may be less than full 32 bit floating point. Also the texture formats being used are not full floats. So watch out for numerical precision issues!