Example usage for com.badlogic.gdx.graphics.g3d ModelBatch ModelBatch

List of usage examples for com.badlogic.gdx.graphics.g3d ModelBatch ModelBatch

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g3d ModelBatch ModelBatch.

Prototype

public ModelBatch(final String vertexShader, final String fragmentShader) 

Source Link

Document

Construct a ModelBatch with the default implementation and the specified ubershader.

Usage

From source file:com.github.fauu.helix.core.Renderer.java

License:Open Source License

public Renderer() {
    renderContext = new com.badlogic.gdx.graphics.g3d.utils.RenderContext(
            new DefaultTextureBinder(DefaultTextureBinder.WEIGHTED, 1));

    shaderProvider = new ShaderProvider();

    modelBatch = new ModelBatch(renderContext, shaderProvider);

    fb = new FrameBuffer(Pixmap.Format.RGBA8888, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false);

    spriteBatch = new SpriteBatch();

    waterCamera = new PerspectiveCamera(50, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    waterCamera.position.set(0, 0, 0);/*from   ww  w  .j ava2  s .c  om*/
    waterCamera.rotateAround(new Vector3(0, 0, 0), new Vector3(0, 1, 0), -90);
    waterCamera.lookAt(0, 1f, -1);
    waterCamera.near = 0.01f;
    waterCamera.far = 300;
    waterCamera.position.add(11, 0, 22);
    waterCamera.update();
}