Timopheym Posted August 2, 2015 Share Posted August 2, 2015 Hey people! I wanna implement this shader (https://www.shadertoy.com/view/MslGWN#) in phaser state. So i transformed the shader to WebGL style, and added patch to phaser to update iChannel uniforms on update.Phaser.Filter.prototype.update = function (pointer, uniforms) { if (typeof pointer !== 'undefined') { var x = pointer.x / this.game.width; var y = 1 - pointer.y / this.game.height; if (x !== this.prevPoint.x || y !== this.prevPoint.y) { this.uniforms.mouse.value.x = x.toFixed(2); this.uniforms.mouse.value.y = y.toFixed(2); this.prevPoint.set(x, y); } } if (typeof uniforms !== 'undefined') { for (var i in uniforms) { this.uniforms[i].value = uniforms[i]; } } this.uniforms.time.value = this.game.time.totalElapsedSeconds();};But it does no helped. There is no affection from music to fractal generation. Like i do pass null's.Example could be found here:https://timopheym.me/phaser/shader_music.html (sorry, i don't have ssl certificate =( ) I have no idea where am i wrong. It's about two days i am trying to fight it... thanks! Link to comment Share on other sites More sharing options...
Timopheym Posted August 3, 2015 Author Share Posted August 3, 2015 Created jsbin to play with the codehttp://jsbin.com/yutiwejoja/1/edit?js,output Link to comment Share on other sites More sharing options...
Recommended Posts