1
\$\begingroup\$

So, I'm having some issues with lighting in my Unity game. I had implemented torches, which seem to be working fine, but I have a creature (gelatinous cube) that I've put spot lights facing to give it a "glow". The reflected and refracted light ends up having two issues:

  1. the light abruptly ends at the edge of floor tiles, and
  2. depending on the position, the light sometimes goes from it's blue color to a reddish color.

I have a short (11 second) video here: http://www.labyrintheer.com/wp-content/uploads/2016/11/Nov-17-2016-21-07-57.mp4 so that you can see what I'm talking about. I've tried changing global lighting settings and playing with the settings on the spot lights, but nothing seems to resolve the issue.

Still images for anyone hesitant to click the video link:

Hard falloff: enter image description here

Reddish color: enter image description here

Using a single point light inside the cube, instead: enter image description here You can see it on the wall in the upper right and the floor at the top a bit. The upload seems to have lowered the quality a bit, but you can still see it. The single light makes it a little bit better, but there's still complete falloff.

\$\endgroup\$
1
\$\begingroup\$

It may have to do with your number of per-pixel lights. If you have too many, Unity will fall back to per-vertex lighting for some lights instead. Try increasing the number of per-pixel lights in quality settings (which can be costly).

Ideally you should change the way you light the scene so you don't need a lot of per-pixel dynamic lights. Six spotlights for one object seems really excessive.

You could also consider using deferred shading if it works with your target platforms, as it lets you use unlimited per-pixel lights.

\$\endgroup\$
  • \$\begingroup\$ I updated the main post with a picture using just a single point light as well. There are still some issues with the falloff. It's slightly less noticeable, but that's possibly just because there's less light overall. I didn't see anything related to per-pixel lights, but I did play around with graphics emulation in the editor and while it changed some things, this issue still exists no matter what. \$\endgroup\$ – Jesse Williams Nov 18 '16 at 21:57
  • \$\begingroup\$ @JesseWilliams You seem to have more objects with lights affecting what I interpret is your "ground". Too many and you will get these strange results. Try using deferred shading as suggested, in the graphics settings (not emulation). \$\endgroup\$ – Kroltan Oct 9 '17 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.