# Shader Dynamic branch not working?

**URL:** <https://forums.unrealengine.com/t/shader-dynamic-branch-not-working/1909078>\
**Category:** Rendering\
**Tags:** branch, unreal-engine, shader\
**Created:** [June 19, 2024, 2:27pm UTC](https://forums.unrealengine.com/t/shader-dynamic-branch-not-working/1909078 "2024-06-19T14:27:33Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![somawheels](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@somawheels](https://forums.unrealengine.com/u/somawheels)\
**Post date:** [June 19, 2024, 7:51pm UTC](https://forums.unrealengine.com/t/shader-dynamic-branch-not-working/1909078/5 "2024-06-19T19:51:31Z")

</div>

Thanks, I read through [Dynamic flow control in materials](https://forums.unrealengine.com/t/dynamic-flow-control-in-materials/68393). The take away from that thread seems to be pretty much what Arkiras said… Which kinda sucks. Custom nodes are horrible to work with unless your using them for short snippets of code.

One possible way of working around this, would be to make an HLSL code generator. The input would be material functions, and the output would be a hlsl custom node. However this wouldnt be easy to do, and you may end up with somewhat inefficient code.

---

_[View the full topic](https://forums.unrealengine.com/t/shader-dynamic-branch-not-working/1909078)._
