My model viewer in C# is having issues with textures. if i draw a texture that is transparent, instead of showing the model through the transparent part and just putting a texture over the model, it completely covers the model and makes the model invisible there. what im saying is the model wont show through transparent textures and it should
Asked
Active
Viewed 982 times
1 Answers
2
You need to enable alpha blending explicitly:
GL.Enable(EnableCap.Blend);
GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);

The Fiddler
- 2,726
- 22
- 28
-
I am doing that... If i dont do that the background of the argb textures is black. with the blending its transparent but the model underneath doesnt show through the transparent part – user3441843 Apr 01 '14 at 21:47
-
You must render your model first, and then render the transparent part. If you do it in the opposite direction, z-buffering will discard your background model and it will not show. – The Fiddler Apr 16 '14 at 20:41