4 Comments

Global illumination – comparison

In my last post I talked a bit about some cheapish global illumination I was trying out. I noted how it was a very subtle effect, and not really worth the effort.

Today I tried a much much simpler form of “global illumination”: in addition to my standard ambient term, I include another directional light that faces the opposite direction as the sun light. This is a much easier effect to control. I got the idea from this article.

It’s intended to simulate the sun bouncing off objects and lighting up the opposite side of the objects. It’s roughly 0.2 times as strong as the sunlight (assuming an average scene albedo of 0.2), and kind of yellowish greenish in color (assuming average scene colors).

Here’s a few comparison screenshots. The top image in each is without any GI. The second image is the result produced by the SH-based GI I mentioned in the last post. The bottom shot is the simple “opposite the sunlight” term.

 

CompareGI_Day1 copy

 

CompareGI_Day2 copy

 

CompareGI_Night copy

 

Obviously it’s not really a fair comparison, since the effect is much stronger. I could easily reduce the strength, although I have other plans to implement some low frequency occlusion that will likely address some of that.

The sunlight bounce light doesn’t quite face opposite the sun – the vertical part of the direction vector is reduce, so it shines more horizontally. Further more, the brightness is not a simple dot product of the light vector with the surface normal (which would result in full strength facing the light, and 0 strength at 90 degrees from the light). I allow light to “wrap around” beyond the 90 degree mark a bit, simulating (I think) what would happen with other reflective surfaces of various orientations behind the object.

 

float3 SunlightBounceDirection;
float3 SunlightBounceColor;
float WrapAround;
float3 GetSunlightBounceTerm(float3 surfaceNormal)
{
	// Basically, we'll take [-Wraparound, 1] and map it to [0, 1]
	float dp = dot(surfaceNormal, SunlightBounceDirection);
	float amount = (dp + WrapAround) / (1 + WrapAround);
	return SunlightBounceColor * saturate(amount);
}

 

Advertisements

4 comments on “Global illumination – comparison

  1. Hello. I didn’t understand – what does is mean – “I include another directional light that faces the opposite direction as the sun light.” Let’s say, you have directional sun light 0, -1, 0. What is opposite direction? Vertically up? What will it give?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Space Quest Historian

Let's Play's, Podcasts, and General Adventure Game Goodness

Harebrained Schemes

Developer's blog for IceFall Games

kosmonaut games

Development blog of "Bounty Road"

Halogenica

Turn up the rez!

bitsquid: development blog

Developer's blog for IceFall Games

Game Development by Sean

Developer's blog for IceFall Games

Lost Garden

Developer's blog for IceFall Games

Memories

Developer's blog for IceFall Games

Casey's Blog

Developer's blog for IceFall Games

Blog

Developer's blog for IceFall Games

Rendering Evolution

Developer's blog for IceFall Games

Simon schreibt.

Developer's blog for IceFall Games

Dev & Techno-phage

Do Computers Dream of Electric Developper?

- Woolfe -

Developer's blog for IceFall Games

Ferrara Fabio

Game & Application Developer, 3D Animator, Composer.

Clone of Duty: Stonehenge

First Person Shooter coming soon to the XBOX 360

Low Tide Productions

Games and other artsy stuff...

BadCorporateLogo

Just another WordPress.com site

Sipty's Writing

Take a look inside the mind of a game developer.

Jonas Kyratzes

Writer, game designer, filmmaker.

%d bloggers like this: