I am trying to implement a Particle System using GLSL. I have run into some troubles rendering the final result of the calculations. An outline of my program is as follows:
1: On start of particle system I render the initial positions and velocities to two separate textures using an Frame Buffer Object (FBO) with the two textures attached as render targets.
2: I intend to use a Vertex Buffer Object for rendering the Particel System as GL_POINTS. Basically I give an index array to the VBO with consecutive numebers and an array with zeros as positions. When rendering the VBO I use a vertex shader that reads the textures with initial positions and velocities in order to calculate the current position using a uniform variable for the time parameter.
The problem is that I cannot get anything to show in my scene. My prime suspition is that I do not get sensible data from the to sampler2D texture look-ups. I have just set one sampler2D to 0 and the other to 1. How can I be sure that I am reading from the correct textures? I would also be thankful for any good pointers or conceptual description of how I should procede to achieve what I want.
It really seems that there is only garbage data. My shaders are initialized by setting the two sampler2D uniforms to 0 and 1 respectively. I think the problem has to do with which texture units are bound, but have not been able to verify this.
My code us as follows: