Search Unity

float2 and the second parameter ...

Discussion in 'Shaders' started by rrh, Sep 30, 2014.

  1. rrh

    rrh

    Joined:
    Jul 12, 2012
    Posts:
    331
    So I was trying out the Toon Ramp listed here:
    http://docs.unity3d.com/Manual/SL-SurfaceShaderLightingExamples.html
    and the Team Fortress 2 Shader listed here:
    http://wiki.unity3d.com/index.php/TeamFortress2Shader

    In both cases if I use it straight as listed, I get the error:
    Shader error in 'Custom/RampShadows': incorrect number of arguments to numeric-type constructor

    Here are the problem lines from both:

    fixed3 ramp = tex2D(_RampTex, float2(NdotL* atten)).rgb;

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


    So I gather float2 is expecting 2 parameters, not just 1. Did this previously work without the second parameter? Did it default to a constant or double the first parameter or what?
     
  2. mouurusai

    mouurusai

    Joined:
    Dec 2, 2011
    Posts:
    350
    It's just noisy pedantic Dx11 compiler. I think you may write float2(diff, diff) or float2(diff.xx).