123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- // Shader created with Shader Forge v1.37
- // Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
- // Note: Manually altering this data may prevent you from opening it in Shader Forge
- /*SF_DATA;ver:1.37;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,cgin:,lico:1,lgpr:1,limd:0,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,imps:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:1,bsrc:3,bdst:7,dpts:2,wrdp:False,dith:0,atcv:False,rfrpo:True,rfrpn:Refraction,coma:15,ufog:True,aust:True,igpj:True,qofs:0,qpre:3,rntp:2,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,stcl:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:False,fnsp:False,fnfb:False,fsmp:False;n:type:ShaderForge.SFN_Final,id:4013,x:33666,y:32796,varname:node_4013,prsc:2|emission-8407-OUT,alpha-5534-OUT;n:type:ShaderForge.SFN_Fresnel,id:2109,x:32487,y:32854,varname:node_2109,prsc:2|EXP-4005-OUT;n:type:ShaderForge.SFN_Slider,id:4005,x:32135,y:32870,ptovrint:False,ptlb:F_G,ptin:_F_G,varname:node_4005,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:0,cur:5,max:5;n:type:ShaderForge.SFN_Color,id:4225,x:32250,y:33135,ptovrint:False,ptlb:F_C,ptin:_F_C,varname:node_4225,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.5,c2:0.5,c3:0.5,c4:1;n:type:ShaderForge.SFN_Multiply,id:3052,x:32704,y:32884,varname:node_3052,prsc:2|A-2109-OUT,B-4225-RGB;n:type:ShaderForge.SFN_Slider,id:5726,x:32624,y:33247,ptovrint:False,ptlb:F_S,ptin:_F_S,varname:node_5726,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:0,cur:1.678263,max:5;n:type:ShaderForge.SFN_Multiply,id:8407,x:32988,y:32858,varname:node_8407,prsc:2|A-3052-OUT,B-5726-OUT;n:type:ShaderForge.SFN_Slider,id:4513,x:33045,y:33072,ptovrint:False,ptlb:node_4513,ptin:_node_4513,varname:node_4513,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:0,cur:1,max:1;n:type:ShaderForge.SFN_Tex2d,id:2877,x:33084,y:32458,ptovrint:False,ptlb:node_2877,ptin:_node_2877,varname:node_2877,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,ntxv:0,isnm:False;n:type:ShaderForge.SFN_Multiply,id:5534,x:33405,y:32925,varname:node_5534,prsc:2|A-2877-A,B-4513-OUT;proporder:4005-4225-5726-4513-2877;pass:END;sub:END;*/
- Shader "LuoYeDaShi/Fresnel01" {
- Properties {
- _F_G ("F_G", Range(0, 5)) = 5
- _F_C ("F_C", Color) = (0.5,0.5,0.5,1)
- _F_S ("F_S", Range(0, 5)) = 1.678263
- _node_4513 ("node_4513", Range(0, 1)) = 1
- _node_2877 ("node_2877", 2D) = "white" {}
- [HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
- }
- SubShader {
- Tags {
- "IgnoreProjector"="True"
- "Queue"="Transparent"
- "RenderType"="Transparent"
- }
- Pass {
- Name "FORWARD"
- Tags {
- "LightMode"="ForwardBase"
- }
- Blend SrcAlpha OneMinusSrcAlpha
- Cull Front
- ZWrite Off
-
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #define UNITY_PASS_FORWARDBASE
- #include "UnityCG.cginc"
- #pragma multi_compile_fwdbase
- #pragma multi_compile_fog
- #pragma only_renderers d3d9 d3d11 glcore gles gles3 metal d3d11_9x xboxone n3ds wiiu
- #pragma target 3.0
- uniform float _F_G;
- uniform float4 _F_C;
- uniform float _F_S;
- uniform float _node_4513;
- uniform sampler2D _node_2877; uniform float4 _node_2877_ST;
- struct VertexInput {
- float4 vertex : POSITION;
- float3 normal : NORMAL;
- float2 texcoord0 : TEXCOORD0;
- };
- struct VertexOutput {
- float4 pos : SV_POSITION;
- float2 uv0 : TEXCOORD0;
- float4 posWorld : TEXCOORD1;
- float3 normalDir : TEXCOORD2;
- UNITY_FOG_COORDS(3)
- };
- VertexOutput vert (VertexInput v) {
- VertexOutput o = (VertexOutput)0;
- o.uv0 = v.texcoord0;
- o.normalDir = UnityObjectToWorldNormal(-v.normal);
- o.posWorld = mul(unity_ObjectToWorld, v.vertex);
- o.pos = UnityObjectToClipPos( v.vertex );
- UNITY_TRANSFER_FOG(o,o.pos);
- return o;
- }
- float4 frag(VertexOutput i) : COLOR {
- i.normalDir = normalize(i.normalDir);
- float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
- float3 normalDirection = i.normalDir;
- ////// Lighting:
- ////// Emissive:
- float3 node_8407 = ((pow(1.0-max(0,dot(normalDirection, viewDirection)),_F_G)*_F_C.rgb)*_F_S);
- float3 emissive = node_8407;
- float3 finalColor = emissive;
- float4 _node_2877_var = tex2D(_node_2877,TRANSFORM_TEX(i.uv0, _node_2877));
- fixed4 finalRGBA = fixed4(finalColor,(_node_2877_var.a*_node_4513));
- UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
- return finalRGBA;
- }
- ENDCG
- }
- Pass {
- Name "ShadowCaster"
- Tags {
- "LightMode"="ShadowCaster"
- }
- Offset 1, 1
- Cull Front
-
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #define UNITY_PASS_SHADOWCASTER
- #include "UnityCG.cginc"
- #include "Lighting.cginc"
- #pragma fragmentoption ARB_precision_hint_fastest
- #pragma multi_compile_shadowcaster
- #pragma multi_compile_fog
- #pragma only_renderers d3d9 d3d11 glcore gles gles3 metal d3d11_9x xboxone n3ds wiiu
- #pragma target 3.0
- struct VertexInput {
- float4 vertex : POSITION;
- };
- struct VertexOutput {
- V2F_SHADOW_CASTER;
- };
- VertexOutput vert (VertexInput v) {
- VertexOutput o = (VertexOutput)0;
- o.pos = UnityObjectToClipPos( v.vertex );
- TRANSFER_SHADOW_CASTER(o)
- return o;
- }
- float4 frag(VertexOutput i) : COLOR {
- SHADOW_CASTER_FRAGMENT(i)
- }
- ENDCG
- }
- }
- FallBack "Diffuse"
- CustomEditor "ShaderForgeMaterialInspector"
- }
|