我正在 libGDX 中创建一个 3d 游戏。出于某种原因,我的游戏一直在打印
DefaultShaderProvider: Creating new shader
在终端。这让我非常疯狂,因为那条线路的垃圾邮件我无法使用终端调试我的程序。我检查了我的代码是否有任何可以打印的内容,但我找不到任何可以打印的内容。
谁能告诉我为什么会这样?
这是我的代码:
public class puppetDemo implements ApplicationListener {
public PerspectiveCamera camera;
public ModelBatch modelBatch;
public ModelInstance box;
public ModelInstance sphere;
public Array<ModelInstance> instances = new Array<ModelInstance>();
public AssetManager assets;
public Lights lights;
public CameraInputController camController;
public boolean loading = true;
@Override
public void create() {
camera = new PerspectiveCamera(67, Gdx.graphics.getWidth(),
Gdx.graphics.getHeight());
camera.position.set(10f, 0f, -100f);
camera.lookAt(0, 0, 0);
camera.near = 0.1f;
camera.far = 300f;
camera.update();
lights = new Lights();
lights.ambientLight.set(0.4f, 0.4f, 0.4f, 1f);
lights.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f,
-0.2f));
assets = new AssetManager();
assets.load("data/box.obj", Model.class);
assets.load("data/sphere.obj", Model.class);
}
@Override
public void resize(int width, int height) {
}
@Override
public void render() {
Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(),
Gdx.graphics.getHeight());
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
modelBatch = new ModelBatch();
modelBatch.begin(camera);// Begin Rendering
modelBatch.render(instances, lights);
modelBatch.end();// End Rendering
}
@Override
public void pause() {
}
@Override
public void resume() {
}
@Override
public void dispose() {
modelBatch.dispose();
}
}