Author Topic: 3D Objects in between NGUI elements  (Read 2352 times)

Holy Manfred

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 71
    • View Profile
3D Objects in between NGUI elements
« on: May 13, 2016, 10:27:30 AM »
I am using a mix of 2D and 3D UI in our game which works pretty well so far. For example, I have a 2D UI window with a 3D model rendered on top of it.
I am now trying to set up an UI element which is supposed to display a 3D model on a 2D background in addition to some 2D elements on top of it. I am using a 2D camera rendering the background, a 3D camera to render the model and the UI elements in 3D space. This works but of course the UI elements rendered with the 3D camera have a slightly different look and crispness than the ones with the 2D camera.

Is there any other way to render clean, crisp 2D UI elements behind as well as in front of a 3D model? Would it work to have multiple 2D UI cameras with different depths?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: 3D Objects in between NGUI elements
« Reply #1 on: May 14, 2016, 06:36:46 PM »
You should ideally render your 3D model into a render texture off-screen, then draw the display that render texture using a UITexture like any other widget. That said, 2D is always going to be more crisp than 3D simply because in 2D texture pixels correspond to on-screen pixels 1:1 by default, while with a 3D UI they do not.

Holy Manfred

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 71
    • View Profile
Re: 3D Objects in between NGUI elements
« Reply #2 on: May 16, 2016, 01:58:00 PM »
Yeah, this will be my next approach. Thanks.