Whenever I have a niagra effect finish, it leaves a shadow behind like its burnt into the world. Refer to animated gif, you can see the shadow remain after the firing animation completes.
This burnt in shadow lasts until I zoom in, after which the artifact corrects itself and goes away until I shoot again.
How does one correct this graphical issue with niagra fx? (or if its not just pertaining to niagra, in general?)
EDIT: This is not a niagara issue, this is a virtual shadow map issue and the actual problem is the top of the staff here is having its shadow linger on the ground until I zoom in or rotate. This is covered in the solution on how to fix.
I have not. I have been assembling some information that may solve the problem. Your reply is a new solution to try.
So far what I’ve found is that the issue derives from a virtual shadow map cache not updating itself properly.
Some solutions I have seen to try:
Disable Virtual Shadow Maps (not something I want to do unless I have to)
Disable shadow map caching if the performance hit is acceptable
Using console command “r.Shadow.Virtual.Cache.DrawInvalidatingBounds 1” to show the actor bounds scale and see whats popping out thats not causing a refresh.
Also suggested to try: View Mode (usually Lit) in Viewport → Virtual Shadow Map → Cached Page to see valid and invalid spots.
Another person posted something about “character mesh bound scale works for him” and he showed him setting the BoundsScale to 100 on his character mesh.
This leads me to believe that the problem is the staff mesh in the mannequin’s hand is larger than the bounds scale, and it is that staff shadow that keeps getting left behind on the ground. Not just when he shoots like in my graphic, but when he’s walking around as well.
I will play around with a few of these and post what worked, and likely do a video on my youtube page highlighting this one simply because it was a bit more ornery. Thank you for the added suggestion to try and look into as well!
So running the game, and then running the command r.Shadow.Virtual.Cache.DrawInvalidatingBounds 1
Shows the above image. Note that the top of my staff is sticking out. That is the culprit and what is causing the issues with “shadows sticking/lingering”.w
How to Fix
There were two ways that would accomplish the fix. The first is going into the skeletal mesh of the character in blueprint, (make sure the skeletal mesh is selected) and pulling its Bounds Scale.
Bumping this to 2.0 resulted in the following bounds being shown me in the editor when running the game:
The larger this area is that we are defining, the more space will be invalidated everytime we move. Now this can cause performance hits. We want these volumes to be as tight as possible.
I noticed that the staff had a volume as well. See how small that is in the image above? What if we set the bounds of the weapon instead? Because the issue is that the staff is causing these artifacts because the staff head and tail are sticking out of its bounding box (the tail tends to not cause the problem but thats because its encapsulated in the character box).
I set the character back to a 1.0 scale, and the staff after dorking around a bit found that 1.65 encapsulated it. See image above. (also note the sword guy next to him has the point of the sword sticking out of its box… which also can cause this problem)
That also fixes the problem as you can see in the gif. No more shadow relic. And the bounding boxes are tighter resulting in a better solution since I am making sure that the invalidation of the shadow map is as small as possible for better performance.
This answer was super helping in solving this for me. But when I use the command r.Shadow.Virtual.Cache.DrawInvalidatingBounds 1 I don’t see any bounding boxes? Is there something else I need to enable? (fixed it by trial and erroring a value in the bounds box for now, but showing the bounds would be better).
Did you manage to figure out how to be able to see the debug box using the command r.Shadow.Virtual.Cache.DrawInvalidatingBounds 1 and how to change the bounds on the mesh?
I posted this in another thread and thought I’d add here too: I’m noticing that this happens with the default mannequin and default settings whenever the quality is changed from Medium to High without restarting the engine. I don’t know how the internals work, but I’m wondering if there is some kind of cache that is not being updated or invalidated properly.
edit: Well, not even an hour later I’ve been exclusively working in the engine on High and the shadow residue thing is still an issue with the default mannequin.