GL11.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureId());
pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);
    public void render(Spatial spat, Texture tex) {        if (!isSupported) {            return;        }        // clear the current states since we are renderering into a new location        // and can not rely on states still being set.        try {            if (pbuffer.isBufferLost()) {                LoggingSystem.getLogger().log(Level.WARNING,                        "PBuffer contents lost - will recreate the buffer");                deactivate();                pbuffer.destroy();                initPbuffer();            }            // Override parent's last frustum test to avoid accidental incorrect            // cull            if (spat.getParent() != null)                spat.getParent().setLastFrustumIntersection(                        Camera.INTERSECTS_FRUSTUM);            if (!useDirectRender                    || tex.getRTTSource() == Texture.RTT_SOURCE_DEPTH) {                // render and copy to a texture                activate();                doDraw(spat);                copyToTexture(tex, pBufferWidth, pBufferHeight);                deactivate();            } else {                // setup and render directly to a 2d texture.                GL11.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureId());                activate();                pbuffer.releaseTexImage(Pbuffer.FRONT_LEFT_BUFFER);                doDraw(spat);                deactivate();                pbuffer.bindTexImage(Pbuffer.FRONT_LEFT_BUFFER);            }            tex.setNeedsFilterRefresh(true);        } catch (Exception e) {            LoggingSystem.getLogger().throwing(this.getClass().toString(),                    "render(Spatial, Texture)", e);        }    }