# How to unload material function base on player distance

**URL:** <https://forums.unrealengine.com/t/how-to-unload-material-function-base-on-player-distance/492211>\
**Category:** Rendering\
**Tags:** unreal-engine, Performance, function, UE4-27, question\
**Created:** [January 28, 2022, 4:05pm UTC](https://forums.unrealengine.com/t/how-to-unload-material-function-base-on-player-distance/492211 "2022-01-28T16:05:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfza](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dfza](https://forums.unrealengine.com/u/dfza)\
**Post date:** [January 28, 2022, 4:05pm UTC](https://forums.unrealengine.com/t/how-to-unload-material-function-base-on-player-distance/492211/1 "2022-01-28T16:05:49Z")

</div>

Hi,  
for performance reason, i want to know if there is a way to unload or switch off some material functions when player is far?  
pixel depth are runtime numbers, how to make it into a Boolean?  
or there is another way to achieve this?  
please help me. thank you
