# Shadow Cache (I think) artifact when updating displacement at runtime.

**URL:** <https://forums.unrealengine.com/t/shadow-cache-i-think-artifact-when-updating-displacement-at-runtime/2165134>\
**Category:** Rendering\
**Tags:** unreal-engine, question\
**Created:** [December 2, 2024, 7:01pm UTC](https://forums.unrealengine.com/t/shadow-cache-i-think-artifact-when-updating-displacement-at-runtime/2165134 "2024-12-02T19:01:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ConcernedCitizen](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/concernedcitizen/32/88717_2.png) [@ConcernedCitizen](https://forums.unrealengine.com/u/ConcernedCitizen)\
**Post date:** [December 2, 2024, 7:01pm UTC](https://forums.unrealengine.com/t/shadow-cache-i-think-artifact-when-updating-displacement-at-runtime/2165134/1 "2024-12-02T19:01:50Z")

</div>

I have a material that is using tessellation. In the displacement slot I have a function that is sampling multiple points in space and updating displacement based on those points (sorta voronoi adjacent).

This works fairly well but there is a visual artifact whenever the points are updated. Based on its behavior I THINK that it is the shadow cache needing an update but it’s not getting updated unless the area either goes off screen or changes angle in some significant way.

The attached videos show the behavior. One shows a simple sin wave displacing the mesh and the other shows the points method I’m using (points are updated on impact).

Am I right that this is a shadow issue and is there any way of fixing the issue?

---

<div class="post-metadata">

**Author:** ![BananableOffense](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BananableOffense](https://forums.unrealengine.com/u/BananableOffense)\
**Post date:** [December 3, 2024, 1:53am UTC](https://forums.unrealengine.com/t/shadow-cache-i-think-artifact-when-updating-displacement-at-runtime/2165134/2 "2024-12-03T01:53:51Z")

</div>

Yes, that looks like a shadow cache issue. Static assets don’t normally update their cache, but you can force them to such as with the shadow cache invalidation behavior setting on the asset. This will increase the cost of drawing shadows and should be used prudently. Perhaps you can briefly toggle this setting from “static” to “always” and back again to prevent constant invalidations.

---

<div class="post-metadata">

**Author:** ![ConcernedCitizen](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/concernedcitizen/32/88717_2.png) [@ConcernedCitizen](https://forums.unrealengine.com/u/ConcernedCitizen)\
**Post date:** [December 3, 2024, 7:15pm UTC](https://forums.unrealengine.com/t/shadow-cache-i-think-artifact-when-updating-displacement-at-runtime/2165134/3 "2024-12-03T19:15:14Z")

</div>

Yeah I tried that but sadly that property is not editable. Well technically it is, I tried setting it via code as it is not settable via blueprint. However the issue is that the property on the component doesn’t matter at runtime as it gets applied to the scene proxy and the ShadowCacheInvalidationBehavior property on the scene proxy is protected ☹
