@Override public void create() { assets = new AssetManager(); String model = "Bambo_House.g3db"; assets.load(model, Model.class); assets.finishLoading(); modelInstance = new ModelInstance(assets.get(model, Model.class), new Matrix4().setToScaling(0.6f, 0.6f, 0.6f)); DefaultShader.Config config = new Config(); config.defaultCullFace = GL20.GL_NONE; ShaderProvider shaderProvider = new DefaultShaderProvider(config); modelBatch = new ModelBatch(shaderProvider); ModelBuilder builder = new ModelBuilder(); float groundSize = 1000f; ground = new ModelInstance(builder.createRect(-groundSize, 0, groundSize, groundSize, 0, groundSize, groundSize, 0, -groundSize, -groundSize, 0, -groundSize, 0, 1, 0, new Material(), Usage.Position | Usage.Normal), new Matrix4().setToTranslation(0, -0.01f, 0)); environment = new Environment(); environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f)); environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f)); VirtualReality.renderer.listeners.add(this); // VirtualReality.head.setCyclops(true); }
public static void createBatchs() { Config modelConfigShader = new Config(Gdx.files.classpath(VERTEX_SHADER).readString(), Gdx.files.classpath(FRAGMENT_SHADER).readString()); modelConfigShader.numBones = MAX_BONES; modelConfigShader.numDirectionalLights = 0; modelConfigShader.numPointLights = 0; modelConfigShader.numSpotLights = 0; modelBatch = new ModelBatch(new DefaultShaderProvider(modelConfigShader)); shadowBatch = new ModelBatch(new DepthShaderProvider()); floorBatch = new ModelBatch(new DefaultShaderProvider(Gdx.files.classpath(VERTEX_SHADER), Gdx.files.classpath(FLOOR_FRAGMENT_SHADER))); }