2D Toolkit Forum
2D Toolkit => Support => Topic started by: xikky on February 26, 2013, 04:15:05 pm
-
Am I wrong if I still use 3D objects such as cubes, spheres, cloths, etc. in front of tk2dCameras? Should I be better of if I use Unity's camera?
I'm trying to use tk2dCameras to gain from their advantage of resolution overrides and GUI, but I wish to know which is better video and performance wise.
-
Performance wise, there should be no difference, but the tk2dCamera is orthographic - if you have 3d objects, you might want a perspective camera. The resolution overrides make a lot more sense in 2d than in 3d... with 3D you don't really aim to map pixel perfect graphics.
WHat is it you want to do with the 3d stuff?
-
I'm doing a kind of a pin pong game, where the player is at the bottom, keeping the ball from falling. I absolutely need some of the 'Side walls' to be in 3D. I also made the player and the ball 3D objects with rigidbody to behave under physics. All the rest will be in 2D, like particle emitters, collecting objects, etc.
I don't want to show any object in 3D so I don't need the camera set to perspective. I need orthographic purposely, to show the 3D objects in 2D.
I just thought, what if tk2dCamera was optimized for sprites and planes and not 3D objects? would I'd be better off with Unity's Camera?
I would rather use tk2dCamera though, to display other 2D objects in the game in pixel perfect.
And would resolution overrides work well in this case with all objects? (If I understand well resoultion overrides is used for letterboxing, am I right?)
-
Why not use 2 cameras, one perspective for 3d, and a second ortho tk2dCamera for all your 2d/UI stuff? You can easily mix and match.
-
I don't know how to exactly. But thanks for the help I will try this, it seems nicer.
Will letterboxing still be applied well when using 2 cameras like you mentioned?
-
Letterboxing won't work automatically on a perspective camera, just the ortho cam, but you could adjust parameters to suit.
Check out sample #6 in tk2d, 2 cameras mixed there. Not tk2dCamera, but a perspective and ortho. Same principle applies to tk2dCamera.
-
Then I think best would be to use tk2DCamera, as I think that it behaves many similar to an Unity ortho Camera, and as I need letterboxing. This way would make it easier. Moreover, on this http://forum.unity3d.com/threads/26596-Orthographic-always-better-for-2D (http://forum.unity3d.com/threads/26596-Orthographic-always-better-for-2D) post, it is mentioned that ortho would be better for a 2D Game. Becuase perpective cam may differ a tiny little bit the performance due to perspective transformations, and I have no problems for Parallex Scrolling.