Sign in to follow this  
Slug

Alpha Blending not working like i want...

Recommended Posts

Slug    100
Hi, i just have a little problem with the reflection in my game. When i reder the reflected meshs, i blend them with the reflector surface, but the problem arise when two or more overlapping polygon are drawn at the same time. The two color add together and this make a darker spot than suposed, scrapping the effect. Here a snapshot of the problem: My glBlendFunc code is declared like that: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); How can i solve that?

Share this post


Link to post
Share on other sites
hrm... I would advice you to put that image on some webspace somewhere instead of having it sit on your machine... just a tiny bit hard for us other people to see it otherwise ;)

Share this post


Link to post
Share on other sites
Ilici    862
Quote:
Original post by Slug



You can't post a picture like that you need some webspace somewhere. Try ImageShack.

I'm guessing you want to do some kind of stencil reflection. First of all, you don't need to blend the reflected geometry, you can blend a big flat surface on top to make it look like water or something.

Secondly if you really want to blend it like that you'll need to do 2 passes. First pass you only draw in the Zbuffer thus storing the final Z values (glColorMask). Then you disable Zwrite and Ztest and render in the color buffer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this