Thank you for the answer,
At the beginning i create an Overlay object sceneImageOverlay having a NPOTTexture npotTexture as texture.
The overlay has the screen sizes, screenWidth,screenHeight.
The overlay is created in the onSurfaceChanged method
npotTexture = new NPOTTexture(screenWidth,screenHeight,new RGBColor(255, 255, 0) );//null);//null for rendering
textureManager.addTexture("npotTexture ", npotTexture );
sceneImageOverlay = new Overlay(world, 0, 0, screenWidth,screenHeight, "npotTexture ", true);
sceneImageOverlay.setDepth(900);
sceneImageOverlay.setVisibility(false);
sceneImageOverlay.setSourceCoordinates(0, 0, screenWidth, screenHeight);
In the application i render off screen 2 3d objects. After that i add the removed sceneImageOverlay showing the NPOT texture with the rendered 2 3d objects.
In onDrawFrame method i do this
world.removeObject(sceneImageOverlay.getObject3D());//remove the overlay,must not participate in the off screen rendering.
frameBuffer.setRenderTarget(npotTexture );//use for rendering the NPOT texture with screenWidth and screenHeight dimensions
//clear screen
frameBuffer.clear(back);
ObjectA_3D.setVisibility(true); //must exist in the off screen rendering
ObjectB_3D.setVisibility(true); //must exist in the off screen rendering
world.renderScene(frameBuffer);
world.draw(frameBuffer);
frameBuffer.display();
//--- till here the npot texture has the two 3d objects drawn in it's surface
//---- NOW SHOW THE OVERLAY WITH THE npot_Texture TEXTURE -------
world.addObject(sceneImageOverlay.getObject3D());//add the overlay because has the npot texture.
sceneImageOverlay.getObject3D().setVisibility(true);
frameBuffer.removeRenderTarget();//use the on screen renderer
frameBuffer.clear(back);
ObjectA_3D.setVisibility(false); //we dont want it to participate in the on screen rendering
ObjectB_3D.setVisibility(false); //we dont want it to participate in the on screen rendering
world.renderScene(frameBuffer);
world.draw(frameBuffer);
frameBuffer.display();
Finally on screen the sceneImageOverlay's npot texture is displayed.
How do you think about this solution?
I used overlay instead of plane, i dont know which is the better solution.
Now i want to apply some effects on this NPOT texture.
Behind sceneImageOverlay is drawn another overlay with depth =1000 ,which has on it's texture a captured image.
So i want to replace the red pixels of the sceneImageOverlay with transparent pixels to show on screen the captured image's pixels of the same position with red pixels.
I think i can use a fragment shader's discard command to do this.
The next step is to replace the blue pixels of sceneImageOverlay with the corresponding pixels of another texture.
Till now i havent found a solution.I think a small demo from you will be very helpfull.
The displayed npot texture is shown upside down.How can I fix this problem?
Thanks in advance