Author Topic: GLSurfaceView Transparent Problem  (Read 503 times)

Offline lanslot

  • byte
  • *
  • Posts: 11
    • View Profile
GLSurfaceView Transparent Problem
« on: March 24, 2016, 09:22:24 am »
private RGBColor back = new RGBColor(0, 0, 0, 0);

mGLView.setZOrderOnTop(true);
        mGLView.setZOrderMediaOverlay(true);
        mGLView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
        mGLView.getHolder().setFormat(PixelFormat.TRANSLUCENT);

        renderer = new MyRenderer();

        mGLView.setRenderer(renderer);

I loaded my model,glsurfaceview's background be transparent,but the same ,model's black area be transparent too
what should i do?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: GLSurfaceView Transparent Problem
« Reply #1 on: March 24, 2016, 02:31:39 pm »
Do you have a screen shot?

Offline lanslot

  • byte
  • *
  • Posts: 11
    • View Profile
Re: GLSurfaceView Transparent Problem
« Reply #2 on: March 25, 2016, 03:59:57 am »
i fixed this problem
i change texture's black area to dark-grey
but i still don't know how to fix this question in code

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: GLSurfaceView Transparent Problem
« Reply #3 on: March 25, 2016, 09:31:54 am »
The conversion of black areas to transparent ones happens automatically. If you don't want that, load the texture with constructor that takes a boolean in addition and set it to true.