Lumen - Material Pass Replace Node

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.

1 Like

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
8 Likes

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

1 Like

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.

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

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

This doen’t work.

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

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. Keep in mind that this won’t affect screen space traces, as those trace and hit what you see on the screen.

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!

Yes, that is using the “Custom” node.

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.

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

#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!
4 Likes