Author Topic: GrayScale UITextures  (Read 7295 times)

neeraj

  • Newbie
  • *
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 38
    • View Profile
GrayScale UITextures
« on: July 12, 2014, 03:15:21 AM »
When using a grayscale shader with UITextures, it gives me an error when its a part of ScrollView (SoftClip).

Kindly help thanks! :)

neeraj

  • Newbie
  • *
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 38
    • View Profile
Re: GrayScale UITextures
« Reply #1 on: July 12, 2014, 05:21:36 AM »
Ok so i solved it partially by changing Shader.Find in UIDrawCall, but the problem is with alpha clipping.. it doesn't clip. Can anyone help with the shader please?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: GrayScale UITextures
« Reply #2 on: July 12, 2014, 04:01:45 PM »
You need to create a clipped version of this shader, or it's not going to be possible to clip it.

Have a look at the difference between NGUI's "Unlit - Transparent Colored" and "Unlit - Transparent Colored 1" shaders. You will need to create a shader called "Grayscale 1" and add the clipping code in there.

Don't change the UIDrawCall.

neeraj

  • Newbie
  • *
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 38
    • View Profile
Re: GrayScale UITextures
« Reply #3 on: July 13, 2014, 12:15:04 AM »
Thanks for the reply, yea i understand ill need a clipped version of the shader. So the shaders are  Unlit - Transparent Colored and Unlit - Transparent Colored (SoftClip) right?

neeraj

  • Newbie
  • *
  • Thank You
  • -Given: 7
  • -Receive: 1
  • Posts: 38
    • View Profile
Re: GrayScale UITextures
« Reply #4 on: July 13, 2014, 06:26:14 AM »
Thanks a ton i did it :P I am uploading the Shader here.

jeffscm

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 2
    • View Profile
Re: GrayScale UITextures
« Reply #5 on: June 23, 2015, 08:01:26 AM »
Just to refresh the post.

If anyone needs the Grayscale shaders for NGUI:

I am using NGUI 3.8 and up.

Just unzip and place together with original NGUI shaders. Masked, clipper, masker+clipped.

Jefferson