Author Topic: CoverFlow with issues  (Read 1177 times)

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
CoverFlow with issues
« on: March 06, 2013, 07:32:42 AM »
I just used the script posted on the forum (well is in another forum). But I used panels (it is for an item inventory) and have some data, everything works mostly great but I have some issues.

I used a Perspective Camera just for this items and it has the biggest Depth to show above the other cameras, BUT... some elements dissapear!, I checked twice every 'Z' value on the widgets and the background is always on the back. I don't know why dissapears, if I change the camera to Orthographic everything looks great but the side Panels doesn't take the perspective that I want.

Somebody knows what could be the problem?

**EDIT**
Also I would like to move the items pressing and swiping right and left, for know I'm moving the items with a slider, but this just workd if you used the Thumb for moving it.

I fixed it moving the slider to 2D Camera.

Thankss!
« Last Edit: March 06, 2013, 07:39:58 AM by jeldrez »

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: CoverFlow with issues
« Reply #1 on: March 06, 2013, 03:35:25 PM »
Ok, a collegue found the issue, Aren explained it on this topic:

Depth-based sorting works only within the same atlas and same panel. In your case you have different objects -- 3D objects, and GUI, which means it's sorted based on the distance to the camera. Unity sorts based on the center of the object's distance to the camera, which is messy.

I suggest using a special shader for your UI that will have its render queue set up to draw after your game objects.

Although it's worth noting that by default that's how it works if you use solid (opaque) shaders for your geometry, and NGUI's default shaders for the UI.

So... I was using panels inside other panels for grouping the items and it was a mess. Now I just delete the UIPanel script from the objects and it works great.

Lesson learned, thanks anyway!