// Initialize texture renderer
protected Pbuffer init(final int width, final int height, final int texID) {
Pbuffer pbuffer = null;
try {
final RenderTexture rt = new RenderTexture(true, false, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
pbuffer = new Pbuffer(width, height, new PixelFormat(16, 0, 0, 0, 0), rt, null);
// Initialise state of the pbuffer context.
pbuffer.makeCurrent();