Author Topic: Camera jerk when switching 2d Camera to 3d Camera.  (Read 2924 times)

dipu5683

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Camera jerk when switching 2d Camera to 3d Camera.
« on: September 20, 2014, 04:19:41 AM »
Hi

I am creating a some game animation . In that animation i have used UIRoot 2d to render the 2d elements like cards(UiSprite)  etc …. and 3d UIRoot (with perspective camera) for elements like 3d Models . During the animation frame at particular time , I have rendered the same copy of cards in 3d perspective camera  and then 3d models renders with some animation.

Means initially UiRoot 2d is working from the start , then after some time i switch on the UIRoot 3d camera (perspective) which is already there in the Scene . i never disabled the UIroot 2d . Only enable & disable the UIRoot 3d. i also taken care about the layer & depth.

Also i followed the NGUI 3.x tutorial to render the 3d character & 2d elements (example 10).

But during the transition some JERK is coming.I think it is due to camera Or it may be due to scale of Cards(UISprite).

Please help me out to solve this.

Also if possible suggest some kind of BLOOM effect (light weight) (for mobile platform) which i can play during the transition .

Thanks in advance.


 


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Camera jerk when switching 2d Camera to 3d Camera.
« Reply #1 on: September 20, 2014, 09:34:46 AM »
Make sure your 3D and 2D are on different layers.

dipu5683

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: Camera jerk when switching 2d Camera to 3d Camera.
« Reply #2 on: September 21, 2014, 02:49:25 AM »
2d cards are on 2d layer (8), which render from start (Orthographic camera)-
different copy of  same 2d cards are on perspective layer(9) - after some time this layer activated and during this activation some jerk is coming (Perspective camera)
models 3d are on Modelperspective layer(10) - this is activated at the last (perspective camera)

Layer 8 cards & layer 9 cards are exactly same only layers are different. During transition/switching Layer 9 cards displays on the top of layer 8 cards after that i hides the layer 8 cards. then JERK cames.





« Last Edit: September 21, 2014, 02:56:38 AM by dipu5683 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Camera jerk when switching 2d Camera to 3d Camera.
« Reply #3 on: September 21, 2014, 09:14:53 AM »
Don't activate the entire layer. Keep it already active. Only enable/disable the actual cards themselves. Keep in mind that going from 3D to 2D and vice versa is bound to not match 100%, so some shifting is to be expected. I doubt your cards align perfectly. You can test it yourself by having both 2D and 3D cards enabled and overlaying each other.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Camera jerk when switching 2d Camera to 3d Camera.
« Reply #4 on: September 21, 2014, 08:01:55 PM »
Getting a nice switch between orthographic and prespective live and having them overlap perfectly is damn tricky if not impossible. I'd recommend you to always use orthgraphic, unless you really need the perspective - if you do, then use a perspective camera and have the cards rotate towards the camera when it moves out on the axis to "fake" ortographic while they're flat, otherwise it will look as is they're sitting on the surface of a sphere as they move outwards - you want to counter that movement.

dkozlovtsev

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Camera jerk when switching 2d Camera to 3d Camera.
« Reply #5 on: September 22, 2014, 02:53:08 AM »
my 2 cents

in my opinion the only way of smooth transition between orthographic and perpective view is to actually animate camera's projection matrix