- The render-to-texture code of jPCT-AE is totally untested. It's a straight port from the desktop version, so it should work if Android's drivers work correctly...but as we all know, they don't. So there is a chance that it won't work even if everything else is correct.
- Make sure that your texture has a power of two size that's smaller than the framebuffers. 60*60 isn't a good size, use 64*64 instead.
Done.
I noticed I couldnt have textures of 90x90 early because it got a
"- ERROR: Can't render into a texture larger than the current framebuffer!"error. (despite the fact the framebuffer is specified as 100,100)
Was this because it was rounding up internally to 128x128?
- Make sure to remove the render target before using the texture in the actual rendering.
- There's still a little ugliness in jPCT (both versions) when is comes to blitting: It requires that a world has been rendered at least once into the buffer to blit into. Any world will do. Try something like:
Texture textTexture = new Texture(64,64, RGBColor.BLACK);
FrameBuffer meep = new FrameBuffer(gl, 100, 100);
World tw=new World();
tw.renderScene(meep);
tw.draw(meep);
meep.display();
meep.setRenderTarget(textTexture);
meep.clear(RGBColor.BLACK);
glFont.blitString(meep, " test test test! ",
5, 5, 10, RGBColor.WHITE);
meep.display();
Thanks for your help, but I gave that a go and still nothing/transparent.
Not sure where to put that meep.removeRenderTarget(); though. Is it rendered into the texture on that ".display()", and thus any time after will do?
Where are you calling this? In onDrawFrame()?
No, onSurfaceCreate() at the moment.
What I really want to do is create a texture based on some text at any point though.
My goal is to effectively make a "add marker here" function. Which, given some text, and a position, will display a billboard with the text on at that position.
So far Ive made the billboard, complete with my own rectangle object...
Now I'm trying to assign a custom texture at that point.
[attachment deleted by admin]