Light2D icon indicating copy to clipboard operation
Light2D copied to clipboard

Window resizing breaks light overlay

Open DunkUK opened this issue 8 years ago • 0 comments

If I run a scene with some Light2D lights, but then resize the game window, the lights become offset from the intended positions. I think the lighting is still consistent with the obstacles (as the LightOverlay material's LightSources render target looks sensible though possibly stretched), but it doesn't overlay back correctly to the game.

I'm guessing it's some aspect ratio or scaling value for the overlay shader that isn't being updated.

Edit: I'm using a normals camera, and the normal map render target doesn't resize, so it might be related. Edit2: Though if I turn NormalMapping off, the lights are in the right place, but then the obstacles are in the wrong place, casting incorrect shadows. Weird.

Tested on Unity 2017.1.0f3

DunkUK avatar Aug 08 '17 12:08 DunkUK