Hi, for my device Google Nexus 10 Mali T-608,
The solution was very simple you have to properly setup texture like this
osg::ref_ptr<osg::Texture2D> tex = new Texture2D;
tex->setTextureSize(texWidth, texHeight);
tex->setInternalFormat(GL_RGBA8);
tex->setSourceFormat(GL_RGBA);
//for RGB565
//tex->setInternalFormat(GL_RGB565);
//tex->setSourceFormat(GL_RGB);
//for GL_R8
// tex->setInternalFormat(GL_R8);
// tex->setSourceFormat(GL_RED);
tex->setSourceType(GL_UNSIGNED_BYTE);
tex->setResizeNonPowerOfTwoHint(false);
tex->setFilter(Texture::MIN_FILTER, Texture::LINEAR);
tex->setFilter(Texture::MAG_FILTER, Texture::LINEAR);
tex->setWrap(Texture::WRAP_S, Texture::CLAMP_TO_EDGE);
tex->setWrap(Texture::WRAP_T, Texture::CLAMP_TO_EDGE);
and after that
colorCamera1->attach(osg::Camera::COLOR_BUFFER, tex.get());
colorCamera1->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
So if you don't set source format for texture you've got black screen.
But on PC on nvidia drivers all work fine without sorce format.
Also you can use NPOT textures like 2D textures - you have to setup texture
coordinates from 0,0 to 1,1.
And don't use osg::Camera::COLOR_BUFFER0-N because GL ES2 don't support MRT.
Cheers,
Roman
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=56161#56161
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org