报错是:Shader warning in 'Unit/Fresnel_shader': Unit/Fresnel_shader shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
代码是:
Shader "Unit/Fresnel_shader"
{
Properties
{
_Goss("Goss",range(1,32)) = 8
}
SubShader
{
Pass {
Tags{"Queue" = "Transparent"}
Blend SrcAlpha OneMinusSrcAlpha
Zwrite Off
CGPROGR
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float _Goss;
struct v2f
{
float4 pos :SV_POSITION;
float3 normal:TEXCOOR0;
float4 vertex:COLOR;
};
v2f vert(appdata_base v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.vertex = v.vertex;
o.normal = v.normal;
return o;
}
fixed4 frag(v2f IN) :SV_Target
{
fixed4 col = (1, 1, 1, 1);
float3 N = mul(IN.normal,(float3 * 3)*unity_WorldToObject);
N = normalize(N);
float3 worldPos = mul(unity_ObjectToWorld, IN.vertex).xyz;
float3 L = _WorldSpaceCameraPos.xyz - worldPos;
L = normalize(L);
float bright = 1 - saturate(dot(N, L));
bright = pow (bright, _Goss);
col*= bright
return col;
}
ENDCG
}
}
}