Overgrowth is an awesome indie game! We're four guys working more than full time on this until it's done. We hope you will follow our development on ModDB and on our blog! We update our blog every day: click here to subscribe.

Image RSS Feed Latest Screens
Translucent Plant Shader Initial Screenshots Initial Screenshots
Blog RSS Feed Report abuse Latest News: Gamma-correct lighting

26 comments by jeffr on Feb 3rd, 2010 digg this super bookmark


I have been trying to avoid working on graphics recently in order to work on gameplay, but there was one feature I just had to implement. It has no performance cost, and makes a big difference in how the game looks! This feature is gamma-correct lighting. You can see the new lighting on the right side of this picture.


You can see that the picture on the left has a harsher "CGI" look to it. To understand why this is, you first have to understand the 'gamma' curve. The gamma curve is used by digital displays to more efficiently encode color information for human perception. Here is a comparison between physically linear brightness (how many photons are emitted), and perceptually linear brightness (numerical differences correspond to perceived differences at any point).

Adapted from the Wikipedia gamma correction article[1]


The lighting equations used for computer graphics are all based on physics, and thus assume that brightness 1.0 emits twice as many photons as brightness 0.5. However, on a computer screen, this assumption is not correct. Until very recently, there was nothing to be done about this, so we just lived with lighting that is physically incorrect. However, modern graphics cards have tools to support gamma-correct lighting, which you can see below on the right.


This is especially important for specular highlights (shiny areas). With incorrect lighting, specular highlights usually appear blown-out and hyper-saturated. To compensate, 3D artists often make specular maps that are the opposite color of the base surface, so that they cancel out and look white. However, with gamma-correct lighting, this is unnecessary; the diffuse color doesn't bleed into the specular color in the same way. You can see this by comparing the scars in the picture below. The lighting on the right is gamma-correct.

Please ignore the glazed look in his eyes -- I will eventually add a special shader to render their surface shininess and retinal reflections.

To add gamma-correction to your game you just need to do two things -- convert textures to physically-linear space when you load them, and convert the framebuffer back to perceptually-linear space when you display it. In OpenGL you can just convert the textures with the texture_sRGB extension, and convert the framebuffer with the framebuffer_sRGB extension. These operations are free -- they use dedicated hardware, and have no performance cost.

Bonus comparison shot!


If you are interested in learning more about gamma-correct lighting, you can read NVIDIA's "The Importance of Being Linear", Naty Hoffman's "Adventures with Gamma-Correct Rendering", or Bungie's "HDR the Bungie way".

If you have the latest alpha build of Overgrowth, you can turn on gamma-correct lighting by opening the "config.txt" file in the "Data" folder, and setting "gamma_correct" and "post_effects" to true.



Track us
on ModDB (visit our page)

Please join us here too:
Facebook icon ModDB icon Steam icon Twitter icon YouTube icon

Media RSS Feed Latest Video
Downloads RSS Feed Latest Downloads
Overgrowth Spray For Source Games

Overgrowth Spray For Source Games

Jul 29, 2009 Sprays 8 comments

If you feel like promoting your favourite indie game while playing your favourite Source game. To use it: unzip the file, start your Source game, press...

Overgrowth Main Theme

Overgrowth Main Theme

Jan 14, 2009 Full Version 2 comments

Music for the upcoming sequel to Lugaru: The Rabbit's Foot.

Comments  (0 - 10 of 431)
Samuk
Samuk Feb 4 2010, 7:59am says:

I've got a rather random question.

Who's wolfires mascot?

1) Everybody's favorite deceased bunch of cylinders and spheres. Rabbot
2) The feared, Whaleman
3) Johns beard

+3 votes     reply to comment
jeffr
jeffr Feb 4 2010, 11:39am replied:

I would have to say the beard, although its days are numbered!

+3 votes     reply to comment
Av7xrocker97
Av7xrocker97 32mins 14secs ago replied:

Whaleman FTW!

+1 vote     reply to comment
MiniHendrix
MiniHendrix Feb 3 2010, 9:52pm says:

It seems that people want combat footage. Especially on the "Best Upcoming Indie Game" page.

Are you working on the combat?

+2 votes     reply to comment
jeffr
jeffr Feb 3 2010, 11:22pm replied:

John has not been shaving his beard until David gets the combat prototype integrated with the animation / ragdoll system.

His beard is quite powerful right now, but its days are numbered.

+3 votes     reply to comment
MiniHendrix
MiniHendrix Feb 3 2010, 11:44pm replied:

Only you can make that sound so epic.

+2 votes     reply to comment
GameGuy99
GameGuy99 Feb 2 2010, 7:44pm says:

wow I haven't heard of this until just now so good luck and it looks like a lot of fun!!!

+3 votes     reply to comment
jeffr
jeffr Feb 2 2010, 7:47pm replied:

Welcome!

+3 votes     reply to comment
.BloodRaven
.BloodRaven Jan 31 2010, 7:45am says:

x3

+3 votes     reply to comment
Silverfisk
Silverfisk Jan 31 2010, 7:14am replied: Online

They are aiming for co-op for starters, if they are able to implement playing against other players the limit will probably only be the users imagination. They will have a great scripting system in place.
It will not be open world, it's based on levels.

+5 votes     reply to comment
Post a Comment

Only registered members can share their thoughts. So come on! Join the community today (totally free) and do things you never thought possible.

Icon
Overgrowth
Platforms
PC, Linux, Mac
Developer & Publisher
Wolfire Games
Contact
Send Message
Official Page
Wolfire.com
Release Date
TBD
Game Watch
Track this game
Bookmark
Digg Super bookmark
Style
Genre
Adventure
Theme
Fighter
Players
Single & Multiplayer
Project
Indie
Boxshot
Boxshot
Statistics
Rank
11 of 1,468
Last Update
5 days ago
Watchers
1,443 members
Addons
1
Files
1
News
118
Features
10