Author Topic: Disabled Camera not clearing from the screen when NGUI is used  (Read 5377 times)

yohann

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
(SEE ATTACHED IMAGE) I have two cameras, sort of a picture-in-picture, except I want to toggle between full screen and a "windowed" screen. I'm making the windowed screen via the camera.pixelRect property. This works fine...until I add an NGUI element, at which point the disabled full screen camera doesn't clear the image from the screen after it's disabled. Please please help.


EDIT: I've discovered that I can fix this by changing any of the values of Normalized View Port Rect of the NGUI camera by some insignificant amount, such as changing the W param from 1 to 1.001. This gets it working, but I'd sure like a non-hacky way of solving this. Any ideas?
« Last Edit: August 20, 2013, 09:27:49 PM by yohann »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Disabled Camera not clearing from the screen when NGUI is used
« Reply #1 on: August 21, 2013, 10:22:32 AM »
Eh? You must have at least one camera clearing color in your game. UI camera clears only depth by default.

yohann

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: Disabled Camera not clearing from the screen when NGUI is used
« Reply #2 on: August 21, 2013, 10:43:08 AM »
Thanks for the reply! I'm new to Unity, so can you tell me: is this a requirement just of NGUI or is it a fundamental game design concept using Unity?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Disabled Camera not clearing from the screen when NGUI is used
« Reply #3 on: August 21, 2013, 10:50:10 AM »
Fundamental necessity of any game.

If you don't clear the color, how can you expect the stuff you drew previously to go away?

yohann

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: Disabled Camera not clearing from the screen when NGUI is used
« Reply #4 on: August 21, 2013, 11:01:57 AM »
Got it. Thanks so much!!