Toon Ramp Shader Example error

I was searching for quite some time now and surprisingly I have not yet found any answer to my problem. So I guess this is is a new thing introduced in some recent update…

I don’t really know anything about shaders so I was copying this Ramp Shader from the Docs and Unity gives me these two warnings:

There is one similar Thread over here but I don’t really get what is going there either. This is currently way above my head. Especially because there is simply nothing in line 48. The whole shader only goes up to line 33.

Does someone know what is going on here?

I too am having this problem. I’m not sure why it’s happening but from what I’ve gathered it’s something to do with variables with length (half2, half3, half4, float2, float3…) and confusion caused by combining variables with different lengths.

Regardless I can’t find the problem. I’ve added the custom ramp lighting code to my own error/warning free shader and I’m getting the warnings. I get the same warnings if I copy/paste the code unaltered into Monodevelop.

DX11 is a little picky with syntax. To fix it -

Change this line

half3 ramp = tex2D (_Ramp, float2(diff)).rgb;

To this

half3 ramp = tex2D (_Ramp, float2(diff,diff)).rgb;

Cheers! :slight_smile:

Mucho gracias!