4 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 produce
by kevingadd 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. Then you're literally running the whole thing on-GPU. Not aware of ways to do that at present with DX9-class hardware or with the WebGL feature set. Modern desktop GL and DirectX let you write to and read from basically anything, as I understand it.
- 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!