scene.org File Archive

File download

<root>­/­parties­/­2014­/­tokyodemofest14­/­7_lines_glsl_graphics_compo/gunyogunyo-hole.zip

File size:
2 854 bytes (2.79K)
File date:
2014-04-06 23:04:12
Download count:
all-time: 72

Preview

  • 7line.txt 612B
  • info.txt 86B

file_id.diz

#ifdef GL_ES
precision mediump float;
#endif
uniform float time;uniform vec2 resolution;float t=time,e=.1,v=20.;float S(vec3
p){p.z-=v;return length(p)-6.+sin(t)*sin((acos(p.y/length(p))+t)*v)*cos((acos(p
.x/length(p.xz)))*v);}void main(){vec3 n,l,D,P=vec3(0),o=vec3(-gl_FragCoord.xy/
resolution.xy+vec2(.5),1.);o.y*=resolution.y/resolution.x;D=normalize(o-P);for(
int i=0;i<64;i++)o+=S(o.xyz)*.4*D;n=normalize(vec3(.0,S(o+vec3(e)),S(vec3(0,0,e
)+o))-S(o)),l=vec3(4.*cos(t),0,4.*sin(t))-o;gl_FragColor=vec4(vec3(vec3(sin(t*
.7),sin(t),cos(t*.3))*(dot(l,n)+pow(dot(reflect(-l,n),P-o),.1))/length(l)),1);}‚®‚É‚å‚®‚É‚å by hole/n.h.k.

E‘åÌ‚ɍì‚Á‚½GLSLƒVƒF[ƒ_‚ðÄ—˜—p‚µ‚‚Â7s‚É’´ˆ³kI