0

I was wondering whether it is possible to change the rate at which a lights intensity decareases over distance.

something like this: enter image description here

M. Adeel Khalid
  • 1,786
  • 2
  • 21
  • 24
Fungaria
  • 1
  • 2

2 Answers2

0

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:

"v_color = s*quad_colors;\n"

for example:

"v_color = s*2*quad_colors;\n"

halves the dropoff rate, while:

"v_color = (s*0)+quad_colors;\n"

gets rid of any blur (leaving out the "s" completely out won't work)

Fungaria
  • 1
  • 2
  • You mean the default vertex shader? But the default vertex shader doesn't have any `s` or `quad_colors` variables...? My default vertex shader is `v_color = a_color;`. – Hasen Nov 03 '20 at 08:41
-1

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"