Search Unity

Converting angle cutoff shader

Discussion in 'Shaders' started by Goldenvale, Feb 14, 2019.

  1. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    37
    I'm trying to convert a unity shader to an node based shader in amplify shader editor but I can't seem to figure it out.

    Here's the specific part that i'm trying to convert:
    Code (CSharp):
    1. float4 albedo = tex2D(_MainTex, IN.uv_MainTex) * _Color;
    2. float DotAngle = abs(dot (IN.viewDir, IN.tangent_input));
    3. float3 randomVec = (tex2D(_NoiseTex, IN.uv_MainTex * _noiseScale));
    4. float randomVal = randomVec.x;
    5.  
    6. clip((1 - (_Angle / DotAngle)) + (randomVal));
    7. clip(albedo.a - _Cutoff);
    This part specifically is where i'm stuck:
    Code (CSharp):
    1. float3 randomVec = (tex2D(_NoiseTex, IN.uv_MainTex * _noiseScale));
    This is what I have at the moment:


    Can anyone point me in the right direction?