• Content Count

  • Joined

  • Last visited

  1. Apologies, I assure you I did look through what I could find before posting. I had seen the mesh-and-shaders example, but this shows a Mesh using a constructor which accepts a shader. Sprite does not have a constructor like this. But the Sprite documentation shows a 'shader' property which can either be a Filter or a Shader, but setting this property appears not to have any effect. So my question is, is it possible to apply a shader to a Sprite object? Or do I need to instead create a textured mesh if I want to apply a customer shader (not filter) to a display object?
  2. I understand the difference between filters/shaders in pixi, but how does one actually apply a custom shader in v5? I'm assuming filters have more overhead than using raw shaders (from everything I've read) so I'd like to use shaders for simple effects. Assigning the shader property of a sprite to a valid program doesn't seem to do anything. Thanks
  3. Oh ok I see. Thanks so much, I'll try using just a shader.
  4. 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