fast opengl texture overlay
in
Programming Questions
•
3 years ago
hello list,
i'm pretty new to opengl programming and i have a billion dollar question. I have a particle system running and i draw every particle with opengl
I'm drawing my particles in white over black background.
now I'd like to have a fancy effect in my sketch putting on top in "multiply" blending mode a texured quad.
The effect is done by gl.glBlendFunc(GL.GL_ZERO, GL.GL_SRC_COLOR);
the result is:
i like the result BUT THE PERFORMANCE IS SIGNIFICANTLY REDUCED. I know every cycle cpu have to calculate the blending on all screen, but
there is a way to speed up the rendering?
thanks a lot.
i'm pretty new to opengl programming and i have a billion dollar question. I have a particle system running and i draw every particle with opengl
- gl.glBegin(GL.GL_POINTS);
gl.glColor4f(1,1, 1,.5);
gl.glVertex2f(p[i].position().x(), p[i].position().y()); - gl.glEnd();
I'm drawing my particles in white over black background.
now I'd like to have a fancy effect in my sketch putting on top in "multiply" blending mode a texured quad.
- maskTexture.bind();
maskTexture.enable();
gl.glBegin(GL.GL_QUADS);
gl.glNormal3f( 0.0f, 0.0f, 1.0f);
gl.glTexCoord2f(0, 0);
gl.glVertex2f(0, 0);
gl.glTexCoord2f(1, 0);
gl.glVertex2f(width, 0);
gl.glTexCoord2f(1, 1);
gl.glVertex2f(width, height);
gl.glTexCoord2f(0, 1);
gl.glVertex2f(0,height);
gl.glEnd();
maskTexture.disable();
The effect is done by gl.glBlendFunc(GL.GL_ZERO, GL.GL_SRC_COLOR);
the result is:
i like the result BUT THE PERFORMANCE IS SIGNIFICANTLY REDUCED. I know every cycle cpu have to calculate the blending on all screen, but
there is a way to speed up the rendering?
thanks a lot.
1