• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

a guest Sep 27th, 2008 458 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. db "float f(vec3 o){"
2. db      "float a=(sin(o.x)+o.y*.25)*.35;"
3. db      "o=vec3(cos(a)*o.x-sin(a)*o.y,sin(a)*o.x+cos(a)*o.y,o.z);"
4. db      "return dot(cos(o)*cos(o),vec3(1))-1.2;"
5. db "}"
6.
7. db "vec3 s(vec3 o,vec3 d){"
8. db      "float t=0.,a,b;"
9. db      "for(int i=0;i<75;i++){"
10. db              "if(f(o+d*t)<0){"
11. db                      "a=t-.125;b=t;"
12. db                      "for(int i=0; i<10;i++){"
13. db                              "t=(a+b)*.5;"
14. db                              "if(f(o+d*t)<0)b=t;else a=t;"
15. db                      "}"
16. db              "vec3 e=vec3(.1,0,0),"
17. db              "p=o+d*t,"
18. db              "n=-normalize(vec3(f(p+e),f(p+e.yxy),f(p+e.yyx))+vec3((sin(p*75.)))*.01);"
19. db              "return vec3("
20. db                              "mix( ((max(-dot(n,vec3(.577)),0.) + 0.125*max(-dot(n,vec3(-.707,-.707,0)),0.)))*(mod(length(p.xy)*20.,2.)<1.0?vec3(.71,.85,.25):vec3(.79,.93,.4))"
21. db                              ",vec3(.93,.94,.85),"
22. db                              "vec3(pow(t/9.,5.))"
23. db                              ")"
24. db                      ");"
25. db              "}"
26. db              "t+=.125;"
27. db      "}"
28. db      "return vec3(.93,.94,.85);"
29. db "}"
30.
31. db "void main(){"
32. db      "float t=dot(gl_Color.xyz,vec3(1,256,65536))*.5;"
33. db      "gl_FragColor=vec4(s(vec3(sin(t*1.5)*.5,cos(t)*.5,t), normalize(vec3((gl_FragCoord.xy-vec2(512,384))/vec2(512),1))),1);"
34. db "}"
35. db 0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Not a member of Pastebin yet?