www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: lanslot on March 24, 2016, 09:22:24 am

Title: GLSurfaceView Transparent Problem
Post by: lanslot 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?
Title: Re: GLSurfaceView Transparent Problem
Post by: EgonOlsen on March 24, 2016, 02:31:39 pm
Do you have a screen shot?
Title: Re: GLSurfaceView Transparent Problem
Post by: lanslot 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
(https://lh3.googleusercontent.com/ewq6njAQAxHlNVv6VDgWrEOy_kJhrlOmFuhcvvvICcRptgEia8ObK5rqBTvxOjAZ0KMTNFJQn2ZVp7l2gzmTY6C8W0uMHeXzyvFleM2ocWmTiO75yE6J_PjrJyihRmP-Cr8Z5lWD06YX-FkqK_tzlJhNqlEybtGFDce7Q7IgVxiBbiVX1F8CwY0r2CuUIYmsBEGkmI_fxk9zpZlvhomvBNkSBB6j7cWW4JKKKHB_N4_47uxYr85eW3cegWKqv31FDbLZW4fn-WlxkSz8w6XGmTXIUOmZqB51MZerXUGtipl6SinrQ3Bt0GKyxxUttx7Qh_ObfxTl7MICxeB-8Vwd4HdFWqfgRljsrUlJfeO64RiYNgrIyCSgRS7fHyKPdL60hVX_9KPWO6SsnY-UfwkhZrqib4wgAz2TpEsZ5XYyxPyxSmgy4I3PxcELyvwviEeAQ6mWy8C-VkHNe6Q4Q9AFxxf6-LqW2nqPkNdfJd54ysveYqoKmdnwVnr_2932ENArOk787Wkg3Il0ZBmQkJ9tGtGnO9wfBd9cGWG2vSnfiAyrA9hvrTO5-m-xhpVbbjjojS8=w448-h795-no)
Title: Re: GLSurfaceView Transparent Problem
Post by: EgonOlsen 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.