The code is as follows
Shader "Custom/curved" {
Properties {
_maintex ("Base (RGB)", 2D) = "White" {}
_qoffset ("Offset", Vector) = (0,0,0,0)
_brightness ("Brightness", Float) = 0.0
_dist ("Distance", Float) = 100.0
}
Subshader {
Tags {"Queue" = "Transparent"}
Pass
{
Blend Srcalpha Oneminussrcalpha
Cgprogram
#pragma vertex vert
#pragma fragment Frag
#include "Unitycg.cginc"
sampler2d _maintex;
float4 _qoffset;
float _dist;
float _brightness;
struct v2f {
float4 pos:sv_ POSITION;
float4 uv:texcoord0;
FLOAT3 Viewdir:texcoord1;
fixed4 Color:color;
};
v2f Vert (Appdata_full 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 = V.texcoord;
return o;
}
Half4 Frag (v2f i): COLOR0
{
Half4 col = tex2d (_maintex, i.uv.xy);
Col *= Unity_lightmodel_ambient*_brightness;
return col;
}
Endcg
}
}
FallBack "Diffuse"
}
Effects such as
Shader in Unity if the model has a bending effect