Author Topic: Creating panel clipping compliant subtype of the Depth Cutout sample shader  (Read 1990 times)

bac9

  • Full Member
  • ***
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 113
    • View Profile
I have to admit I'm not terribly familiar with abstracted methods Unity is exposing for the shaders and I'm more comfortable with vertex/fragment code that is not obfuscating anything, so I'm having a bit of trouble understanding what is happening in the lowest LoD of NGUI shaders. In particular, I'm having trouble creating a panel-clipped subtype of the Depth Cutout shader that was provided as a sample with NGUI. As in contrast with standard colored shader, depth cutout shader has no high-LOD vertex/fragment section at all, I'm not really sure what I should alter in the LOD 100 section to make it compliant with panel clipping.

How can I approach this?


bac9

  • Full Member
  • ***
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 113
    • View Profile
Disregard that, I'm an idiot. :)
It's a subtractive shader and it's already limited to the contents of the panel, so there is no need to rewrite anything at all, simple duplicate will do. Time for even more exotic touch effects!

« Last Edit: October 12, 2014, 08:59:21 AM by bac9 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Looks good, but I wonder if the big shadow would be too much considering the clean look of the rest of the button.

bac9

  • Full Member
  • ***
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 113
    • View Profile
There is a flat subtype too, shadow is just a hover effect for more rare buttons that can be lost between busy content otherwise. :)
Same sort of deal as with separating content with flat seams vs separating content into floating cards with shadows.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Very nice.