Jump to content

bezierCurveTo artifacts


bones
 Share

Recommended Posts

Sorry, figured out I had the handles in the wrong order, hence the weirdness.

I think you were right before, the placement of the control points was not usual but I don't think the rendering was correct for that special case of the cubic curve.

Can you use pixijs to draw an animated graphic each frame, how does it perform in Webgl in comparison to canvas?

I don't see vectors mentioned much on the forum so I have a hunch you may have to benchmark this yourself.

I wouldn't be surprised if the hardware accelerated 2D canvases such is common on mobile outperforms Pixi's technique - I think I looked at the Chrome Skia code a while ago and saw they were using Loop-Blinn to rasterise bezier splines efficiently with the fragment shader (browsers can also use native code and can use graphics libraries free of the limitations of WebGL)... but then perhaps you might see browsers that use or fallback to software rasterisation of curves (is this still common?), or context switching overhead and other things you are drawing in your scene might shift benefits back towards a WebGL solution

Link to comment
Share on other sites

Thanks for the response, as you suggested I did a Jsperf

http://jsperf.com/canvas-library-graphics-drawing/2

 

and it confirms that native canvas > pixi canvas > pixi webgl for performance of drawing beziers.

Thanks for the pointer towards loop-blinn I found this great article that explained some of the vector options for webgl
http://mattdesl.svbtle.com/drawing-lines-is-hard

I think now I will just use native canvas drawing for the vectors and then cache any repeating animations to a texture and use a pixi movieclip. That will be my next Jsperf test!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...