2D Toolkit Forum
2D Toolkit => Support => Topic started by: SirJson 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
(http://pixeltastic.de/files/editor.png)
But instead it looks like that
(http://pixeltastic.de/files/game.png)
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?
-
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.
-
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.
-
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.
-
Thanks! Now it works flawlessly :)
-
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!
-
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.
-
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.
-
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.
-
Do you know anything about if Unity solve the problem?
-
No, my bug is still open.
-
Hello again unikron, do you know anything about if Unity solve the problem?
-
No update, the bug is still open. You could test it in 4.5 though, I haven't had a chance.
-
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
-
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...
-
Sorry for the delay.
You mean only use an ortho camera. Won't I be able to use zoom in this case?
I know it's not that much but as a subscriber of the Pro yearly plan, I'll try to send a mail to see if they can speed things up, although I'm pretty sure you already did...
-
You can change ortho size to zoom?
-
True :D Don't know why I didn't think of that!
Thank's for your fast support as always.
-
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...
Hello! I've seen that have a recent reply about this. Is this the solution?
I have this problem and I haven't publish my finished game until I can find a solution.
But I have another problem. I use a light with a yellow color. Well, when I see then game in differents devices, there are some devices that I see without yellow color, why is this?
Attached examples.
(http://s27.postimg.org/zeopco4wz/Good.png)
(http://s27.postimg.org/4d3igtwir/Bad.png)
-
What is the background? One big sprite? if so, it might be a platform that doesn't do pixel lights....
-
This seems to have been solved in 4.5.5 according to the issue tracker. Can anyone confirm that in fact this works now with latest version of Unity?
-
A brief test suggests its working properly in 4.6.1f1