I am trying to recreate one of the Three.js FBO/GPGPU particle technique tutorials with OGL, but for the life of me cannot figure what is making the particles go haywire! I am using a single simulation shader and unlike this Three JS tutorial ( "Creating magical scenes with FBO" example) where I'm taking inspiration from, adding curl noise to the positions is giving me wild results.
Even in this Youtube tutorial by Yuri, he simply rotates the particles with basic polar coordinates technique inside the simShader and they rotate so gently. Every FBO particle tutorial does the same thing, changing position in simShader makes the positions react as if they were being manipulated in the main vertex shader.
I only get desired results when I am performing any sort of position distortion in the main vertex shader with no position tampering in the simShader which defeats the whole purpose of the GPGPU technique.
Another way to understand what I mean is, in the simShader, if you comment out position.xyz += (targetPos.xyz - position.xyz); and uncomment this line below it position.x += sin(uTime) * .01;, you will see that instead of the cube oscillating on the x-axis maintaining its width, it actually keeps squeezing over time.
I urge you to please take a look at this fiddle and help me fix it. This is making me go nuts.
I believe there is something fundamentally "different" with OGL's gpgpu against Three's, if someone is kind enough they can help us understand which would enhance the experience of using this library even more.
I am trying to recreate one of the Three.js FBO/GPGPU particle technique tutorials with OGL, but for the life of me cannot figure what is making the particles go haywire! I am using a single simulation shader and unlike this Three JS tutorial ( "Creating magical scenes with FBO" example) where I'm taking inspiration from, adding curl noise to the positions is giving me wild results.
Even in this Youtube tutorial by Yuri, he simply rotates the particles with basic polar coordinates technique inside the
simShader
and they rotate so gently. Every FBO particle tutorial does the same thing, changing position in simShader makes the positions react as if they were being manipulated in the main vertex shader.I only get desired results when I am performing any sort of position distortion in the main vertex shader with no position tampering in the
simShader
which defeats the whole purpose of the GPGPU technique.Another way to understand what I mean is, in the
simShader
, if you comment outposition.xyz += (targetPos.xyz - position.xyz);
and uncomment this line below itposition.x += sin(uTime) * .01;
, you will see that instead of the cube oscillating on the x-axis maintaining its width, it actually keeps squeezing over time.I urge you to please take a look at this fiddle and help me fix it. This is making me go nuts.
I believe there is something fundamentally "different" with OGL's gpgpu against Three's, if someone is kind enough they can help us understand which would enhance the experience of using this library even more.
Fiddle: https://jsfiddle.net/ug1qa8ek/21/