# SetMaterial causing flashing

**URL:** <https://forums.unrealengine.com/t/setmaterial-causing-flashing/558741>\
**Category:** Rendering\
**Tags:** dynamic-lighting, unreal-engine, Rendering, Shaders, question, UE4-27\
**Created:** [May 16, 2022, 8:39pm UTC](https://forums.unrealengine.com/t/setmaterial-causing-flashing/558741 "2022-05-16T20:39:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GaySuperman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GaySuperman](https://forums.unrealengine.com/u/GaySuperman)\
**Post date:** [May 16, 2022, 8:39pm UTC](https://forums.unrealengine.com/t/setmaterial-causing-flashing/558741/1 "2022-05-16T20:39:30Z")

</div>

I am using custom shading nodes to toggle between different shading effects on my meshes. When I want to swap effects, I just use SetMaterial to change the material I’m rendering. This causes a flickering effect while seems to go back and forth between different materials. I am rendering all of this in VR with dynamic lighting. Is there a better way to swap materials during runtime?
