1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| float remap01( float a , float b , float t ){
return clamp( (t-a)/(b-a), 0. , 1. ); }
float remap ( float a , float b , float c , float d , float t ){
return remap01( a , b , t ) * ( d - c ) + c;
}
vec2 fixUV(in vec2 c) { return (2. * c - iResolution.xy) / min(iResolution.x, iResolution.y); }
void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec2 uv = fixUV(fragCoord); vec3 col = vec3( 0.9 , 0.65 , 0.1 ) ; float d= length(uv); float highLight = remap ( -1. , 1. , 0. , 0.5 , uv.y ); fragColor = vec4(col * highLight,1.0); }
|