Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "CustomShaders/CurveShader" {
- Properties {
- _MainTex ("Albedo (RGB)", 2D) = "white" {}
- _Bend("Bend", Float) = -0.0015
- }
- SubShader {
- Tags { "RenderType"="Opaque" }
- LOD 200
- CGPROGRAM
- // Physically based Standard lighting model, and enable shadows on all light types
- #pragma surface surf Lambert vertex:vert addshadow
- uniform sampler2D _MainTex;
- uniform float _Bend;
- struct Input{
- float2 uv_MainTex;
- };
- void vert(inout appdata_full v){
- float4 worldSpace = mul(unity_ObjectToWorld, v.vertex);
- worldSpace.xyz -= _WorldSpaceCameraPos.xyz;
- worldSpace = float4((worldSpace.z * worldSpace.z) * - _Bend, (worldSpace.z * worldSpace.z) * - _Bend, 0.0f, 0.0f);
- v.vertex += mul(unity_WorldToObject, worldSpace);
- }
- void surf(Input IN, inout SurfaceOutput o){
- half4 c = tex2D(_MainTex, IN.uv_MainTex);
- o.Albedo = c.rgb;
- o.Alpha = c.a;
- }
- ENDCG
- }
- FallBack "Mobile/Diffuse"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement