Hello, I need to implement a geometry aware gaussian blur filter that blurs along the surfaces (like walls). To do that I need to get the per-pixel vectors that represent the surfaces variation/gradient in screen-space like in this image:

Unfortunately I don’t know how to get these vectors. I supose it can be done by using the dFdx and dFdy GLSL functions to find the per-pixel variation of something but I’m really confused about the details. I’d really appreciate any help.

Thanks in advance.

—João Cabeleira