Hi! I’ve been playing with Camera and FBO for some off-screen rendering recently. It worked great but when I try to do the following thing, the FBO got transparency. I wanted it to be opaque.
- Set up a camera with CameraFlag::USER1. Attach a FrameBuffer to it.
- Generate a Texture2D from raw byte array
gridDataI set some pixels’ alpha value to
0x03(format is RGBA4444)
texGrid->initWithData( gridData, dataLen, Texture2D::PixelFormat::RGBA4444, potWidth, potHeight, Size(potWidth, potHeight) );
- create a Sprite from the texture2D. with camera mask USER1.
- create a Sprite from the FrameBuffer and display it on screen.
The result looks OK except for those
alpha values are also copied to the resulting FBO, making the texture created from it semi-transparent as well. How to make the result opaque (Without creating an additional background image)? Any help is appreciated.