0
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.

https://i.stack.imgur.com/D4mbF.jpg Link to see the picture

2 Answers2

1

Everything is fine. It's called Transparency Sorting.

Some more info:
http://www.opengl.org/archives/resources/faq/technical/transparency.htm
Rendering transparent objects in OpenGL
opengl z-sorting transparency

Community
  • 1
  • 1
Volodymyr B.
  • 3,369
  • 2
  • 30
  • 48
1

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)
j-p
  • 1,622
  • 10
  • 18