Download

How to measure luminance or brightness?

Hi,

For the application I’m making, I need two different environments to be of equal brightness. Problem is that I can’t find a way to measure the brightness well. In order to be able to create a good line or argumentation in his paper, the lead author I’m working with wants me to quantify the brightness of both areas and tinker with the lighting to equalize them.

Is this even possible in UE4?

Thanks!

Definitely possible. You can make a post process material, that would calculate brightness of each pixel using any formula of your choice.
Then it is about taking a screenshot and averaging all the pixels. Practical benefits of such measurements are frankly questionable though :slight_smile:

That sounds good! How would I catch the output value of one though?

You can create a post-process material where you sample luminosity per-pixel to determine brightness of the overall scene; I have a few varying methods of doing that through material functions in our repo: https://github.com/joymachinegames/joymachine-public/tree/master/ue4/materials/functions

Would this be a way to accurately measure light and sanity check with real world light values?

I mean, theoretically it’s possible, but I don’t think it would be desirable. You could always scale the radiance of your scene and use a computed spectral radiance to help scale the intensity of the other scene lights, maybe? But, I still don’t think it would result in a desirable lighting scenario for your scene (especially since, at the end of the day, the scene gets tonemapped to approximate HDR color values on most monitors).

I’ve tried fiddling around with the luminance uassets that you references, but I’m still not quite sure how to capture incoming light (very inexperienced with materials, unfortunately). How would I apply the material function that you posted in this case?

I’m amidst a huge refactor right now that prevents me from loading my build up, but I’ll show you what I mean later if someone doesn’t beat me to it.