globHammer Posted April 18, 2014 Share Posted April 18, 2014 I am looking to find a filter for Pixi that can adjust the hue of a Sprite.I come from a flash background and loved using the color matrix class. http://gskinner.com/blog/archives/2007/12/colormatrix_cla.html Does such a thing exist for PIXI? Quote Link to comment Share on other sites More sharing options...
dirkk0 Posted April 19, 2014 Share Posted April 19, 2014 Being a newb myself, I shoudn't answer this - but I'll try anyways :-). Looking at the documentation and the example, there doesn't seem to be a filter that supports hue. But - looking at the Pixi source, I see that the filters are parameterized WebGL fragment shaders, for example:http://www.goodboydigital.com/pixijs/docs/files/src_pixi_filters_InvertFilter.js.html#l5 It should be feasible to create a new filter to extend Pixi with a hue and saturation shader by looking into similar libs that have more examples of shaders like this great 'glfx' library:https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/huesaturation.js One can see that the structure is very similar. With enough time and experimentation I can imagine that the mileage is not too big. Quote Link to comment Share on other sites More sharing options...
george Posted April 19, 2014 Share Posted April 19, 2014 dirkk0 is kind of right with his idea. There is already a webgl filter to accomplish hue. And the class itself is titled PIXI.ColorMatrixFilter But as a webgl filter, this won't work with a canvas renderer. Look here for the example: http://www.goodboydigital.com/pixijs/examples/15/index.html. Regarding the canvas implementation of a color matrix filter: This seems to be an enhancement so you should better ask it the github repository I guess. https://github.com/GoodBoyDigital/pixi.js/ Regards George Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.