Archived

This topic is now archived and is closed to further replies.

ah ! where's the color gone...

This topic is 4948 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Particle system explosion below: The partciles are always white although examining the color says that the RGB value is R=1.0, G=0.5 to 0.9, and B=0 always. So what''s wrong (by teh wya, the same particle system seems fine on another demo): glDisable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_texture); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); scalar_t size; CVector pos; CVector temp; glBegin(GL_QUADS); for (int i = 0; i < m_numParticles; ++i) { glColor4fv(m_particleList.m_color); //THIS SEEMS FINE //do tex coords etc //.... // } glEnd(); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); glEnable(GL_DEPTH_TEST);

Share this post


Link to post
Share on other sites
My guess is that the blending functions are wrong. Try this instead:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 

If you really intend to blend based on destination alpha, make sure that you''ve actually requested alpha for the destination buffer...

Share this post


Link to post
Share on other sites