port from perforce
This commit is contained in:
34
hgplus/ShaderMinifier/tests/real/relief_tunnel.frag
Normal file
34
hgplus/ShaderMinifier/tests/real/relief_tunnel.frag
Normal file
@@ -0,0 +1,34 @@
|
||||
uniform vec2 resolution;
|
||||
uniform float time;
|
||||
uniform sampler2D tex0;
|
||||
uniform sampler2D tex1;
|
||||
uniform sampler2D tex2;
|
||||
uniform sampler2D tex3;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / resolution.xy;
|
||||
vec2 uv;
|
||||
|
||||
float r = sqrt( dot(p,p) );
|
||||
float a = atan(p.y,p.x) + 0.5*sin(0.5*r-0.5*time);
|
||||
|
||||
float s = 0.5 + 0.5*cos(7.0*a);
|
||||
s = smoothstep(0.0,1.0,s);
|
||||
s = smoothstep(0.0,1.0,s);
|
||||
s = smoothstep(0.0,1.0,s);
|
||||
s = smoothstep(0.0,1.0,s);
|
||||
|
||||
uv.x = time + 1.0/( r + .2*s);
|
||||
uv.y = 3.0*a/3.1416;
|
||||
|
||||
float w = (0.5 + 0.5*s)*r*r;
|
||||
|
||||
vec3 col = texture2D(tex0,uv).xyz;
|
||||
|
||||
float ao = 0.5 + 0.5*cos(7.0*a);
|
||||
ao = smoothstep(0.0,0.4,ao)-smoothstep(0.4,0.7,ao);
|
||||
ao = 1.0-0.5*ao*r;
|
||||
|
||||
gl_FragColor = vec4(col*w*ao,1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user