# Lumen - Material Pass Replace Node

**URL:** <https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883>\
**Category:** Feedback & Requests\
**Tags:** FeatureRequest, unreal-engine, UE5-0, Lumen\
**Created:** [May 28, 2021, 9:45am UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883 "2021-05-28T09:45:13Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr4Goosey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mr4Goosey](https://forums.unrealengine.com/u/Mr4Goosey)\
**Post date:** [May 28, 2021, 9:45am UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/1 "2021-05-28T09:45:13Z")

</div>

Having played with Lumen and the material editor for a while this morning, it sorely stood out to me that Lumen does not use any of the existing Switch/Replace nodes in the Material Editor, nor does it have its own.  
Currently, if one would want an emissive surface to be 1 intensity on-screen, but 1000 intensity for Lumen, that’s not possible, while it’d be an incredibly useful control to have for artistic direction.

---

<div class="post-metadata">

**Author:** ![Phyronnaz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Phyronnaz](https://forums.unrealengine.com/u/Phyronnaz)\
**Post date:** [May 29, 2021, 9:44am UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/2 "2021-05-29T09:44:53Z")

</div>

On ue5-main there’s a LUMEN\_CARD\_CAPTURE define, so you can do something like this in a custom node:

```
#if LUMEN_CARD_CAPTURE
return InputA; 
#else
return InputB;
#endif
```

---

<div class="post-metadata">

**Author:** ![PrizmIzm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PrizmIzm](https://forums.unrealengine.com/u/PrizmIzm)\
**Post date:** [May 30, 2021, 11:15am UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/3 "2021-05-30T11:15:25Z")

</div>

I’m a total novice with custom nodes but I tried your idea with, what I think, is correct syntax.  
Getting and ‘Undeclared Identifier’ for ‘LUMEN\_CARD\_CAPTURE’.

Would you be up for playing around with this for a min and seeing if you can get your idea working?  
I know there’s a few posts that have already requested this feature, so at least a few people would be grateful.

Thanks in advance

 ![lumenreplace](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/0/20cf4ce24b7bf583d0d889a90e4c5c1b9b091005.jpeg)

---

<div class="post-metadata">

**Author:** ![Mr4Goosey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mr4Goosey](https://forums.unrealengine.com/u/Mr4Goosey)\
**Post date:** [May 30, 2021, 5:54pm UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/4 "2021-05-30T17:54:25Z")

</div>

What Phyronnaz put in his post is the exact syntax you want in your custom code block. Hashtags and all. You don’t want to create a regular 'ole branch, you want to define a switch, hence the hashtags and endif.  
On top of that, keep in mind that it only works on ue5-main. If you’re using the launcher build (ue5-ea) it won’t work.

---

<div class="post-metadata">

**Author:** ![PrizmIzm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PrizmIzm](https://forums.unrealengine.com/u/PrizmIzm)\
**Post date:** [May 30, 2021, 9:20pm UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/5 "2021-05-30T21:20:44Z")

</div>

Thanks, I would never have known that. I’m just using the EA build from the launcher as you might have guessed.

---

<div class="post-metadata">

**Author:** ![thecherub69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thecherub69](https://forums.unrealengine.com/u/thecherub69)\
**Post date:** [June 8, 2022, 12:57am UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/6 "2022-06-08T00:57:33Z")

</div>

cant get it to work. the emissive just goes away entirely if i pipe a 0 into the other input. if u use higher numbers the gi is there again in either input.  
anyone else get it going?

much appreciated if anyone posts

---

<div class="post-metadata">

**Author:** ![GHforGroundhog1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GHforGroundhog1](https://forums.unrealengine.com/u/GHforGroundhog1)\
**Post date:** [June 27, 2022, 10:57am UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/7 "2022-06-27T10:57:44Z")

</div>

This doen’t work.

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [October 28, 2022, 9:25am UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/8 "2022-10-28T09:25:22Z")

</div>

I’m very happy to report this is working in UE 5.1 (preview, at least)

---

<div class="post-metadata">

**Author:** ![Krzysztof.N](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Krzysztof.N](https://forums.unrealengine.com/u/Krzysztof.N)\
**Post date:** [October 28, 2022, 5:28pm UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/9 "2022-10-28T17:28:15Z")

</div>

I would recommend to use the Ray Tracing Quality Replace Node for this: [Hardware Ray Tracing Tips and Tricks in Unreal Engine | Unreal Engine 5.0 Documentation](https://docs.unrealengine.com/5.0/en-US/hardware-ray-tracing-tips-and-tricks-in-unreal-engine/#raytracingqualityswitchreplacenode). Keep in mind that this won’t affect screen space traces, as those trace and hit what you see on the screen.

---

<div class="post-metadata">

**Author:** ![MichaelRev1412](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MichaelRev1412](https://forums.unrealengine.com/u/MichaelRev1412)\
**Post date:** [November 22, 2022, 2:48am UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/10 "2022-11-22T02:48:24Z")

</div>

Ive been struggling for days to figure out how to hide the emissive object and keep the light from it. I’m not sure how to get from the code listed above to the custom node “LumenReplace.” Is there some kind of custom node I enter that code into? Would love some help so I can get this working! Thank you!

---

<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:** [November 25, 2022, 9:50pm UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/11 "2022-11-25T21:50:03Z")

</div>

Yes, that is using the “Custom” node.

---

<div class="post-metadata">

**Author:** ![snake828](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@snake828](https://forums.unrealengine.com/u/snake828)\
**Post date:** [November 30, 2022, 11:59pm UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/12 "2022-11-30T23:59:33Z")

</div>

Hi, does anyone have an example of how to set up this custom node so it disables the lighting from emissive materials? I’m struggling to get it working.

---

<div class="post-metadata">

**Author:** ![BenVlodgi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/benvlodgi/32/1194567_2.png) [@BenVlodgi](https://forums.unrealengine.com/u/BenVlodgi)\
**Post date:** [June 7, 2023, 6:27pm UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/13 "2023-06-07T18:27:47Z")

</div>

For those who don’t know how to make a custom node:

- Make `Custom` node in the material graph.  

- Click it. Its details panel will look like this.  

- Paste this code (adapted from [Lumen - Material Pass Replace Node - #2 by Phyronnaz](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/2))  
Into the `Code` value.

```auto
#if LUMEN_CARD_CAPTURE
return Lumen; 
#else
return Default;
#endif

```

- Add `Default` and `Lumen` to the Inputs Array.
- Give it a custom Description, So it doesn’t say “Custom”
- It should look like this now. You’re done!  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/1/4/414e945f5cb3fb702b0c2957fc6b09900f8e1a45.png)

---

<div class="post-metadata">

**Author:** ![VirtuVius\_RV](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VirtuVius\_RV](https://forums.unrealengine.com/u/VirtuVius_RV)\
**Post date:** [January 9, 2024, 8:35pm UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/14 "2024-01-09T20:35:46Z")

</div>

Thank you for your detailed explanation.  
I managed to implement this Custom Node without errors, trying to make it use two different values on the Emissive multiplier, for Lumen and Default (0.01 and 1, respectively).  
Basically, I tried to almost disable emissiveness for Lumen. Unfortunately, in my case, there doesn’t seem to make any difference on the material. The value it uses is still the Default (1) and it ends up contributing to the Lumen GI scene, which was not intended.

Could I be doing something wrong? Is there a way to remove the emissiveness contribution of the material on the Lumen GI? Or is impossible to have a flat-color, fully-unlit material with a Lumen scene? Thank you.

---

<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:** [January 9, 2024, 10:03pm UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/15 "2024-01-09T22:03:41Z")

</div>

Did you disable screen traces? This node only effects the raytraced version of Lumen, so it is not compatible with Lumens screen traces GI.

---

<div class="post-metadata">

**Author:** ![VirtuVius\_RV](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VirtuVius\_RV](https://forums.unrealengine.com/u/VirtuVius_RV)\
**Post date:** [January 11, 2024, 4:09pm UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/16 "2024-01-11T16:09:06Z")

</div>

Thanks for your input!  
No, I did not disable screens traces. I did not realise this node was meant just for the raytraced part of Lumen. I might experiment with that later, although I suspect that won’t solve the problem entirely, since I need my scene to work with both RTX and non-RTX hardware, while mantaining a strong visual coherence throughout.

In the meantime, I seem to have found a satisfactory workaround for my problem, which I’ll leave here, just in case it becomes useful to anyone.

My issue was that whenever I dimmed the lighting on my scene (i.e. ‘night mode’) the lower spectrum of the Auto-Exposure would kick in, thus creating a disproportionately strong glow around any emissive/unlit material that I had on some widget or tool/technical objects. That glow would also spill into Lumen GI, creating a ‘Point Light’ effect on, for instance, a 3D mouse cursor sphere. That was not intended, artistically.

What I ended up doing was using a View Property node set to Pre-Exposure, on all my Unlit/Emissive materials. Multiplying its ‘InvProperty’ output by the Emissive factor of the Material, what I get is a kind of constant Emissiveness appearance, even when the Exposure values change radically, effectively cancelling out the exaggerated and unwanted ‘glow’ that I mentioned above.

Mind you, I did not reach this solution all by myself, I found it on this page, where it is explained nicely:

> **[\[Unreal\] Fixing Unlit Materials](https://www.protowlf.com/unreal/unreal-fixing-unlit-materials/)**
>
> Make unlit materials behave how you expect in Unreal

Cheers!

---

<div class="post-metadata">

**Author:** ![SeRroZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeRroZ](https://forums.unrealengine.com/u/SeRroZ)\
**Post date:** [May 27, 2025, 12:57am UTC](https://forums.unrealengine.com/t/lumen-material-pass-replace-node/231883/17 "2025-05-27T00:57:51Z")

</div>

It does work for both HW and SW Lumen, you just have to disable screen traces, but it may increase ghosting. 1st image is HW Lumen with Screen traces disabled, 2nd one is SW Lumen with Screen traces enabled, for both version the shader used RayTracingQualitySwitchReplace, I’m using 5.5.4.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/9/c/a9cf95ec8fc8bab46b262ed940f5429a73c1b984.jpeg)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/1/c/81c514f327f1278deb39eae0650970cbef88e12b.jpeg)
