SHARE
TWEET
Untitled
a guest
Sep 13th, 2014
241
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- public PerspectiveCamera cam = new PerspectiveCamera(80, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
- public FrameBuffer FBO;
- public TextureRegion fboRegion;
- public ModelBatch modelBatch;
- public SpriteBatch spriteBatch;
- create(){
- FBO = new FrameBuffer(Format.RGBA4444,Gdx.graphics.getWidth(),Gdx.graphics.getHeight(),false);
- fboRegion = new TextureRegion(FBO.getColorBufferTexture());
- fboRegion.flip(false, true);
- }
- render(){
- gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
- gl.glClearColor(0, 0.5f, 0.9f, 1);
- gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
- cam.update();
- FBO.begin();
- modelBatch.begin(cam);
- modelBatch.render(modelInstance1, environment);
- modelBatch.render(modelInstance2, environment);
- modelBatch.end();
- FBO.end();
- spriteBatch.begin();
- fboRegion.setTexture(FBO.getColorBufferTexture());
- spriteBatch.draw(fboRegion, 0, 0);
- spriteBatch.end();
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
