Wrestling with the darkness

I’ve been working on solutions for creating ‘dark’ scenes that aren’t literally black and allow background detail but still present the feel of darkness.
Generally my solutions include desaturating colors to simulate night-vision, but it has problems when I have lit up objects in my darkness. I’ve been working on a brightness-driven desaturation filter (in Blender!) that works fairly well, but the results are…um…unrealistic? It has a tendency to look tonemapped, ie desaturated areas and colorful areas in the same image. In reality we either notice bright colors against a pitch-dark background, or we see a not so dark background but without color, like a moonlit scene, but rarely both at the same time. When switching from one to the other is when we experience that ole night-blindness problem.
This is a fundamental conundrum between how we perceive and the limitations of a display monitor’s abilities.
It’s not so bad with single images, but panoramic images seem to bring out additional issues like this one.
I’d like to know what shortcuts artists use to solve this problem, or any thoughts you might have.

BTW, I’d post images but I lack a simple place to serve them from. Any suggestions? Ideally it would not require registration, cause I hate that. :disgust:

Hi Shadowphile,
I definitely agree that lighting a scene intended to be seen from all directions can be a misery — I labor over lighting even if it is not a dark scene. Your experiments sound interesting. I’ve also fiddled with postworking, but I’m not sure that there is a perfect solution for this problem. Luckily for us, however, players are usually willing to accept the conventions imposed by the medium.

So – Have you tried making your darker scenes using one color of light? That tends to wash out the color of your objects without killing them entirely. Try placing the stronger main directional light source roughly equidistant to two weaker lights. If possible, place the lights at different heights. For instance, in a moonlit scene where your only light is the moon, make your strongest light white or gray, but then add in a navy blue and a deep violet low light to softly illuminate the objects. If you can possibly justify additional light sources in a dark scene, say inside a spaceship illuminated by moniter screens and a couple of other lights, tinting each light with a more dramatic color difference can also help the eye to pick out the volume of the shapes.

Also compounding this problem of perception for us is that even when we have a great monitor that is well calibrated, our players may not. What the player can see (or not!) even depends upon the light conditions in the room where the game is played. I understand that you hate registration, but honestly the games that begin with an option for setting your monitor to the proper brightness at the start of play may be the best answer. ::sigh::

:) Cleo

Usually, I just go with a mostly dark scene and have a window or a lamp illuminate what I need seen. Sometimes that’s not enough and I surruptiously sneak in a weak spotlight or two to illuminate certain objects a bit better. My typical “dark room” light setup is as follows:

Powerful, yellowish-white parallel light for the sun outside, coming through a window (if there is one)
Low-intensity radial light with shadows off, placed in the center of the room but slightly away from the window light source to make that side of the room darker.
Low-intensity, very violet-blue spotlight, with shadows on, to accent shadows already cast by window spotlight, same position as window spotlight.
A spotlight or two from windows, softly illuminating the floor.
A spotlight or two trained on the windows, illuminating the wall very gently around them, for a radiostiy effect.
A few spotlights and parallel lights to illuminate various objects in the scene.
A radial light for every lamp, lightbulb, etc in the scene.
A soft spotlight to illuminate the light object, be it a lamp or whatever.

Thanks guys, good to know I’m not alone on this.
@cleo: I totally agree on the monitor calibration. The only cheat I had to do on the original Myst game was because my monitor was too dark to see a trapdoor!
However, re registration, I was referring to a site to post my pics so I could link my examples into this forum. :smiley:

@jfcwilson: wow, lots of lights! Guess I’m not surprised. Rather overwhelming when one starts to plan for 50-100 nodes in a game.

I found a site to upload pictures without needing to register.
Here’s an example of my filter working as intended. The upper tent has a light source inside, the lower one doesn’t.

Here’s an example of the filter really messing things up. This shot shouldn’t have any gray tones at all. (unless I was going for a ‘look’ :wink: )

very interesting approach shadowphile, would you mind posting both images unfiltered? Just to see how the original saturation looks like.

I think I understand what you are trying to achieve, it seems to me that one solution would be , if possible, to separate the saturation based on “objects” in your 3D scene rather than applying a filter to the final image.( Is true it would be less “generic” than an filter you can apply as a batch to all the images ).

Sadly I don´t know so much about blender but may be there is a way to set object properties in a useful way or may be create a mask for certain objects or materials.

now that I stop to think…the solution I ´ve given will only work in certain cases.
The way you are working you don´t loose the subtle desaturation on softened lights and shadows…but still I don´t think using just the brightness information of the image will suffice. I tend to think that you will need some kind of mask, may be based upon the lights you are using on your 3d scene?

Here are some side-by-sides I composited.

The above pics definitely have issues.
However, I think this one worked out. The warm glow of the camp makes it look more inviting against the greyish background.

(if you think the images look too dark, your environment might be too bright.)

I think Imari might have the right idea though with a monochromatic light. Looking at the above, the gray is bothersome because it stands out as a thematic color. If I limit the desaturation to prevent pure grays, it might work out better.

Ideally I would use dedicated lights and layers to have better compositing control. (which I can do fine in Blender). But you are right, it doesn’t really address the issue because the entire content is responsible for how your eye responds, not just what the peak highs and lows are.
It’s really harder with pano-images because one direction can face a bright scene and the opposite face a dark scene. If I try to process the whole (pano) image at once, I can’t get a balance that works. If I process each scene individually, I will get glaring seams in the cubic map. A more sophisticated solution would be to create monolithic HDR pano images and tonemap them. Ugh.

I’m desperate to come up with a global solution because I chose to do an outside adventure with both day and night scenes and therefore sandboxing most of my set. I’ve created an animation in blender that pops the camera across all the nodes sequentially, shoots all six cube faces, and stores them in a directory. A small script I wrote then renames them and moves them to a the appropriate directory for the game engine to find. So far I have 26 nodes strung together across my landscape. It’s pretty slick because I can click ‘animate’ and walk away and every one of my cube faces is re-rendered. Way down the road I can jack up the quality and resolution and upgrade my assets in one swoop. (ok, more than one swoop since some nodes will need multiple renders, but I just can’t image building every node asset by hand!)

I’ll have to keep thinking about this. I still think desaturation is a key component but it will require a more sophisticated (or more manual) approach.

Ideal: a real-time pixel shader in the game engine that would simulate night-blindness. Spin from a bright view to a dark, everything would be black until a few seconds later the brightness goes up and the saturation goes down. Spin back, the bright scene would instantly blow out, then slowly drop the brightness and resaturate. Think of the cool psychological tricks you could perform! (a face in the dark slowly revealing after you click into a dark place) The filter would constantly have to monitor the FOV, evaluate overall brightness, etc, then adjust. I’m dreaming! (But it might make a cool project once the open-source code becomes available.)

Hmm, looks like it could be a material problem. I don’t use Blender for anything but modeling and exporting, but in other software I’ve used, that kind of effect is often caused by objects having a high “ambience” setting.

Rather overwhelming when one starts to plan for 50-100 nodes in a game.
Ha. The [i]demo[/i](WIP) for my game has that many. Trust me, you ain't seen nothing yet. The nightmare that is adventure developement is still to come!

a real-time pixel shader would be great! but…in the meantime…

Now that I´ve seen the original images, it seems that the light casting on the terrain is either white, so it does not affect the brown of the material, or too “warm” to simulate nighttime

As Imari I would recommend tweaking the color of the lights first so you can have a cold “light blueish” light over the ground and the mountains , this will help desaturate the red that is going on over the terrain. And then have a warmer light only for the tent. I do also prefer some color over pure gray , but of course that is an artistic decision.
Also you may try boosting the contrast of the final image, I believe it will help the effect of darkness vs lightness when your eyes move from one to the other…

Off topic : I also like to write scripts my self to automate some repetitive task :smiley: (as the matter of fact I wrote a small version of the one you describe, I will need to add some lines so it will be able to open and render several files, as our scenes are kind of big to be in just one)

Wow this thread couldn’t of been timed better, I’m battling with a interior of a 2 bedroomed house that should only have natural light, the callabration is off on my monitor so everything looks fine to me but on the wifes laptop its way to bright, on my render node laptop its to dark. I got caught out with game once that only 25% of people could actually see lol
Scary amount of lights JFC

Other techniques that might also work -

  1. adding a bit of haze or fog
  2. increasing the ambient light
  3. adding a bit of luminosity to an item
  4. postworking the image by overlaying the same image, but making the upper image partially transparent and with a burn filter

(Is it too late to chime in…? )

We’ve had to deal with this, too. There are many cases in Prominence where environmental lighting changes as a result of player actions or other in-game events. As I was reading through the thread, some thoughts came to mind, based on our production work here. In no particular order…

Shaders, Blowout and Glow
Completely agreed re: the pixel shader approach. It’ll be nice to have eventually. We prototyped some shaders for Prominence which we hoped to use to bloom bright lights, but ran into technical issues. Kevin could go into more detail, but I think it had to do with the varied levels of OpenGL implementation/drivers of all the different graphics chipsets. We shelved the idea in favor of some other features, and chose instead to shoot for a good amount of contrast in the dark scenes with just a hint of pre-rendered glow around lights (carefully positioned whenever possible to avoid creeping over cube edges).

I have an idea to bring renders back in my 3D app after initial rendering (presumably to EXR or another high-dynamic range format), map them to a cube as 100% luminous textures, apply a glow effect based on a luminosity threshold so that only the light sources trigger the glow, and then render out the resulting faces – but I haven’t gotten 'round to testing it yet, and I think it’ll only work if the glow is a true 3D calculation (as opposed to a 2D post effect).

Scene Wrangling
Not sure if it’s any help, but when an environment needed to have multiple lighting states, the organizational approach that worked for me was to have multiple light rigs, each parented to a master null named for the lighting state (e.g. “fully_lit”, “half_lit”, “dark”, etc.).

Then if a light needs to change color or intensity between states, no problem – the light can be cloned, renamed, adjusted and then assigned to the matching null. If more or fewer lights are required for a state, that’s not a problem either, since the rigs are independent – just delete (or add) what’s needed for that particular state. And if there are some lights common to all the states, they can be assigned to an “always on” null or simply left alone as part of the main scene.

With this technique, it’s pretty straightforward to look at the scene content and see what’s going on and then set the state nulls to be on or off as needed. And if, say, there are tiki torches that need to be around the camp for the “night” state, those objects (or other scene elements) can easily be worked into null-controlled states as well for easy scene management.

Darkness with Depth

[ul][li]Chiaroscuro. Endless inspiration from the masters.[/li]
[li]Create/control negative space through silhouette, rim/kick/back lighting, light wrap. These all kind of fall into the same category for me. Easy start: Put an object in front of a wall and then put a light between them.[/li]
[li]Imari mentioned fog/haze to help enhance depth, and I completely agree. It doesn’t take a lot, either – just a few percent over a good distance. Unless you’re specifically going for “epic fog”, though, it’s probably better to think of it like adding film grain; that is to say that if players notice it, it’s probably too much.[/li]
[li]Use of a cuculoris or cookie on lights to help create mood, dimension and interest. A great old theater trick that also works wonders in 3D.[/li]
[li]Volumetric lights (real or faked) can be effective, I think, but I find them much more convincing when the player is moving through the scene so that they get a sense of the footprint of where the light is landing/projecting. We have a lot of node-to-node transitions in Prominence, but I’m not sure the volumetrics would be as effective if the transitions weren’t there.[/li]
[li]I’ve read and been told that warm colors tend to come forward while cool colors tend to move back. I personally don’t see it in most cases, and it seems less convincing to me than other options. You might feel differently, though.[/li][/ul]

On the subject of color, it can be helpful to remember that lighting in 3D programs is all mathematically based on RGB values. When lights are combined, the RGB values of the lights are added. So if you take three spotlights – a 100% red spotlight, a 100% green spotlight, and a 100% blue spotlight – and shine them onto a white surface so that they overlap, the RGB values add to produce the resulting color. In the center, where all three cones overlap, the light sums to be closer and closer to white.

However, when lights encounter objects, the calculation switches to multiplication. That matters because if a channel is at (or near) zero on either the light or the object, you won’t see that color in the resulting image. For example, here is a scene with a white ground plane and a series of spheres. Looks simple enough, right?

If the light in the scene is changed to a 100% red light…

Half the spheres have turned black. Why? Because only the top 3 spheres have values above zero in the red channel. The other 3 only contain values for green and blue, and thus, when hit with a red light, the light multiplies out to zero and the surface appears black. Similarly, the 100% red light has no blue or green component, so those multiply out to zero and the ground plane appears red.

This is a pretty extreme case, of course, but hopefully it illustrates how easily a seemingly bizarre color shift can appear in a render if light colors or surface colors are strongly biased to different channels. Of course, depending on how your post-work filters are operating, similar effects can crop up there, too.

Monitors, Calibration, and Levels
I’ve found it helpful to work on a calibrated monitor and then test on as many different screens as possible (we’ve probably got about 10 or 12 monitors between the Prominence crew and internal testers). If you’re rendering assets and don’t have some testers or extra monitors, go find some. Get volunteers. Bribe friends. Strong-arm family members. You don’t want to get a good way into your game and then find out it’s unplayable on 25% of your beta testers’ screens (which I think is what Nigec was talking about as well).

Well, I think I’ve babbled enough here for one post. Hope this proves helpful to someone… and don’t even get me started on color temperature! :smiley:

Hey Mike, that was wonderful, albeit a tad eclectic :slight_smile:
Id almost suggest this deserves its own thread, but not sure what to call it…

Yeah, I got around to replying pretty late in the thread and the discussion had meandered a bit, so there’s about five or six replies to the various bits of conversation in one post. :smiley:

Reviving this issue, because I’ve just been wrestling with it and wanted to present one possible solution. In this twilight image, I have a dark purple sky with a pink haze on the horizon. The light from the sky is not tinted. It’s a medium gray to preserve the local colors of the items in the scene. The ambient light, however, is a dark, much grayed down magenta color. You can see its effects on the side of the bench and in the other highlights. My hope is to preserve the colors in the scene, yet to tie the scene to the sky with the ambient light. It’s a bit odd looking, but it’s the best compromise that I could come up with. I think that it looks like evening, but you can still see everything. The other lights in the scene are a very light warm cream color. You can see this as well on the bench.

I haven’t been following the discussion but that screen looks really nice, Imari :nod:

I’m just refreshing this thread because we have a lot of new members and it’s a vital subject.