0

I have a problem to make my texture transparent. I'm new to OpentTK so can please someone help me. I'm using ES11. Here is my code where i load texture.

        GL.BindTexture (All.Texture2D, tex_id);

        GL.TexParameterx (All.Texture2D, All.TextureMagFilter, (int)All.Linear);
        GL.TexParameterx (All.Texture2D, All.TextureMinFilter, (int)All.Linear);
        GL.TexParameterx (All.Texture2D, All.TextureWrapS, (int)All.ClampToEdge);
        GL.TexParameterx (All.Texture2D, All.TextureWrapT, (int)All.ClampToEdge);

        Bitmap text = Bitmap.CreateBitmap(400, 200, Bitmap.Config.Argb8888);

        Canvas canvas = new Canvas(text);
        Paint p = new Paint {
            AntiAlias = true,
            Color = Color.Rgb(0x55, 0x55, 0xff)
        };


        p.SetXfermode (new PorterDuffXfermode (PorterDuff.Mode.Src));
        p.TextSize = 60;
        p.TextAlign = Paint.Align.Center;
        Paint.FontMetrics fm = p.GetFontMetrics ();
        canvas.DrawText ( string1, 200, 60, p);
        canvas.DrawText ( string2, 200, 130, p);


        Android.Opengl.GLUtils.TexImage2D ((int)All.Texture2D, 0, text, 0);
Braca
  • 3
  • 4
  • Have you called `GL.Enable(EnableCap.Blend)` and set the correct blending function? The [OpenGL wiki](http://www.opengl.org/wiki/Blending) is a good reference on blending. – The Fiddler Jun 04 '14 at 22:11
  • Yes, have enabled blend: GL.Enable(All.Blend); GL.BlendFunc(All.SrcAlpha, All.OneMinusSrcAlpha); But it isn't helping. Do i need to use shaders, and how (I'm not sure how to use shader's in ES11). – Braca Jun 05 '14 at 12:23

0 Answers0