SetShadowMapFilter

So I found SetShadowMapFilter and I’m not sure how I’m supposed to use it. From what I can see (the seemingly obvious) the first parameter needs the game context and the second is the actual blurring function. Thing is, I’m not sure what kind of output the blurring function needs to give. My assumptions would be vec3 or float, but I notice that the type for the parameter is “ShadowMapFilter”. I’m not sure I entirely understand what that is. From my limited knowledge it looks like an enum, but an enum wouldn’t work for that kind of thing. If now one wants to explain it can I get a link to the relevant parts of the code from Github?

Have you seen this line? It might help you try out some things.

Ah, its a callback function pointer placeholder for a custom implementation - you provide a matching function, and hand a pointer to the api - interesting, have not messed with this.

I’m not used to seeing “using” being used in this way - we’d usually use “typedef” here.

Is there any reason no one seems to use this?

Other priorities :woozy_face:

…and maybe it’s simply a little known and puzzling feature because of lacking documentation and current implementation. Do share any findings. :slight_smile:

I’ll figure it out. Will share anything I find

1 Like

No one seems to use “what”? I mentioned something was unusual, but people do learn their own habits, and I won’t tell them it’s wrong, if their code still runs rock solid.

The filter is used for VSM blurring.

Three other use-cases that immediately come to mind:

  • ESM/EVSM, for blurring again
  • Imperfect Shadow Maps, for filling the void gaps.
  • Compositing a multi-channel shadowmap into a final singular map or more narrow one (ie. composite per shadow-pixel not sampled pixel)
2 Likes

Found out that I could blur shadows in the shader so I’ve been working on that. Now I’m having issues with seams appearing in omni-directional shadows (point light shadows). If anyone comes across this and know how I can fix them the help is appreciated. In the mean time I’m gonna make a new topic on it since it’s not related to this C++ shadow filter.

Could you share the code you used to make it work?

I didn’t use this, the blurring is done entirely in shader. Didn’t even need to touch C++. Might rework the shadowing code later when I feel like both my skills in C++ are good enough and there’s an advantage to doing it in C++ rather than shaders. (I meant to make this a reply the first time I posted it but pressed the wrong thing.)

1 Like