Archived

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

Blending problems

This topic is 5592 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

OK this is what I do: ///////////////////////////// //draw all opaque objects glDepthMask(GL_FALSE); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE);//don''t know which one''s the //the best glColor4f(1.0f,1.0f,1.0f,0.5f); for all transparent objects draw object glColor4f(1.0f,1.0f,1.0f,1.0f); glDisable(GL_BLEND); glDepthMask(GL_TRUE); ///////////////////////////// Now, I''ve got this little problem, say I draw 2 transparent objects with both maybe the same texture. The second one I draw will be much more opaque than the second one. This might be a real simple sulotion or problem on my side, but excuse my stupidity. Is it that I''m using the wrong blendfunctions or something or maybe I should reinitialize it within the loop or maybe it''s something way different.I dunno... Can anyone help me ? Thxz alot --------------- Gaming is Life ---------------

Share this post


Link to post
Share on other sites
>>Now, I''ve got this little problem, say I draw 2 transparent objects with both maybe the same texture. The second one I draw will be much more opaque than the second one. This might be a real simple sulotion or problem on my side, but excuse my stupidity.<<

whats the problem?

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
If the two transparent objects are overlapping on the screen then that''s what you should see. If not, it looks like something is happening while drawing the objects that changes GL state or something.

Share this post


Link to post
Share on other sites
zedzeek - The problem is that the second transparent object is far too bright or should I say opaque than the first, and both used the same blend src dst values.

zppz - That''s precisely kind of the problem, but none of the objects were overlapping

But good news I found the problem anyway - The transparent objects was in a linked list and all that happened was I accedentily draw them more than once, lol, pathetic.

Anyway thx for replies!!!

---------------
Gaming is Life
---------------

Share this post


Link to post
Share on other sites