Author Topic: NGUI on custom Mesh  (Read 4713 times)

Mcckl

  • Guest
NGUI on custom Mesh
« on: December 12, 2013, 11:52:42 AM »
Hi!
Is it possible to display the NGUI Menu on a non-planar Mesh, like a text wrapping around a cylinder or sphere?

Cheers,
Mike

Ferazel

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 150
    • View Profile
Re: NGUI on custom Mesh
« Reply #1 on: December 12, 2013, 12:08:05 PM »
The only way I can think of how to do this now, is to render the UICamera to a texture and then use that texture to be applied to a cylinder.

Mcckl

  • Guest
Re: NGUI on custom Mesh
« Reply #2 on: December 12, 2013, 12:13:33 PM »
Thanks,
but that sounds as bad as the standard Unity GUI....

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI on custom Mesh
« Reply #3 on: December 12, 2013, 02:31:08 PM »
Well yes, just as bad. You're desiring highly custom functionality here. All UI is drawn using quads, and quads, by nature, don't bend.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: NGUI on custom Mesh
« Reply #4 on: December 12, 2013, 07:24:34 PM »
UICam to RenderTexture, apply rendertexture to mesh.

Working with rendertexture is a bit different than just regular cameras, so be careful you don't get weirdness with alphas; I've had that in the past.

Mcckl

  • Guest
Re: NGUI on custom Mesh
« Reply #5 on: December 17, 2013, 12:06:19 PM »
Thanks for your help,
updating the RenderTexture is quite expensive. But when the UI is turned off, the RenderTexture keeps the last image, with great performance.

Of course using the RenderTexture doesn't work with Buttons. Is there a possibility to relay rayCasts on the Object displaying the RenderTexture to the underlying UI?