Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering 3D Objects while using box2Dlights causes glitches #113

Open
MarcManhart opened this issue Aug 22, 2018 · 1 comment
Open

Rendering 3D Objects while using box2Dlights causes glitches #113

MarcManhart opened this issue Aug 22, 2018 · 1 comment

Comments

@MarcManhart
Copy link

MarcManhart commented Aug 22, 2018

Hi and thanks for this cool piece of software 👍
Now my Problem: Everything works fine, but when I start rendering 3D objects in my world, graphic glitches start approaching on them. In the example picture, you can see the effect on an green cube without any texture.

  • With box2Dlight:
    with box2Dlights

  • Without box2Dlight:
    without box2Dlights

In my render-loop, the source looks something like this:

init() {
        this.rayHandler = rayHandler;
        rayHandler.setCulling(true);
        rayHandler.setAmbientLight(0.1f, 0.1f, 0.1f, 0.5f);
        rayHandler.setAmbientLight(0.8f, 0.8f, 0.8f, 0.5f);
        rayHandler.setBlurNum(3);

        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));
}
render(float deltatime){
       //...
       // (render 2D/Sprites)
       // (render 3D objects)
       //...

       rayHandler.setCombinedMatrix(cam);
       rayHandler.updateAndRender();
}

How can I avoid these effects?

@rinold
Copy link
Contributor

rinold commented Aug 24, 2018

Hm. Frankly, haven't tried with 3d myself. I see you are rendering the box2dlights after the 3D objects -have you tried putting it before rendering them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants