Jump to content

Are filters just fragment shaders or are they also vertex shaders?


Recommended Posts

I don't understand your question.

You're talking about the 'wobble bitmapdata' example. And you want to do something like this with webgl shaders? So why no look at the wobbleFilter.js example ? It's a perfect example of using a webgl shader in PIXI on the basis of an AbstractFilter . And what do you mean with sprite vertices? There are vertices in physics not in a sprite?




Link to comment
Share on other sites

Can I modify sprite vertices with Filters like the bitmap data wobble example, but with webgl shaders?


Not at the moment, no. This isn't exposed on a Pixi level so it's not available from Phaser either. The biggest issue really is that you couldn't re-create the wobble example with a vertex shader because you've only got a few vertices per sprite to actually play with! Remember every sprite is just a quad, but for an effect like that you'd almost certainly need vertices for each line of pixels maybe? A whole stack of quads just to be able to use a vs on them.


In order for vertex shaders to be useful there would need to be a way to break down a single sprite to use many vertices imho, and because it's all 2D anyway you can do pretty much anything you need with a fragment shader.

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.

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.


  • Recently Browsing   0 members

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