Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - hugo

Pages: [1]
1
NGUI 3 Support / Re: question on UILabel shadow effect implementation
« on: October 28, 2016, 10:14:58 PM »
after re-check ApplyShadow implementation, I figure out that it just apply shadow verts(etc.) to the front of draw call buffer which make sense, sorry for my lack of concentration ~

2
NGUI 3 Support / question on UILabel shadow effect implementation
« on: October 28, 2016, 08:22:34 AM »
Hi,
I have a question on UILabel's shadow effect implementation, paste some codes here:

// UILabel.OnFill
public override void OnFill (BetterList<Vector3> verts, BetterList<Vector2> uvs, BetterList<Color32> cols)
{
   // some codes here
   // add label verts, uvs and cols to buffer

   // Apply an effect if one was requested
   if (effectStyle != Effect.None)
   {
      int end = verts.size;
      pos.x = mEffectDistance.x;
      pos.y = mEffectDistance.y;

      // add effect verts, uvs and cols to buffer
      ApplyShadow(verts, uvs, cols, offset, end, pos.x, -pos.y);
      
      // other codes here
   }
}

my question is that since label shadow effect verts(etc.) are added to draw call buffer latter and the label's shader (normally is "Unlit/Transparent Colored") sets ZWrite Off,
I think shadow effect will render on top of original label, but now it seems not ...

does anyone can explain something about this ? thanks~

Pages: [1]