Jump to content

WebGL and GetImageData


pdiddles03
 Share

Recommended Posts

9 hours ago, ivan.popelyshev said:

I dont recomment to do it, it slows things down a lot. There are special methods in pixi that can achieve that. 

Which version of pixi are you using?

the  newest one, v3.  I wasn't going to do it multiple times.  I was only going to do it  once and  get all of the areas that are black for a collision map.  Is it still not advised? What methods exist in PIXI?

Link to comment
Share on other sites

It is a very bad idea, that stuff is slow as ... you know what :) You cant do that every frame. i think v4 has something like "renderer.plugins.extract.canvas(stage)" that returns you a canvas or "renderer.plugins.extract.pixels(stage)" that gives you the same stuff as getImageData. Use it only one time though, because it actually moves whole picture from GPU to CPU. Its very slow in webgl. Its a bit faster in canvas2d mode though.

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...