How to get certain lighting information into your shader?

Leofwin
Fri, 21 Nov 2025 22:07:02 +0000
Rendering

Heyhey, guys! :]

I am currently setting up a fresnel-based iridescent shader and my goal is to make it somewhat physically accurate. For that I need to feed some light information into the shader that’s not easily accessible through the available default nodes. Basically, what I need is the information how much light hits the surface at any point and from which angle.

I am sure that I’ll have to do some blueprinting to do that but since I am still pretty new to that, I definitely need some advice here. Is there a way to access both light intensity hitting the surface and light angle?

I had the idea of getting the light direction of every light source in the scene with every loop as well as getting the intensity of every light source and decreasing that with higher distance between light sources and surface, which approximates light intensity hitting the surface. However, it’s not the most accurate solution for sure (since that doesn’t take shaded areas into account and generally it’s more of an approximation rather than fully correct) and I feel there are better approaches, especially since this doesn’t take GI into account.

I know I could simplify it by just using SkyAthmosphereLightDirection and multiplying the fresnel with that before feeding it into the hue shift I’m using to create the iridescence (which is what I’m currently doing) but that has several downsides compared to what I am trying to achieve, like being dependent only on one single light source (and only the directional light, nothing else) rather than taking all lights or even something like GI into account, it that approach doesn’t consider light intensity and/or shaded areas, either.

If there are technical limitations that restrict me from accessing this info, I’ll use the approach above but I’d really rather like to get something more accurate.

Any advice is welcome! :] Thank you in advance!

Leo

4 posts - 3 participants