• Create Account

## Advice for enhancing the lighting

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

12 replies to this topic

### #1angelmu88  Members

228
Like
0Likes
Like

Posted 23 April 2012 - 05:58 AM

Hi everyone!
I need some advice on my illumination. I’m making a graphic engine for a school project, after some tedious work with shadow maps I’d like to finish the lighting part. I’m not happy with the overall lighting results. To me, illumination seems very “artificial”, specially at night.
Here you are some pictures:
Day
http://img341.imageshack.us/img341/1144/imageday.jpg
Night
http://img18.imageshack.us/img18/4765/imagenight.jpg

I have no time for programming a global approximation like SSAO, I know this is a big limitation, but I’ve been thinking of a color correction post effect or maybe tweaking the “ambient+diffuse+specular” addition.
If you look at the pictures I’m using:
A directional light for the sun and the moon, with a (1.0f,1.0f,1.0f) color for the sun and a (0.3 0.3 0.4) color for the moon [darker and bluish]. Ambiental component also changes depending on the time of the day (a little bit darker at night). I’m using only ambient and diffuse component for most of the terrain. Anyway for those objects that use specular component, neither diffuse nor specular component are weighted, I mean I’m adding (difuse*texture + specular, instead of diffuse*testure*0.8 + specular*0.2).
Could you give me some advice for enhancing the result?
Here are some pictures of what I would like to get (of course I want something similar I know many of these games use some global illumination algorithm for ambient component calculation):
Night:
Visage half life 2 mod (it uses color correction for that eerie aspect):
http://media.moddb.com/cache/images/mods/1/15/14238/thumb_620x2000/hovgard3.jpg
Alan wake:
http://i0b.3djuegos.com/juegos/1023/alan_wake/fotos/analisis/alan_wake-1211281.jpg
Day:
Half life 2 lost coast:
http://tothegame.com/res/game/5099/feature/2006-09-27/screen7_large.jpg

### #2InvalidPointer  Members

1824
Like
1Likes
Like

Posted 23 April 2012 - 06:17 AM

Look into distance fog/atmospheric scattering. If you have a depth map laying around, you can do it as a postprocessing effect, otherwise you can just throw it into the end of the vertex/pixel shader.
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.

### #3angelmu88  Members

228
Like
0Likes
Like

Posted 23 April 2012 - 06:25 AM

Look into distance fog/atmospheric scattering. If you have a depth map laying around, you can do it as a postprocessing effect, otherwise you can just throw it into the end of the vertex/pixel shader.

That can be useful for distant objects like the mountains, but if you look at this scene, I still have the same problem:
http://img856.imageshack.us/img856/9140/nearscene.jpg

### #4Ashaman73  Members

13649
Like
1Likes
Like

Posted 23 April 2012 - 06:38 AM

It is not only light but although the absence of light which creates a moody atmosphere.

For outdoor scene I would always sugguest to add shadows for the primary light source(sun/moon). To increase the quality of illuminition furthermore, try to add some kind of AO(SSAO), HDR, fog, atmospheric scattering and bloom.

Ashaman

### #5angelmu88  Members

228
Like
0Likes
Like

Posted 23 April 2012 - 06:52 AM

It is not only light but although the absence of light which creates a moody atmosphere.

That's why I had thought of a color correction. With a color correction I can extract some color from the scene (like when we reduce the brightness).
Besides, I'm going to add shadows casted by sun and moon, but I thinks that's not enough. There's something in the overall color that doesn't look realistic to me.
Problem with color correction is that I haven't found a good one for my terrain.

### #6kauna  Members

2918
Like
1Likes
Like

Posted 23 April 2012 - 07:16 AM

Hi,

So where are the shadows? I get impression that you have implemented shadow mapping, but I can't see any in the screen shots. Shadows = absence of light. Even with one simple projected shadow map from the main light source may give you a huge visual improvement.

Cheers!

### #7angelmu88  Members

228
Like
0Likes
Like

Posted 23 April 2012 - 08:14 AM

Hi,

So where are the shadows? I get impression that you have implemented shadow mapping, but I can't see any in the screen shots. Shadows = absence of light. Even with one simple projected shadow map from the main light source may give you a huge visual improvement.

Cheers!

I've implemented shadows for all kind of lights except for directional (even for omnidirectional). I'm implementing cascaded shadow maps for directional light, giving the size of the terrain, but I haven't finished yet, that's why you can't see shadows in that scene (because there aren't ). I know I am a bit stubborn, but I don't think shadows are the solution. I'm tweaking the light color a bit more right now (instead of using simply (1.0f, 1.0f, 1.0f) for daylight ).

### #8Hodgman  Moderators

49386
Like
1Likes
Like

Posted 23 April 2012 - 08:51 AM

Is your ambient lighting only from a single colour? You could try using multi-directional ambeint, e.g. Half-Life uses 6 directions, so it's like a 1px cube-map for ambient lighting.
float3 ambDir1 = float3(0,1,0);

float3 ambCol1 = float3(0.1, 0.1, 0.3);//blueish ambient light from above

ambient = saturate(dot(normal, ambDir1)) * ambCol1 + ...;
Another simple ambient light is a two-colour sky/horizon:
ambient = lerp(horizonCol, skyCol, saturate(normal.y));

### #9angelmu88  Members

228
Like
0Likes
Like

Posted 23 April 2012 - 10:31 AM

Is your ambient lighting only from a single colour? You could try using multi-directional ambeint, e.g. Half-Life uses 6 directions, so it's like a 1px cube-map for ambient lighting.

float3 ambDir1 = float3(0,1,0);
float3 ambCol1 = float3(0.1, 0.1, 0.3);//blueish ambient light from above
ambient = saturate(dot(normal, ambDir1)) * ambCol1 + ...;
Another simple ambient light is a two-colour sky/horizon:
ambient = lerp(horizonCol, skyCol, saturate(normal.y));

That could be nice!
I've seen in some games or engies like in the Syrim creation kit that tey also use multi-directional ambient, but I had no idea of what was the meaning of that term.
Problem is what colour should I use for every direction? like you said I can use a blueish from above, maybe something similar to white from below? Half life maybe computes it values on the go, with a dynamic algorithm like spherical harmonics, don't you think so?
Thanks

### #10angelmu88  Members

228
Like
0Likes
Like

Posted 23 April 2012 - 10:45 AM

Is your ambient lighting only from a single colour? You could try using multi-directional ambeint, e.g. Half-Life uses 6 directions, so it's like a 1px cube-map for ambient lighting.

float3 ambDir1 = float3(0,1,0);
float3 ambCol1 = float3(0.1, 0.1, 0.3);//blueish ambient light from above
ambient = saturate(dot(normal, ambDir1)) * ambCol1 + ...;
Another simple ambient light is a two-colour sky/horizon:
ambient = lerp(horizonCol, skyCol, saturate(normal.y));

That could be nice!
I've seen in some games or engies like in the Syrim creation kit that tey also use multi-directional ambient, but I had no idea of what was the meaning of that term.
Problem is what colour should I use for every direction? like you said I can use a blueish from above, maybe something similar to white from below? Half life maybe computes it values on the go, with a dynamic algorithm like spherical harmonics, don't you think so?
Thanks

Ok, I've just taken a look at skyrim creation kit, and the six values seem to be fixed depending on four part of the day (day, night, sunset, and sunrise) maybe I can use those same values.

### #11bombshell93  Members

225
Like
1Likes
Like

Posted 23 April 2012 - 05:07 PM

without going into the code itself I can say,
the highlights aren't light enough, the shades aren't dark enough.
this is a good case of where gamma or colour correction can be used.
the trees texture is too dark in comparison to the ground (hence a lot of the artificial look)
its very important that the artist keeps highlights, midtones and shadows consistent throughout the textures (which is also why graphical artists for large 3D projects need to be flexible)

Techniques worth looking into for more accurate lighting,
Global illumination / indirect illumination (it has many other names but these are very common)
Ambient Occlusion (this is an approximation of global illumination very commonly used, the best version I've seen so far is Screen Spaced Directional Occlusion)
Gamma Correction / Colour correction (not much experience with this myself, but its fairly common to my understanding)
shadow casting (very important in getting rid of the artificial look on large open-ish landscapes such as this one)

But I'm sticking by the lack of depth in the highlights and shadows and the inconsistency of textures. They seem to be your problems, everything else I listed should be icing on the cake.

### #12Tom KQT  Members

1698
Like
1Likes
Like

Posted 24 April 2012 - 03:19 AM

My tips (most of them has been already said, but anyway):
- Shadows add a lot to the feeling.
- Ambient for outdoor scenes is much better with 2 colors (sky / ground) or at least one color but intensity depending on the normal.y value (more light for top facing polygons, less for down facing).
- Night scene would maybe look better if you desaturated (is that the right term?) the colors a bit - I mean to make it a little bit black&while (shades of gray). Plus slight bluish tone (you already have that though).
- Large areas of the terrain have the same color, maybe add another texture with some noise (large scale noise)?

### #13angelmu88  Members

228
Like
0Likes
Like

Posted 24 April 2012 - 04:03 AM

Thanks everyone for your tips!
I'm currently working on some of them.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.