Jump to content

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


codevinsky
 Share

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?

 

Regards

George

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

 Share

  • Recently Browsing   0 members

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