Lighting skipped on scaled sprites within range

Hi, I’ve been looking into lighting of sprites, and I noticed today that sprites don’t always get lit when they are in range if the sprite is scaled.

I’ve made a test scene that looks like this: Imgur: The magic of the Internet

The point light in the center has a range of 10, and is located at the origin. On the left are two front-facing quads with scale (4,4,1) at Z=3 using the Default-Diffuse material. The inner one is at X=-2.4, and the outer one is at X=3.

Mirrored on the right side are two sprites, using a material with Sprites/Diffuse. The outer one should be lit identically to the outer quad, but instead it only receives ambient light.

Changing the pixel light count in QualitySettings to zero does not cause the outer sprite to be vertex-lit (though the other 3 objects switch to per-vertex lighting). Changing the sprite scale to (1,1,1) fixes the issue, so it’s just a problem with scaled sprites.

Is this a known bug that will be fixed soon?

Hi mate… I’m having the same problem here… It only happens when you scale the object from script. On editor this doesn’t happen. Maybe it’s a bug.

1519956--86885--$unityTrouble.png

I’m seeing this happen in the editor too. I noticed that if you change the sprite’s PixelsToUnits, then you can make it larger and still get lighting to work. But that doesn’t solve non-uniform scaling or variable scaling for spritesheets.

you can use [spot lights ] they seems to work appropriate with scaled sprites !

Any news regarding this problem? Every time I change the scale of a game object it stops receiving light from the light sources, regardless of its type, spotlight or point.

I ended on using 2D Volumetric lights to archive the same results. It worked pretty well!

Hi all,

Lighting issues with scaled sprites is a known bug. We’ve fixed it in 4.5!

The bug seems to remain in version 4.5.4f1.

Have you tried to change fog density to 0, maybe this might be the problem

I’ve been struggling with this problem for a bit. Luckily I found the problem rather quickly. Make sure to scale the sprite with Vector3 and set the z-value to 1. My problem was that I was scaling with Vector2 and that sets the z-value to 0.