Sign in to follow this  
lasertown

Pixi filters v5 help

Recommended Posts

I just started working with pixi filters (using pixi 5.x) and I'm confused about the coordinate systems available to me inside the fragment shader. I've tried reading the documentation and I'm still confused. Specifically, I have a texture thats 64x64 pixels, and I want to color fragments a certain way if they're past a certain percentage. So like, I'd like to color the fragments in the last fourth of the texture red. I assumed I could do something like if(vTextureCoord.x > .75) to identify these fragments, but this percentage doesn't seem to map to the fragments I think it should. I inspected the uSample uniform passed to the fragment shader, and I see a texture buffer that's double the size of my texture (128x128). I'm thinking this might have something to do with it but it's unclear as of right now. I'm still digging, but maybe someone can point me in the right direction here?

Thanks,

Mike

Share this post


Link to post
Share on other sites

 and I see a texture buffer that's double the size of my texture (128x128)

Its temporary pow2 texture. Filters are supposed to be heavy solution that works on whole containers , not depending on whatever is inside. Blur, Glow, Outline, anything is possible. Are you sure you need them and not  https://pixijs.io/examples/#/mesh-and-shaders/triangle-textured.js ?

 

 

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.