GLSL - How to code a "local" jitter blur #368
Answered
by
pragma37
adamwparker
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
pragma37
Jul 29, 2022
Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
adamwparker
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The main problem is that since the offsets are random for each pixel, the GPU is going to select a very small mip map.
So the checkerboard that ends up using will look something like this:
The solution is to tell the GPU the LoD you want to use::
textureLod(qualifier_texture, uv + offset, 0)
(The LoD 0 is always the full image resolution, LoD 1 is half the resolution and so on)
Additionally, you were also accumulating samples for pixels below the "qualifier" threshold, which I guess is not what you wanted?
I guess this is the result you're looking for?
If that's the case, this is the modified code I used: