{"id":2966,"date":"2013-05-01T07:08:12","date_gmt":"2013-05-01T05:08:12","guid":{"rendered":"http:\/\/hintz.bplaced.net\/?p=2966"},"modified":"2015-03-16T01:33:24","modified_gmt":"2015-03-16T00:33:24","slug":"wavebars","status":"publish","type":"post","link":"http:\/\/hintz.bplaced.net\/de\/2013\/webgl\/wellenbalken\/","title":{"rendered":"Wellenbalken"},"content":{"rendered":"<p>Heute habe ich <a href=\"http:\/\/hintz.bplaced.net\/2013\/WebGL\/balken\/\" title=\"WebGL \u2013 Balken\">die Animation von gestern<\/a> noch weiter ver\u00e4ndert durch Wellen und durch Code-Optimierungen.<\/p>\n<p class=\"webgl\"><img decoding=\"async\" src=\"http:\/\/hintz.bplaced.net\/images\/2013\/05\/wavebars.jpg\" \/><a href=\"http:\/\/glslsandbox.com\/e#8409.12\"><canvas width=\"620\" height=\"620\"><script type=\"x-shader\/x-vertex\">attribute vec2 position; void main() { gl_Position = vec4(position, 0, 1); }<\/script><script type=\"x-shader\/x-fragment\">\n\/\/ bars - thygate@gmail.com\n\/\/ rotation and color mix modifications by malc (mlashley@gmail.com)\n\/\/ modified by @hintz 2013-04-30\n#ifdef GL_ES\nprecision mediump float;\n#endif\nuniform float time;\nuniform vec2 mouse;\nuniform vec2 resolution;\nvec2 position;\nfloat c = cos(time*0.5);\nfloat s = sin(time*0.5);\nmat2 R = mat2(c,-s,s,c);\nfloat barsize = 0.15;\nfloat barsangle = 100.0*sin(time*0.0001);\nvec4 bar(float pos, float r, float g, float b)\n{\n\treturn max(0.0, 1.0 - abs(pos - position.y + 0.1*sin(2.0*time+sin(1.0-pos*2.0)*4.0*position.x)) \/ barsize) * vec4(r, g, b, 1.0);\n}\nvoid main(void) \n{\n\tposition = (gl_FragCoord.xy - 0.5*resolution.xy) \/ resolution.xx;\n\tposition = 2.0*position * R; \t\t\n\tfloat t = time*0.5;\n\tvec4 color = bar(sin(t), 1.0, 0.0, 0.0);\n\tcolor += bar(sin(t+barsangle*2.), 1.0, 0.5, 0.0);\n\tcolor += bar(sin(t+barsangle*4.), 1.0, 1.0, 0.0);\n\tcolor += bar(sin(t+barsangle*6.), 0.0, 1.0, 0.0);\n\tcolor += bar(sin(t+barsangle*8.), 0.0, 1.0, 1.0);\n\tcolor += bar(sin(t+barsangle*10.), 0.0, 0.0, 1.0);\n\tcolor += bar(sin(t+barsangle*12.), 0.5, 0.0, 1.0);\n\tcolor += bar(sin(t+barsangle*14.), 1.0, 0.0, 1.0);\t\n\tgl_FragColor = color;\n\tgl_FragColor.a = 1.0;\n}\n<\/script><\/canvas><\/a><\/p>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Heute habe ich die Animation von gestern noch weiter ver\u00e4ndert durch Wellen und durch Code-Optimierungen.<\/p>\n","protected":false},"author":1,"featured_media":3003,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[144],"tags":[149,147,150,145,189],"_links":{"self":[{"href":"http:\/\/hintz.bplaced.net\/de\/wp-json\/wp\/v2\/posts\/2966"}],"collection":[{"href":"http:\/\/hintz.bplaced.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hintz.bplaced.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hintz.bplaced.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hintz.bplaced.net\/de\/wp-json\/wp\/v2\/comments?post=2966"}],"version-history":[{"count":15,"href":"http:\/\/hintz.bplaced.net\/de\/wp-json\/wp\/v2\/posts\/2966\/revisions"}],"predecessor-version":[{"id":3189,"href":"http:\/\/hintz.bplaced.net\/de\/wp-json\/wp\/v2\/posts\/2966\/revisions\/3189"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/hintz.bplaced.net\/de\/wp-json\/wp\/v2\/media\/3003"}],"wp:attachment":[{"href":"http:\/\/hintz.bplaced.net\/de\/wp-json\/wp\/v2\/media?parent=2966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hintz.bplaced.net\/de\/wp-json\/wp\/v2\/categories?post=2966"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hintz.bplaced.net\/de\/wp-json\/wp\/v2\/tags?post=2966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}