nuthinking Posted July 19, 2015 Share Posted July 19, 2015 What is the best way to draw multiple times into a PIXI.Graphics and being able to apply alpha or blend mode to the result and have a unique shape? This shows the issue: http://codepen.io/anon/pen/zGLyEW This is a failed attempt: http://codepen.io/anon/pen/mJjaGd Thanks! chr Quote Link to comment Share on other sites More sharing options...
xerver Posted July 20, 2015 Share Posted July 20, 2015 You mean instead of the alphas combining you wanted to "add" to the shape? You could just drw any arbitrary polygon. Quote Link to comment Share on other sites More sharing options...
nuthinking Posted July 20, 2015 Author Share Posted July 20, 2015 As you can imagine, determining the resulting polygon of multiple added shapes is not so fun. In my case the shapes are simple so it could be an option. Just wondering if there is a simpler one. Maybe it could be useful as a feature. chr Quote Link to comment Share on other sites More sharing options...
xerver Posted July 20, 2015 Share Posted July 20, 2015 > As you can imagine, determining the resulting polygon of multiple added shapes is not so fun But you want us to add it in core? There are quite a few libraries out there for manipulating and building polygons. I don't think that the drawing context is the place for that kind of functionality. Quote Link to comment Share on other sites More sharing options...
nuthinking Posted July 20, 2015 Author Share Posted July 20, 2015 In canvas 2d is pretty cool how you can draw use different operations (source-in, out, etc...). No idea how complex that would be to replicate in WebGL. But I guess it would be great to have similar functionalities. Will search for some polygons library, I used to do these things with Processing so I am sure there are some scripts around. Thanks, chr Quote Link to comment Share on other sites More sharing options...
nuthinking Posted July 20, 2015 Author Share Posted July 20, 2015 Following Mat suggestion, a renderTexture: http://codepen.io/anon/pen/mJGdxK seems to be a valid option. chr Quote Link to comment Share on other sites More sharing options...
xerver Posted July 20, 2015 Share Posted July 20, 2015 > In canvas 2d is pretty cool how you can draw use different operations (source-in, out, etc...). No idea how complex that would be to replicate in WebGL. But I guess it would be great to have similar functionalities. Extremely complicated! If you want to use canvas feature to create a texture just draw to a canvas and use PIXI.Texture.fromCanvas() 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.