Questions tagged [box2dlights]

Box2dLights is a open source framework for dynamic 2d lights and shadows for android and desktop using box2d physic geometry and raycasting.

Box2DLights is a 2D lighting framework that uses box2d for raycasting and OpenGL ES 2.0 for rendering. This library is intended to be used with libgdx.

35 questions
7
votes
2 answers

Libgdx light without box2d

I just started creating a game using libgdx. It is a top down 2d shooter using scene2d ui. Now i thought, that i could add darkness and light to some levels, but i don't want to rewrite everything using box2d. I don't need realistic shadows just…
Springrbua
  • 8,377
  • 9
  • 48
  • 92
5
votes
1 answer

Box2d raycast vs AABB query performance

I'm currently trying to improve performance of a game that makes use of box2d physics (actually box2dlights). I have a method that makes several (let's say about 16 to 64) raycasts within an known area. I wonder if it would be a good idea to make an…
Sebastian
  • 4,893
  • 3
  • 40
  • 59
4
votes
1 answer

Box2dlights - Layering lights

How do you make the box2dlights ignore textures and sprites in ambient lighting? For example I have a stage that has the ambient lighting set to dark. I want my lights to brighten up a platform directly underneath the light, but the background…
3
votes
0 answers

Libgdx Box2dLights: How to make light have a hard falloff?

I am implementing a relatively simple game and I want the lighting system to work as if things are either in total darkness or total light, all the lights though are bright at the origin and become progressively darker until they fade off. I want…
Nectar Zuzi
  • 503
  • 1
  • 4
  • 7
2
votes
0 answers

(Box2dLights) Disable Light for a certain Texture?

I want add stars on my 2D game, like Terraria-Starbound-Minecraft (School project and hobby). https://i.stack.imgur.com/fCGH3.png Perfect, but when the night comes... The stars are dark! https://i.stack.imgur.com/3MbgM.png I want show the stars…
2
votes
1 answer

Adding rayhandler in LibGDx causes issues in InputListener

I am trying out Libgdx, and I have an actor which performs some action whenever we click on it. So far it is working fine. Now I want to add light to the actor. After doing some research I came across Box2DLights. When I tried adding it to my…
hello123
  • 351
  • 3
  • 15
1
vote
1 answer

LibGdx Box2dLights: How to make Chain Lights emit light in all directions?

The "ChainLight" Class has a parameter in its constructor which is called "rayDirection": ChainLight(rayHandler, rays, Color, distance, rayDirection, float[] vertices) Apparently, if it is set to "1", the light direction is left and if it is "-1",…
Ozan
  • 13
  • 2
1
vote
0 answers

LIBGDX Box2D Lights on Ios-Moe

My question is self explainatory: is it possible to use Box2D and Box2D lights on a ios-moe build of LIBGDX? I can run it on my desktop but I get the following error when I launch on IOS: java.lang.UnsatisfiedLinkError: No implementation found for…
SirTrashyton
  • 146
  • 1
  • 3
  • 12
1
vote
0 answers

Box2d Lighting different behavior with different screen size

I tried to play a little with lighting, but very quickly I came upon weird behavior that I dont understand. Could anybody explain to me, why this happens, if it is on purpose, or I do something wrong. On the first image, light goes little trough…
Gobanit
  • 110
  • 12
1
vote
2 answers

Access rays cast by Box2D Lights

I am currently developing a game with the Box2D lights library and LibGDX. Everything is currently fine, however, I'm having difficulty accessing the rays from the ConeLight. I wish to stop rendering objects if they are not in the ray of the…
Ryan_DS
  • 630
  • 7
  • 22
1
vote
1 answer

How to adjust the viewport while rendering box2Dlights?

I'm writing game similar to Don't Starve using Libgdx and Box2Dlights. I have a flat-surface world with some billboarded objects on this surface. So the perspective camera is used. The angle between the normal to the screen and the normal to the…
1
vote
1 answer

Java LibGDX Box2D lighting bug

I have recently started a tile based game. So far so good, I implemented Box2D and added rigid bodies for the tiles. Then I added Box2D Lights. This is where the problem arose. This is a screenshot of the issue: Image. As you can see half the screen…
1
vote
2 answers

Java / box2DLights - Wrong light position

I'm using Libgdx for a project and more precisely Box2DLights. My problem is the following one : When I want to put a new "PointLight" it's always on the center of the screen. And if I change the coordinates, it doesn't work. Inside my "show()"…
Simulacre
  • 89
  • 5
1
vote
2 answers

LibGDX Box2DLights throws error on render

I am trying to get a Box2D PointLight to render on the screen, but upon rendering, it throws an exception. I have revised the API and the Box2D User Manual, as well as watched videos on the topic, but have yet to find a solution to my problem. Here…
user5074791
1
vote
1 answer

Box2D Lights Wall Shadowing

Alright, so I've been pondering over this for quite awhile now; looking through documentation, examples, previously made games, ect... Basically (for those familiar with Box2d Lights), I'm trying to create bodies on top of my walls (so there's…
Gosre
  • 61
  • 9
1
2 3