Home Technical Talk

Question about Video Game Lighting.

JordanN
interpolator
Offline / Send Message
JordanN interpolator
How do you create contrast?

For example, see this Seal:
iZaSeKHRwehFG.jpg

If you were to break this image down into black and white, where the sun hits the surface is completely white, whereas areas occluded away from light are going to be black.

However, not all values are the same. The water for example, has a different brightness compared to the Seal and even the beach.

Now, I understand in CGI or high film VFX, contrast can be achieved in two ways:
1. Brute forcing lighting calculations
2. Post processing (via photoshop)

Since video games are tied for resources because they have to run in real time, what is the most efficient way to mimic the above?

I'm sorry if this question sounds complex. I've been doing some of my own experiments within Unreal Engine 4 and looked through samples provided by Epic.

But one problem I notice is, I don't want everything to be "lit" the same. I want there to be a range of values in my scene that can be easily distinguished from each other just like a real photo can.

Replies

  • wednesdays02
    In modern game engines you can use tone mappers as a post process after rendering. These allow you to use more realistic lighting values in your scene. Without the tone mapper your image looks completely blown out, but after applying the effect you get a realistic image with the proper contrast you'd expect.

    There are various tone mapping algorithms available depending on the hardware you're running and what effect you want to achieve. Here's a good overview: http://mynameismjp.wordpress.com/2010/04/30/a-closer-look-at-tone-mapping/
  • throttlekitty
    If you reduce color to single values per object (or regions on an object), You are still looking at the base effects of surfaces as a whole. How much light they absorb and how much they reflect back versus angle of lighting and angle of view. Water also changes perceived color from how deep it is and what's floating around in it.

    Tonal control is achieved through materials and light settings.

    Have you seen this PBR thread? There's loads of great info related to getting values for different material types.
  • rube
    Offline / Send Message
    rube polycounter lvl 17
    Everything in that photo *is 'lit' the same. The sun. The difference is in what's being lit. The water is darker than the beach, but lighter than the seal. If you're trying to recreate this in an egine without using different values of objects you're going to have a more difficult time.
  • JordanN
    Offline / Send Message
    JordanN interpolator
    Thanks for the replies!
    In modern game engines you can use tone mappers as a post process after rendering. These allow you to use more realistic lighting values in your scene. Without the tone mapper your image looks completely blown out, but after applying the effect you get a realistic image with the proper contrast you'd expect.

    There are various tone mapping algorithms available depending on the hardware you're running and what effect you want to achieve. Here's a good overview: http://mynameismjp.wordpress.com/2010/04/30/a-closer-look-at-tone-mapping/
    Yeah, tone mapping seems to be one of the better solutions for real time. Although one thing that has me worried is the amount of artistic control.

    I was reading this tutorial for creating LUT textures but the disappointing thing I learned is you can't make isolated improvements within a scene.

    So in my example of the Seal pic, you can't paint over the Seal and then make a separate paint over for the beach. You have to paint over everything.
    rube wrote: »
    Everything in that photo *is 'lit' the same. The sun. The difference is in what's being lit. The water is darker than the beach, but lighter than the seal. If you're trying to recreate this in an egine without using different values of objects you're going to have a more difficult time.
    Is there a way I can find values that that makes the water brighter than the seal? I guess my issue is accurately knowing how to stop each material from absorbing different amounts of lights.

    If you reduce color to single values per object (or regions on an object), You are still looking at the base effects of surfaces as a whole. How much light they absorb and how much they reflect back versus angle of lighting and angle of view. Water also changes perceived color from how deep it is and what's floating around in it.

    Tonal control is achieved through materials and light settings.

    Have you seen this PBR thread? There's loads of great info related to getting values for different material types.

    Yeah, I've been following all the PBR threads. PBR is very interesting because it harks upon the idea I want to work with (assigning materials their own properties in how they're affected by light making it easier to determine contrast).
  • throttlekitty
    PBR isn't really different than what we've been doing up to this point, there's just a more critical focus on recreating real-world material values than we've had in the past.

    Just curious, are you working on something stylized or realistic?
  • JordanN
    Offline / Send Message
    JordanN interpolator
    PBR isn't really different than what we've been doing up to this point, there's just a more critical focus on recreating real-world material values than we've had in the past.

    Just curious, are you working on something stylized or realistic?

    At the moment, it's all realistic.

    I'm currently inspired by this person's work. While I'm not aiming to create something 100% like his, I greatly admire how much control he has over his scene's values (and you can see I even asked him a question about his method).
  • leleuxart
    Offline / Send Message
    leleuxart polycounter lvl 12
    I think it depends on the engine and the quality of the GI, as well as the tonemapper and post-process options available. Like Koola mentioned in the thread, he made adjustments to UE4's Lightmass, which combined with the post-process volume, you can get control over almost everything you'd need: shadow color, scene color, min/max brightness for HDR, and the various levels of direct or indirect shadowing, AO, etc.

    I'd just try getting the materials right first, then base lighting(really you'd probably only need the dominant directional and maybe an environment probe), then tweak the settings I mentioned above.
  • JordanN
    Offline / Send Message
    JordanN interpolator
    On the subject of materials, I have a question I've been meaning to ask.

    According to PBR workflow, diffuse/albedo textures are suppose to have no light information. The best diffuse textures are ones that come from an overcast scenario.

    However, the other day I ran into a problem with this. I wanted to have a blue wall in UE4, so I found a photo reference of blue color during an overcast and plugged that value in. When I tried to light it, it gave me a color totatlly different to what my photo reference looked like (I wanted to make the scene sunny).

    This kind of frustrates me because I don't know where else to look for PBR values of just color. There are PBR values of wood, bricks, metal but if I wanted to just assign something a single color, I do not if what I'm using is physically correct.

    I get that there are base color values of metal but that's not enough for me.
  • EarthQuake
    This sort of lighting would generally be created with an HDR panorama image of the sky used for image based lighting, and a directional light used for the sun. You might want to remove the sun from the IBL too so you're not rendering the sun "twice". The overall lighting contrast would be controlled by varying the directional light's intensity relative to the ambient IBL.

    You can further tweak contrast etc with post, but its important to remember that post effects are not lighting. If your lighting doesn't have enough contrast, the first thing you should do is adjust the root cause. Bumping up the contrast in post will of course increase contrast for everything in the scene, not just the lighting, which may not be what you want.

    With large, static objects like buildings and things, generally you would have a baked gi/radiosity pass as well, for smaller dynamic objects like characters and other things that move around, you would generally only have the dynamic light/shadows, ambient ibl and possibly a screen space ambient occlusion pass. Though some systems like Geomeric's Enlighten do realtime gi on everything.

    When it comes to finding the correct values, there is no easy solution atm really. If you want to be really accurate, you need to take your own reference photos using a cross-polarization photography rig. Few people have access to that sort of thing, so what you'll need to do is try to find values of similar materials and extrapolate and use trial and error until it looks correct.
  • fsafsafdgdg
  • JordanN
    Offline / Send Message
    JordanN interpolator
    Just bringing this thread back because I have a better example:

    I scribbled over this photo with values that are 1:1 with an actual photo. I want to aim for this amount of precision when playing with a game engine.

    ihNppruP7zUTm.jpg

    And here are values I did for saturation

    ibbzKbD6t1NH5s.jpg

    Basically, I want full control over my scene's lightness and darkness and saturation.
Sign In or Register to comment.