Author Topic: Custom Shaders Aren't Working with UI Panel Texture Masking  (Read 4255 times)

slookdesign

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Custom Shaders Aren't Working with UI Panel Texture Masking
« on: January 20, 2017, 01:31:03 PM »
I have managed to get a custom additive version of "Unlit - Transparent Colored" to clip my sprites properly within a panel using the normal "Soft Clip" method.  My issue is that there are some cases in our project where I need to use Texture Masks for clipping, and sadly the sprites using "Unlit - Transparent Colored Additive" do not clip properly, nor do they seem to use "Blend SrcAlpha One", for the additive blending.

The only modifications that I have made to the 3 custom shaders is changing the name and the two lines with: "Blend SrcAlpha OneMinusSrcAlpha" to "Blend SrcAlpha One" for the additive effect as an overlay on my sprites.  I found the method on this forum.

I am curious if anyone has run into this issue as well?  It is sort of an edge-case.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Custom Shaders Aren't Working with UI Panel Texture Masking
« Reply #1 on: January 23, 2017, 08:15:24 AM »
You need to add a (TextureClip) version for them to be clipped using textures. Just search for that in the project to find the NGUI's shaders to use as an example.

slookdesign

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Custom Shaders Aren't Working with UI Panel Texture Masking
« Reply #2 on: January 24, 2017, 06:14:08 PM »
Thank you very much, worked like a charm!