Author Topic: Problem when use 3D mesh with transparent shader in the same layer of ngui.  (Read 3254 times)

kobsure

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
My 3D model(2D plane) need to be in the same layer of ngui ( Imagine character's portrait with label and hp bar over it). When I'm using Unlit/Transparent Cut out everything work perfect, I can depth order of my model by z value. But when I change model's shader to Unlit/Transparent Texture (which is more beautiful) the z value has no effect. Have any suggestion?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Unlit/Transparent Texture and Unlit/Transparent Cutout doesn't exist. What version of NGUI are you using? Also, adjusting by Z? This suggests that you are using NGUI 2.7.0, which is free and doesn't come with support.

kobsure

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
these 2 shaders is default shader from unity that I use to set matterial of my plane model(red head in the picture).

Since I've to use model with UISprite in the same camera layer then I've to adjust model position(z value) to bring my model in front of UISprite(I'm trying to put my model in widget Container and adjust depth nothing happen).

I use NGUI 3.4.7 pro.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
You should not be using Unity's shaders with NGUI. All UI materials should be using Unlit/Transparent Colored.

Everything in NGUI is based on the Depth of the widget. Z doesn't matter.