Author Topic: Clip non NGUI objects  (Read 4943 times)

Game Whiz

  • Guest
Clip non NGUI objects
« on: August 08, 2012, 03:56:37 AM »
Hi,

In one of my GUI's panels I'm placing a non NGUI object (a skinned mesh). Is there a way to allow this skinned mesh to be clipped by the shader the panel uses?

BR,
Alex

simon129

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 20
    • View Profile
Re: Clip non NGUI objects
« Reply #1 on: August 08, 2012, 04:08:13 AM »
2D clipped shader can't be used in 3D objects.

But, you can use another camera like "Example 8 - Scroll View (Camera)" did.

Game Whiz

  • Guest
Re: Clip non NGUI objects
« Reply #2 on: August 08, 2012, 04:15:16 AM »
This is a "special" skinned mesh, in that all polys in it are coplanar (to simulate 2d). I don't want to use a UIViewport because I need to move this panel offscreen.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Clip non NGUI objects
« Reply #3 on: August 08, 2012, 08:40:49 AM »
Clipping is done by the UIpanel, so if the UIPanel isn't drawing it, you can't directly clip it. You can do other stuff, like resize the viewrect of the camera to the same as the other clip area or use a rendertexture.

Game Whiz

  • Guest
Re: Clip non NGUI objects
« Reply #4 on: August 08, 2012, 08:42:48 AM »
Thanks, for some reason I didn't even remember about rendertextures. That should do it.