# \[BUG\] refraction doesn't work if compile directly with material attributes

**URL:** <https://forums.unrealengine.com/t/bug-refraction-doesnt-work-if-compile-directly-with-material-attributes/466407>\
**Category:** Rendering\
**Tags:** refraction, translucency, Raytracing, unreal-engine, question\
**Created:** [June 8, 2020, 8:31am UTC](https://forums.unrealengine.com/t/bug-refraction-doesnt-work-if-compile-directly-with-material-attributes/466407 "2020-06-08T08:31:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dextml](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dextml/32/901220_2.png) [@dextml](https://forums.unrealengine.com/u/dextml)\
**Post date:** [June 8, 2020, 8:31am UTC](https://forums.unrealengine.com/t/bug-refraction-doesnt-work-if-compile-directly-with-material-attributes/466407/1 "2020-06-08T08:31:08Z")

</div>

Original bug: [https://answers.unrealengine.com/questions/1046/bugrefraction-in-material-layer-doesnt-work-if-con.html](https://answers.unrealengine.com/questions/1046/bugrefraction-in-material-layer-doesnt-work-if-con.html)

* * *

As of 4.25.1, this bug still exists in a different form:

**To reproduce** :

1. create a material asset
2. Tick “Use Material Attributes”, DONT SAVE and COMPILE!
3. connect your node to albedo, opacity and refraction, then to the output node.
4. SAVE and COMPILE. no refraction!

(This test is done with raytracing enabled, but raytraced translucency disabled)

**to workaround** :

Create a normal material **without** ticking “Use Material Attributes”. then connect to the refraction slot, then compile. After this is done, you can freely use material attributes afterward.
