Jump to content
  • Advertisement
Sign in to follow this  
GreenCode

Blending several polygons makes the last image very shiny!!!

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

Here is the deal, i want to make a good looking smoke out of a texture but when i make 3 or 4 rectangles with such texture and i want to blend them, the last image is very shiny. According to mathematic stuff and blending function i use, this behavior makes sense. I want to make a particle system where the parts which all textures are available is not so shiny.

Here are the statemachine whatsoevers:

glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glEnable(GL_DEPTH_TEST) ;
glDepthFunc(GL_ALWAYS);
glBlendFunc (GL_SRC_ALPHA,1);

Please help me out. Also if you have good tutorials or links about making clouds, fire, particle systems and etc please let me know.

Share this post


Link to post
Share on other sites
Advertisement
You shouldn't specify a number for glBlendFunc, but GL_ONE, if that's the behavior you want (though GL_ONE happens to be 1, so that's not a problem). However, in this case I believe you want glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA).

Share this post


Link to post
Share on other sites
Be aware if you change the blendfunc as Eric suggested, then you will have to depth-sort your quads to get an accurate result.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!