Previously my box2ddebugrenderer always worked, but at this moment, it seems to be failing on all my programs. I don’t know why this is, I’ve searched, without success. There are little to no topics about this problem and those that stated this problem, got no reactions. So maybe one of you ever experienced this problem, and know the proper solution.
Things I’ve tried:
[list]
- Searched the solution online
- Redownload LibGDX
- Testing the debugrenderer on multiple applications
Because I am not using any shaders, but the basic shaderprogram there is little information to provide you with.
But here we go:
[ErrorLog]
[/list]
Exception in thread "LWJGL Application" java.lang.IllegalArgumentException: no uniform with name 'u_projModelView' in shader
at com.badlogic.gdx.graphics.glutils.ShaderProgram.fetchUniformLocation(ShaderProgram.java:287)
at com.badlogic.gdx.graphics.glutils.ShaderProgram.fetchUniformLocation(ShaderProgram.java:277)
at com.badlogic.gdx.graphics.glutils.ShaderProgram.setUniformMatrix(ShaderProgram.java:507)
at com.badlogic.gdx.graphics.glutils.ShaderProgram.setUniformMatrix(ShaderProgram.java:498)
at com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer20.flush(ImmediateModeRenderer20.java:147)
at com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer20.end(ImmediateModeRenderer20.java:160)
at com.badlogic.gdx.graphics.glutils.ShapeRenderer.end(ShapeRenderer.java:1104)
at com.badlogic.gdx.physics.box2d.Box2DDebugRenderer.renderBodies(Box2DDebugRenderer.java:109)
at com.badlogic.gdx.physics.box2d.Box2DDebugRenderer.render(Box2DDebugRenderer.java:79)
at net.loco_coco.terraingeneration.states.GS_Game.render(GS_Game.java:75)
at net.loco_coco.terraingeneration.handlers.GameStateManager.render(GameStateManager.java:33)
at net.loco_coco.terraingeneration.main.Main.render(Main.java:50)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:215)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)
Creating the debugrenderer
public GS_Game(GameStateManager gsm) {
super(gsm);
b2dCam = new OrthographicCamera();
b2dCam.setToOrtho(false, Main.V_WIDTH / Vars.PPM, Main.V_HEIGHT / Vars.PPM);
debugRenderer = new Box2DDebugRenderer();
gravity = new Vector2(0, -9.81f);
world = new World(gravity, true);
createGround();
}
Rendering the debugrenderer
public void render(){
//clear screen
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
debugRenderer.render(world, b2dCam.combined);
}
Creating the Body
private void createGround(){
BodyDef bDef = new BodyDef();
bDef.type = BodyType.StaticBody;
bDef.position.set(0, 0);
CircleShape shape = new CircleShape();
shape.setRadius(3f);
shape.setPosition(new Vector2(0, 0));
FixtureDef fDef = new FixtureDef();
fDef.friction = 0.5f;
fDef.restitution = 0.05f;
fDef.shape = shape;
world.createBody(bDef).createFixture(fDef);
shape.dispose();
}
I’ve tried using another shaderprogram, but because I am not using any spritebatch so far, I cannot use the shaderprogram. I still think the problem is inside the libGDX Box2D.
If someone can post a working version of the Box2DDebugRender/ShaderProgram the problem will probably be fixed.
Thank you very much for reading.
-Rose