I was wondering whether it is possible to change the rate at which a lights intensity decareases over distance.
libgdx/box2d lights: change blur of lights
291 views Asked by Fungaria At
2
There are 2 answers
0
On
I have the "v_color = squad_colors;\n" its in the vertex shader of the light source. See https://github.com/libgdx/box2dlights/blob/master/src/shaders/LightShader.java. However the above didn't work for me, the number you use must be a float. E.g."v_color = (s0.0)+quad_colors;\n"

So I finally figuered it out. You have to write a custom shader that is essetially the same as the default one, but change the line that takes care of the interpolation:
for example:
halves the dropoff rate, while:
gets rid of any blur (leaving out the "s" completely out won't work)