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.

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:

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?

Quote

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:

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?

Quote

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...

No idea...maybe it just isn't working in the way it should because of some driver issues. It wouldn't be the first thing that is on Android. However, it's better if you can manage to render the text into an int[]-array or at least a Bitmap anyway. With both, you can create (Bitmap) or update (int[] via an ITextureEffect, the prefered way) a texture and use that as texture for your billboard. Raft's GlFont class creates textures with those letters too, so it may help as a starting point.

Wouldn't that recreate the texture each frame :?Seems a bit wasteful. The thing I'm doing the texture might be updated but certainly not every frame.Basically the AddPlacemark(X,Y,"any text goes here") will be triggered a lot as the programs loading, then maybe once or twice after its already loaded.Mostly the textures will be just like any other texture when created.

Quote

no idea...maybe it just isn't working in the way it should because of some driver issues. It wouldn't be the first thing that is on Android. However, it's better if you can manage to render the text into an int[]-array or at least a Bitmap anyway. With both, you can create (Bitmap) or update (int[] via an ITextureEffect, the prefered way) a texture and use that as texture for your billboard. Raft's GlFont class creates textures with those letters too, so it may help as a starting point.

Sorry,The canvas solution works, as in, it appears on the object perfectly after that code is run.

However it has a few problems;

a) if I then trigger the same code again with a different string, the old texture remains on the object.(this is where I tried "tm.replaceTexture("testText2", testtext);" rather then "addTexture" if the texture already had been put on it once, but it had no effect).

b) The other problem is the texture comes out with the text being transparent, but on a white background. So you can see the camera view though the text itself;

I can't verify a)...it works just fine in a test case of mine. Can you post the code snippet that you use to do this? In addition, make sure to call TextureManager.unload(...) for the old texture before replacing it, because otherwise, it will stay in GPU's memory forever. However, this shouldn't prevent the texture from changing.

b) is actually a feature of jPCT as it converts all black parts of a texture to transparent. If you don't want this, either use a color above #0f0f0f for the text or try new Texture(yourBitmap, true); so that the alpha channel isn't calculated based on the pixel data but on the channel that the bitmap contains. You just have to make sure that it doesn't contain one in your example. Another option is to leave everything as it is and call texture.removeAlpha() after creating the texture.

I can't verify a)...it works just fine in a test case of mine. Can you post the code snippet that you use to do this? In addition, make sure to call TextureManager.unload(...) for the old texture before replacing it, because otherwise, it will stay in GPU's memory forever. However, this shouldn't prevent the texture from changing.

I fixed the problem, it was a daft error of mine where the code I thought was being triggered wasn't.Added the unload too, thanks for the advice.

Quote

b) is actually a feature of jPCT as it converts all black parts of a texture to transparent. If you don't want this, either use a color above #0f0f0f for the text or try new Texture(yourBitmap, true); so that the alpha channel isn't calculated based on the pixel data but on the channel that the bitmap contains. You just have to make sure that it doesn't contain one in your example. Another option is to leave everything as it is and call texture.removeAlpha() after creating the texture.

Bingo. That worked a charm.I used the "true" flag as I will probably want to use my own alpha later.