Home Technical Talk

Achieving Realistic Look

Hello,


http://www.speedhunters.com/wp-content/uploads/2015/07/LOOKDEV-SHOT-1200x800.jpg

If there's anyone who has done such realistic scenes (for games) I've got a question.

What is the lighting pipeline? You first give sun intensity a value and then adjust the brightness of the surfaces to meet the reference picture or the other way around? or any other way?

Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    You can use post process effects such as color balance, exposure, brightness, contrast etc. Also you can adjust IBL settings. This is one and actually common way for fine tuning the final image. Once you got close to the look, you can adjust it further with these.
  • Drew++
    Options
    Offline / Send Message
    Drew++ polycounter lvl 14
    They were able to get such a photo-realistic look because they balanced and calibrated the reference photo with a Macbeth chart(that thing with many colored squares). So it's easy to color correct both images later on so they match each other.

    Besides Frostbite having physically based materials they also have physically based lights and cameras(according to their Moving Frostbite to PBR publication).

    The cameras have a physically based settings for exposure, aperture, shutter speed, and ISO. Bloom is also important to the look.

    The lighting is defined by units such as Luminous power(lm), Luminous intensity/Candela(cd), Luminance(cd/m2 or EV), and Illuminance(lux).

    Different lights use different values. Punctual(lm), Photometric(cd), Area lights(lm), Emmisive(cd/m2), and Sun(lux). You choose light color for these with Color Temperature, but you can also pick the lights RGB color(hue), but the hue is separate from the intensity. IES profiles are supported too. Most light bulb manufactures list the lights color temperature, so it can be easy to match.

    Lots of cool stuff in that publication! Give it a look! I'm sure it's more artist friendly in their editor, than the way that I explained it. I'm sure not all lights are setup to be physically based too. :)

    Hope this helps!
  • Maximum-Dev
    Options
    Offline / Send Message
    Thanks guys,
    Drew++ wrote: »
    they balanced and calibrated the reference photo with a Macbeth chart(that thing with many colored squares). So it's easy to color correct both images later on so they match each other.

    That's actually my question, I have a little problem understanding that pipeline because I've never worked with a ColorChecker like that.

    If I want to do the same thing I'd have to put a ColorChecker in the real life scene and take a picture and "balance it and calibrate it" (what's that process?) and then what?
  • leleuxart
    Options
    Offline / Send Message
    leleuxart polycounter lvl 10
    Check out this video for Eat3D. It goes over color-calibrating with a color chart in Lightroom. Once your photo is calibrated properly, you can base your render/screenshot off of that and tweak the values to get something close to the photo.

    And to add on what Drew said, a lot of engines are switching over to more physically-plausible elements, not just shading for materials. Unreal 4 supports Kelvin temperature colors for all lights, while CryEngine just recently added Lux for the sunlight, as well as the EV HDR controls, which simplifies the exposure tweaking a lot. Both engines use inverse-square falloff for the light emitters as well. You can also measure total scene luminance in both engines to get close to accurate overall lighting conditions, before eye adaptation and tonemapper adjustments.
  • Maximum-Dev
    Options
    Offline / Send Message
    Thanks for the reply.

    I asked that once on the UE4 forums but didn't get a reply. How do you measure the total scene luminance in UE4?

    Also, for textures that are not shot with a color checker is there any workflow to create that consistency between them? something acceptable, if not accurate.

    Directional light in UE4 does not support Lux which is the lighting unit for Sun (also as in Frostbite). How do you find the right values in UE4?
  • leleuxart
    Options
    Offline / Send Message
    leleuxart polycounter lvl 10
    Thanks for the reply.

    I asked that once on the UE4 forums but didn't get a reply. How do you measure the total scene luminance in UE4?

    Also, for textures that are not shot with a color checker is there any workflow to create that consistency between them? something acceptable, if not accurate.

    Directional light in UE4 does not support Lux which is the lighting unit for Sun (also as in Frostbite). How do you find the right values in UE4?


    There's a visualizer for the viewport. ShowFlag.VisualizeHDR 1 In the middle of the screen, it'll show LRGB values. You can essentially follow Crytek's method for determining luminance values, although some values for either engine just won't work. Either way, taking a general Lux value for the sunlight during a specific condition and converting it to candela per square meter(or centimeter, depending on the value) and matching that in-engine seems to give reasonable results. From there you just tweak the HDR values as needed. It might not be 100% accurate, but it's definitely a start.

    Correct, the light in UE doesn't support Lux, but it does support Kelvin. In order to get the RGB value of a color, you can use it's Kelvin(or there's sites out there that convert it for you) and then the Luminance trick to get the intensity right.

    As far as the textures go, that's not something I have experience with. I don't have a nice enough camera to get textures from, so I haven't been able to test the workflow out. But if you know they're taken from the same lighting condition, you may be able to get an average luminance across all of them? Or some sort of average black/white balance between them all.

    One other thing, I know the point lights in Unreal use the Intensity as Lumens. I don't think the Directional Light's Intensity is tied to any unit though.
  • Maximum-Dev
    Options
    Offline / Send Message
    Thanks for the time. :)

    So as far as I look everywhere, yes Directional Light doesn't have any units it's only a multiplier so converting Lux to Lumens doesn't really help. :(

    When setting the directional light intensity at 20 which is pretty high, and looking at a white surface like that my LRGB is 006.375 (not sure what to do with this value).


    I think the best thing I can do is to fill a document with mid grey value in MS-Paint and print it, take it to the window when it's direct sun light and then in engine also apply a mid grey color to a flat surface and adjust the light intensity to kinda match that print I have placed at the window under sun light. Seems to be doable haha.
  • leleuxart
    Options
    Offline / Send Message
    leleuxart polycounter lvl 10
    That number is the average luminance of the scene, which is the "intensity of light being emitted from a surface." Using a pure white, no specular material on a plane perpendicular to the light direction helps get the brightest value from the scene, which is what we're basing all of this on. Make sure you have all other lights, reflection actors, skylights off, as well post-process effects like bloom off.

    **I've gotten numerous messages regarding this workflow and while it has provided useful starting points for me, it's not 100% accurate for the current state of Unreal or CryEngine. Unfortunately, the site that allowed me to convert Lux to Luminance(without taking the space of the area into account) has been down for months and I don't know of a similar site. I haven't been able to test this any more, but I'll leave my values and information here. It's worth looking into more, as other proprietary engines are also using physical models for lights**

    In my case for the sunny one, I took Crytek's LUX value(which is similar to other sources I've seen) of 100,000. I took that number and converted it to Luminance/ candela per square centimeter(cd/cm2), which comes out to 3.18. I also took the general Kelvin temperature of the light source at the setting, which is around 9000k(for the sky temperature of a clear sky day, not necessarily of the sun). In Unreal, you can just put that in, but in CryEngine you could use RGB of 210, 223, 255. Once you have the temperature and an idea of the luminance, you adjust the intensity until you reach the desired value in the visualizer.

    MsNqNjHjpg

    And the overcast one. LUX of 15,000 converted to 0.48 cd/cm2. Kelvin temperature of 6500(most sites list 6500-7500) and a light intensity of 1.2 in the editor.

    Losb2PFjpg

    Obviously they could both use some tweaks to further emphasize the lighting condition, but this is bare lighting only.
  • Maximum-Dev
    Options
    Offline / Send Message
    Thanks a bunch!

    As a practice I tried to do the same thing as your direct sunlight scene, but it ended up looking very different than yours. Bloom and ToneMapper are off. Eye Adaption min/max set to 1 and bias to 0.

    12_915.jpg

    What I did was to use ShowFlat.VisualizeHDR 1 and look at the LRGB on the white surface and adjust the sunlight intensity until the LRGB is close to that 003.180 you mentioned.
    Did I misunderstand something?
  • LaurentiuN
    Options
    Offline / Send Message
    LaurentiuN interpolator
    I think this thread becomes awesome, gj guys, still learning from you.:D
  • leleuxart
    Options
    Offline / Send Message
    leleuxart polycounter lvl 10
    No, it seems like you're pretty close. :) There are a couple of things I'd check though. Make sure your white material has no spec, metalness, or roughness and is completely flat. I just tested the visualizer to see if it makes a difference and it doesn't seem that way, however it doesn't hurt. The visualizer is weird on what affects it and what doesn't compared to the CryEngine one, so I'm still figuring it out. However, one thing that does affect it and could be the issue in your case, is the angle of the plane you're measuring Luminance from. Is your sun directly overhead or is it at a slight angle? The plane should be perpendicular to the direction of the light, so it's at an angle that casts the largest shadow. Just pull it up from the floor a bit, make it thinner, and rotate it around until the shadow is the biggest you can get. Also when you're measuring the luminance, make sure you're viewing it directly and have it fill up as much as the screen as possible.
  • Maximum-Dev
    Options
    Offline / Send Message
    Hehe thanks. :)
    Yeah the material is setup as you said and the sun is like a 90 degree, directly shining from above however for the sake of screenshot I slightly rotated it to make it cast shadow like your own test. Two things are very odd, first your scene is warmer and mine is much cooler, second my scene looks more like yours when I turn on the ToneMapper not sure why since you mentioned yours is off too. I made a feature request on the UE4 forums but seems like they are not even considering to implement physically based units for lights. :(
  • leleuxart
    Options
    Offline / Send Message
    leleuxart polycounter lvl 10
    Hmm, well I'll try to recreate it during my lunch with the settings you listed and see what's up. :thumbup:
  • Maximum-Dev
    Options
    Offline / Send Message
    And new screens are released.

    image.img_.jpg

    If you don't look at the car at all, the floor alone is looking really real. Not sure what's the magic. :poly122:
  • Maximum-Dev
    Options
    Offline / Send Message
    leleuxart wrote: »
    Hmm, well I'll try to recreate it during my lunch with the settings you listed and see what's up. :thumbup:

    Found out something that might be the issue. When you disable ToneMapper, bloom etc. via the UI and not the ShowFlag commands then when you hit G to hide the labels and take screenshot, pressing G toggles the last thing you have turned off/on. I think when you wanted to take the screen your ToneMapper toggled on with hitting G.

    The ToneMapper itself washes out the colors and turns the whites into grey. :poly127:
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    The ToneMapper itself washes out the colors and turns the whites into grey. :poly127:

    Did you look into the pos-process volume settings ? Some default settings might not suit your comparisons. There are some settings related to shadows and highlights that you might want to disable or set to 0.
  • Maximum-Dev
    Options
    Offline / Send Message
    Froyok wrote: »
    Did you look into the pos-process volume settings ? Some default settings might not suit your comparisons. There are some settings related to shadows and highlights that you might want to disable or set to 0.

    Hey, good to have you in here as well. :)
    Yeah I totally forgot about those stuff, there are two major options, dynamic range and the other one I just forgot that affect the luminance range a lot. Thank's a TON for mentioning. :)
  • leleuxart
    Options
    Offline / Send Message
    leleuxart polycounter lvl 10
    You might be right. I think I might have had it toggled in the viewport, but it was still active in the post-process volume, therefore turning it back in when I go into game mode. I thought I disabled the entire volume, but maybe not...

    I've been really busy at work this week/weekend, but I should have a few hours tonight that I can take another look. Unfortunately, it looks like the visualizer doesn't disable other effects that can alter the luminance. It's probably not a big deal, it'll just take some experimenting to see what actually affects it.
  • leleuxart
    Options
    Offline / Send Message
    leleuxart polycounter lvl 10
    Okay, just after some more testing, I've found out a few things.

    ~ Reflection actors, bloom, eye adaption, and the tonemapper don't affect the Luminance while in the HDR Visualizer. I personally prefer to work without bloom and eye adaptation until the final tweaks, however.

    ~ Skylights do, however.

    ~ Adjusting light intensity to match luminance with the skylight off, and on, gives little to no change. Light intensity changed from 16(without skylight) to 15.3(with skylight), so nothing extravagant.

    ~ The angle of the testing plane can change the Luminance quite a lot even with just a few degrees off. This is a no brainer, but I tested it just to see how much. It might be why our results were different. It may be more accurate to test Luminance with a plane facing up and the light facing down at 0,-90,0 before you get it in position. 
  • codyaq2
    Options
    Offline / Send Message
    codyaq2 greentooth
    So tonemapper should be on when playing around with exposure/hdr settings?
  • Maximum-Dev
    Options
    Offline / Send Message
    @leleuxart, Thanks for the information. :)

    @codyaq2, Definitely. Otherwise you don't see the effect when you are changing the HDR settings.
  • Heisenberg63
    Options
    Offline / Send Message
    leleuxart said:
    That number is the average luminance of the scene, which is the "intensity of light being emitted from a surface." Using a pure white, no specular material on a plane perpendicular to the light direction helps get the brightest value from the scene, which is what we're basing all of this on. Make sure you have all other lights, reflection actors, skylights off, as well as the tonemapper, bloom, and eye adaptation.

    I did 2 quick tests for a bright, direct light day and an overcast day.

    In my case for the sunny one, I took Crytek's LUX value(which is similar to everyone else's on other sites) of 100,000. I took that number and converted it to Luminance per square centimeter(cd/cm2), which comes out to 3.18. I also took the general Kelvin temperature of the light source at the setting, which is around 9000k. In Unreal, you can just put that in, but in CryEngine you could use RGB of 210, 223, 255. Once you have the temperature in and an idea of the luminance, you adjust the intensity until you reach the desired luminance.

    Here's the direct light one without bloom, tonemapper, or eye adaptation. Only the dominant light and the skylight.

    MsNqNjH.jpg


    And the overcast one

    LUX of 15,000 converted to 0.48 cd/cm2. Kelvin temperature of 6500(most sites list 6500-7500) and a light intensity of 1.2 in the editor.

    Losb2PF.jpg


    Obviously they could both use some tweaks to further emphasize the lighting condition, but this is bare lighting only.


    I hope this helps you a little more
    Can you tell me why did you use 9000K for sunny day, when right value is 5000-5400K
  • leleuxart
    Options
    Offline / Send Message
    leleuxart polycounter lvl 10
    leleuxart said:
    ...
    Can you tell me why did you use 9000K for sunny day, when right value is 5000-5400K
    I went with 9000 as anything above it is generally considered to be the temperature of clear, blue skies. Opted for that over the average sun temperature because I was targeting a bright, clear sky. However, I still don't consider anything in that post to be 100% accurate. The site that I used to convert Lux to cd/cm2 has been down for months and so far it's the only one that lets you convert without taking the actual space into account. So that alone most likely means that the conversion isn't accurate either. However in testing and small production scenes, the results were great starting points and took a lot of the guesswork out of color and brightness. 

    I'll be editing that post to clarify this, since I've gotten a few messages regarding it. Unfortunately I haven't done any more researching regarding conversions and can't provide any other sources at the moment for converting values.
Sign In or Register to comment.