0
votes

If add in "FallBack" nonexistent shader appers this error "Shader warning in 'Curved/CurvedAlpha': Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)". So can i make a conclusion that this shader is not supported on this GPU after adding just one variable(look further)?
My videocard geforce gtx 1060 3gb.

Shader "Curved/CurvedAlpha" {
  Properties {
        _Color("Color", COLOR) = (1, 1, 1, 1)
        _MainTex ("Base (RGB)", 2D) = "white" {}
        _QOffset ("Offset", Vector) = (0,0,0,0)
        _Dist ("Distance", Float) = 100.0       
        _Alpha ("Alpha", Range(0.0,1.0)) = 1.0
    }
    SubShader {
        Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
        LOD 100

        ZWrite On
        Blend SrcAlpha OneMinusSrcAlpha 

        Pass
        {
            Lighting Off

            CGPROGRAM
            // Upgrade NOTE: excluded shader from DX11; has structs without semantics (struct v2f members factor)
            #pragma exclude_renderers d3d11
            #pragma vertex vert
            #pragma fragment frag
            #include "UnityCG.cginc"

                        half4 _Color;
            sampler2D _MainTex;
            float4 _QOffset;
            float _Dist;            
            float _Alpha;
            uniform float4 _MainTex_ST;

            struct v2f {
                float4 pos : SV_POSITION;
                float2 uv : TEXCOORD0;

After addind "factor" and calculating it in vert function shader falls back in to a "Legacy Shaders/Transparent/VertexLit"

                float4 factor: COLOR;
            };

            v2f vert (appdata_base v)
            {
                v2f o;
                float4 vPos = mul (UNITY_MATRIX_MV, v.vertex);
                float zOff = vPos.z/_Dist;              
                vPos += _QOffset*zOff*zOff;
                o.pos = mul (UNITY_MATRIX_P, vPos);
                o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);             
            float factor = max(0, dot(v.normal, float3(0,1,0)));
            o.factor = float4(factor,0,0,0);
                return o;

            }


            fixed4 frag (v2f i) : COLOR
            {
                //fixed4 color = tex2D(_MainTex, i.uv) * _Color;
                return tex2D(_MainTex, i.uv)  * float4(_Color.r, _Color.g, _Color.b, _Alpha) * i.factor.x;
            }
            ENDCG
        }

    }

FallBack "Legacy Shaders/Transparent/VertexLit"
}

The problem was add lighting processing to curved shader.

1

1 Answers

0
votes

When you get errors about shaders not being supported on a GPU, i've found that 90% of the time it is related to the ShaderLab part of the code, since this does not have the same detailed compiler errors as the CG code and typically just lazily claims that the shader is unsupported when in fact there is a syntax error.

In your case, i think you should spell it as Fallback instead of FallBack.