lasertown Posted December 4, 2019 Share Posted December 4, 2019 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 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 4, 2019 Share Posted December 4, 2019 > 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 ? Quote Link to comment Share on other sites More sharing options...
lasertown Posted December 4, 2019 Author Share Posted December 4, 2019 Oh ok I see. Thanks so much, I'll try using just a shader. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.