Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3980

createShaderPlugin Helper Function

$
0
0

Well I really wanted to be able to setup each shader plugin with just a simple function call so I made this createShaderPlugin function that works like this:

createShaderPlugin(name, vertShader, fragShader, uniformDefaults);

I uploaded the file createShaderPlugin.js to the post if you want to check it out.

I also made this little CodePen to demonstrate the usage with some comments.

The encapsulated code is based on the plugin example and on the worldTransform/vertices calculations that I boosted from PIXI.Sprite:). I have tried to optimize and condense for the use case when the Sprite doesn't have a Texture and tried to make it easy to use and behave expectedly... But please let me know if you find improvements/mishaps or have questions about it  :)


Viewing all articles
Browse latest Browse all 3980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>