• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
angelmu88

Advice for enhancing the lighting

12 posts in this topic

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
[url="http://img341.imageshack.us/img341/1144/imageday.jpg"]http://img341.imageshack.us/img341/1144/imageday.jpg[/url]
Night
[url="http://img18.imageshack.us/img18/4765/imagenight.jpg"]http://img18.imageshack.us/img18/4765/imagenight.jpg[/url]

I have no time for programming a global approximation like SSAO, I know this is a big limitation, but I’ve been thinking of [u]a color correction post effect[/u] 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):
[url="http://media.moddb.com/cache/images/mods/1/15/14238/thumb_620x2000/hovgard3.jpg"]http://media.moddb.com/cache/images/mods/1/15/14238/thumb_620x2000/hovgard3.jpg[/url]
Alan wake:
[url="http://i0b.3djuegos.com/juegos/1023/alan_wake/fotos/analisis/alan_wake-1211281.jpg"]http://i0b.3djuegos.com/juegos/1023/alan_wake/fotos/analisis/alan_wake-1211281.jpg[/url]
Day:
Half life 2 lost coast:
[url="http://tothegame.com/res/game/5099/feature/2006-09-27/screen7_large.jpg"]http://tothegame.com/res/game/5099/feature/2006-09-27/screen7_large.jpg[/url]
0

Share this post


Link to post
Share on other sites
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.
1

Share this post


Link to post
Share on other sites
[quote name='InvalidPointer' timestamp='1335183420' post='4934068']
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.
[/quote]

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

Share this post


Link to post
Share on other sites
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.
1

Share this post


Link to post
Share on other sites
[quote name='Ashaman73' timestamp='1335184712' post='4934073']
It is not only light but although the absence of light which creates a moody atmosphere.
[/quote]

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.
0

Share this post


Link to post
Share on other sites
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!
1

Share this post


Link to post
Share on other sites
[quote name='kauna' timestamp='1335187006' post='4934087']
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!
[/quote]

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 [img]http://public.gamedev.net//public/style_emoticons/default/wacko.png[/img] ). 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 ).
0

Share this post


Link to post
Share on other sites
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.[code]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 + ...;[/code]Another simple ambient light is a two-colour sky/horizon:[code]ambient = lerp(horizonCol, skyCol, saturate(normal.y));[/code]
1

Share this post


Link to post
Share on other sites
[quote name='Hodgman' timestamp='1335192699' post='4934110']
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.[code]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 + ...;[/code]Another simple ambient light is a two-colour sky/horizon:[code]ambient = lerp(horizonCol, skyCol, saturate(normal.y));[/code]
[/quote]

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
0

Share this post


Link to post
Share on other sites
[quote name='angelmu88' timestamp='1335198696' post='4934145']
[quote name='Hodgman' timestamp='1335192699' post='4934110']
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.[code]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 + ...;[/code]Another simple ambient light is a two-colour sky/horizon:[code]ambient = lerp(horizonCol, skyCol, saturate(normal.y));[/code]
[/quote]

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
[/quote]

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.
0

Share this post


Link to post
Share on other sites
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.
1

Share this post


Link to post
Share on other sites
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)?
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0