Questions about custom filters and uniform 'uTexture' #10544
Unanswered
paulgrassler
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
I am currently trying to implement a custom Post-Process Motion Blur filter for a 2D game of mine (Yes, I am aware that there are existing solutions for motion blur in pixi, but I want to learn how to get there.) To achieve this, I figured using a custom filter/shader is the best approach from a performance standpoint. However, I feel like I am missing a lot of the stuff that is going on when a custom filter is applied. Most importantly, I want to understand the built-in 'uTexture' uniform. As I understand it, this is a renderTexture of the container before applying the filter? Is this correct? If so, I would need to access a neighborhood of pixels for each pixel in the texture to achieve my motion blur technique in the frag shader. Can this be done by just simply sampling the texture with vTextureCoord + vec2(pixel_offset.x / container_width, pixel_offset.y / container.height) or is there stuff to be aware of?
Also, can someone tell me what the built-in uniform inputSize.zw is (vertex shader)? (inputSize.xy is clear to me).
I am really kind of stuck here, would appreciate some help. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions