По-идее должен колыхаться немножко
Синтаксис:
Используется glsl
/// Портировано с http://www.iquilezles.org/apps/shadertoy/
Shader "SquareTunnel" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_TimeT ("Time", Float) = 0.5
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
#pragma target 3.0
#include "UnityCG.cginc"
sampler2D _MainTex;
float _TimeT;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half2 resolution = half2(1.0,1.0);
half2 p = -1.0 + 2.0 * IN.uv_MainTex.xy / resolution.xy;
half2 uv;
float r = pow( pow(p.x*p.x,16.0) + pow(p.y*p.y,16.0), 1.0/32.0 );
uv.x = .5*_TimeT + 0.5/r;
uv.y = 1.0*atan2(p.y,p.x)/3.1416;
half3 col = tex2D(_MainTex,uv).xyz;
half4 color = half4(col*r*r*r,1.0);
o.Albedo = color.rgb;
o.Alpha = color.a;
}
ENDCG
}
FallBack "Diffuse"
}
Shader "SquareTunnel" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_TimeT ("Time", Float) = 0.5
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
#pragma target 3.0
#include "UnityCG.cginc"
sampler2D _MainTex;
float _TimeT;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half2 resolution = half2(1.0,1.0);
half2 p = -1.0 + 2.0 * IN.uv_MainTex.xy / resolution.xy;
half2 uv;
float r = pow( pow(p.x*p.x,16.0) + pow(p.y*p.y,16.0), 1.0/32.0 );
uv.x = .5*_TimeT + 0.5/r;
uv.y = 1.0*atan2(p.y,p.x)/3.1416;
half3 col = tex2D(_MainTex,uv).xyz;
half4 color = half4(col*r*r*r,1.0);
o.Albedo = color.rgb;
o.Alpha = color.a;
}
ENDCG
}
FallBack "Diffuse"
}