Hello Guest

Author Topic: Lightning problems  (Read 14252 times)

SirJson

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Lightning problems
« on: December 10, 2013, 03:09:14 pm »
Hi,

When I'm using the tk2dCamera the lightning in Unity is broken. This bug only occurs when I play the game but not in the editor.

It should look like that


But instead it looks like that


I'm using Unity 4.3. What can I do to fix the lightning? (except using the standard Unity ortho camera). Is this a known bug?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Lightning problems
« Reply #1 on: December 10, 2013, 05:07:21 pm »
This is a known unity renderer bug. It was fixed in 4.2 (after a really really long wait), but regressed in 4.3. I've reported it but not heard back.

shaneandersonxp

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Lightning problems
« Reply #2 on: December 14, 2013, 01:20:43 am »
It seems that you can fix this by adjusting the Orthographic Size on the unity camera, even if you're using pixels per meter on the tk2d camera. However, normally the unity camera component is hidden when you're using a tk2d camera. In my case, the unity camera was set to 100 as the orthographic size, and lowering it to 10 fixed the lighting issue.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Lightning problems
« Reply #3 on: December 14, 2013, 03:17:53 pm »
That kinda fixes it. The unity bug is that unity ignores the custom projection matrix and uses some stuff from the ortho size, etc. If you feed it a close enough ortho size, it should work reasonably. Remember to take into account zoomScale, etc if its starts misbehaving.

SirJson

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Lightning problems
« Reply #4 on: December 15, 2013, 06:38:26 pm »
Thanks! Now it works flawlessly :)

djemix

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Lightning problems
« Reply #5 on: January 15, 2014, 02:55:46 pm »
This is a known unity renderer bug. It was fixed in 4.2 (after a really really long wait), but regressed in 4.3. I've reported it but not heard back.

Hello! I have this problem too, do you know anything about when Unity will solve the error?

Thank you!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Lightning problems
« Reply #6 on: January 15, 2014, 04:28:38 pm »
Your guess is as good as mine. The last time this was fixed it was about nearly a year from the time I reported it.

djemix

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Lightning problems
« Reply #7 on: January 16, 2014, 05:06:00 pm »
But if It is Unity problem, they must fixed soon.

Anyway, is there any way I can make it work in a similar way?

I tried the solution above, but does not work me.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Lightning problems
« Reply #8 on: January 16, 2014, 09:49:12 pm »
You can use a normal ortho camera if you want, that doesn't suffer from the issue only custom projection matrices (which tk2dCamera uses) seem to be affected. You lose some of the nice features tk2dCamera gives you though.

djemix

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Lightning problems
« Reply #9 on: February 20, 2014, 01:18:00 pm »
Do you know anything about if Unity solve the problem?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Lightning problems
« Reply #10 on: February 20, 2014, 01:26:03 pm »
No, my bug is still open.

djemix

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Lightning problems
« Reply #11 on: May 28, 2014, 03:05:07 pm »
Hello again unikron, do you know anything about if Unity solve the problem?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Lightning problems
« Reply #12 on: May 28, 2014, 03:37:05 pm »
No update, the bug is still open. You could test it in 4.5 though, I haven't had a chance.

R3nD

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Oddly Shaped Pixels
Re: Lightning problems
« Reply #13 on: July 28, 2014, 01:56:08 pm »
Hi!

Sorry to bump this one up but it seems that the problem remains under 4.5 (using 4.5.2f1).
Is it possible "to vote" for the bug so that it gets corrected faster, and if so could you please pass the link?

I've been avoiding the problem for some time now by tweaking the ortho size of the Camera but now with dynamic zooming and lots of prefab lights, I can't seem to get anything satisfactory :/

Thank's in advance!

R3nD

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Lightning problems
« Reply #14 on: July 28, 2014, 02:42:22 pm »
http://issuetracker.unity3d.com/issues/lighting-is-incorrect-when-a-custom-projection-matrix-is-set-on-the-camera

If its a showstopper, I suggest using an ortho camera, as it will sidestep the issue entirely. No idea when it'll get fixed by Unity...