Support => NGUI 3 Support => Topic started by: BLDGBLOCK on July 29, 2013, 10:29:05 PM
Title: Clipping with Additive Shader
Post by: BLDGBLOCK on July 29, 2013, 10:29:05 PM
Hello.
I started using NGUI recently, and this is my first post.
I'm looking for a special way to clipping with additive colored shader, because it is just good looking rather than transparent colored shader to create transparent interface.
Does anybody know about this ?
Title: Re: Clipping with Additive Shader
Post by: xenonii on May 01, 2014, 03:42:15 AM
Having an unlit additive shader which works with clipping would be nice. I tried doing a modified shader but was still getting pink result when inside a clipping panel. But i'm not really into shaders. Michael Lyashenko, can you provide a working additive shader which is supported inside a clipping panel?
Title: Re: Clipping with Additive Shader
Post by: ArenMook on May 02, 2014, 07:38:08 AM
NGUI's clipping is done by choosing a different shader with a similar name. Look at the existing shaders, for exmaple:
Unlit - Transparent Colored < -- used if no clipping is needed Unlit - Transparent Colored 1 <-- used if there is 1 panel clipping the content Unlit - Transparent Colored 2 <-- used if there are 2 panels clipping the content Unlit - Transparent Colored 3 <-- used if there are 3 panels clipping the content
When making custom shaders, you would need to follow the same naming convention. The easiest thing to do is to just make a copy of at least two shaders (the first two) and modify them to suit your needs. In case of additive blending, all you would do is change the blend line from: