Question

glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

and used this in the fragment shader.

I've used Alpha blend to get the transparency working however it only seems to work from one side.

Not sure what the problem is, am new to programming and shading.

http://imgur.com/WDK4qjc Link to see the picture

Was it helpful?

Solution

I think you see 2 distant faces blending where color is darker.

Maybe Culling is not activated.

Face culling is the ability to discard face drawing upon certain condition.

To achieve what you want, You have to discard faces not facing the camera which is call backface culling. You do this:

glEnableGL(GL_CULL_FACE);  //(enable face culling)
glCullFace(GL_BACK);       //(discard back faces)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top