Hi All
I’m trying to render a large amount of particles using the MSAopenCL addon in OF 7.
All the behaviors and such work great, but i can’t seem to bind a texture to the the particles properly.
All my research pointed to the following code.
glEnable( GL_BLEND );
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glPointSize(32);
glEnable(GL_POINT_SPRITE);
glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, partPosVbo);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, 0);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, partColVbo);
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(4, GL_FLOAT, 0, 0);
partImage.getTextureReference().bind();
glDrawArrays(GL_POINTS, 0, NUM_PARTICLES);
partImage.getTextureReference().unbind();
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
It does work, but for some reason it only takes the first (2x2) 4 pixels from my texture.
The texture is a png file. I tried using different sizes (128x128, 16x16), without any result.
the texture renders fine to the screen using draw()
The same code (in another example) is working fine under OF 6
What am i missing here?