Sign in to follow this  

So, how does GTA IV do it?

This topic is 3291 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I just played GTA IV on a friend's XBox 360 and I must say that it's great fun (I think I'll get myself a copy of the PC version for xmas). When I was playing the game, I realized that the lighting is absolutely gorgeous (especially the sunlight) and I was wondering how they do it. I played Far Cry 2 which, just like GTA IV, features a dynamic day-and-night cycle, and while the lighting in GTA IV looks absolutely realistic, Far Cry 2's lighting looks rather artificial. So does anybody know how they do their lighting? I know Wolfgang Engel is a member of this forum, but I don't know if he's at liberty to talk about these things. Thanks!

Share this post


Link to post
Share on other sites
A slightly more helpful answer: I don't know exactly, but I assume they both use very similar shadowing methods--probably some version of split-frustum shadow mapping (cascaded shadow maps). I agree that the lighiting in FarCry2 doesnt look quite natural, but this is likely the result of other things, such as the shadow filtering method, the ambient lighting methods, the surface shaders, etc.

As far I can tell FarCry 2 has no apparent ambient lighting except a general ambient term. I dont know how this is handled in GTA.

The shadow filtering in FC2 looks bit unnatural to me, and not a great approximation of penumbra.

Overall though, the shadows in Crysis look the best, and some good documentation on that exists.

Share this post


Link to post
Share on other sites
Engel's on these forums, and as far as I know he did most of the graphics work for GTA IV. Maybe he'll notice this thread and jump in with what he can.

Share this post


Link to post
Share on other sites
From simple observation, FC2 uses cascaded shadow maps. They appear to be using a variant of stable-cascaded maps (eg, non-rotated maps). In addition, it looks like they use all available texels from the lower maps, so that the projection of each cascade is a rectangular region in world-space. You can find the splits (because they don't do any blending between them), and see the edges/corners of each cascade. I don't remember exactly what their filtering looked like, but I think it was pretty simple, probably PCF.

I won't speculate about GTAIV too much, since wolf is probably going to set the record straight. It does look like their shadow maps are using something like poisson-disk filtering (like what Crysis uses). The jittery noise in the penumbra is pretty easily reconizable.

Share this post


Link to post
Share on other sites
Thanks for the answers!

The shadows definitely play an important role in the realism of the game (although I wish they had blurred them a little like they did in Crysis).

What I'm wondering is how they did the ambient lighting. I think that's where both GTA IV and Crysis really excel and where FarCry 2 fails. I can't see any ambient occlusion in GTA IV (maybe it's there and I just don't see it), but the quality of the ambient lighting is very close to what you'd get from an offline GI solution. Very impressive stuff.

Thanks!

Share this post


Link to post
Share on other sites
I have GTA IV for the PS3 and I have to say the lighting and shadows are horrible. The shadows attempt to smooth out the edges but instead produce an ugly stippling effect. And the lighting always seems over saturated. I'll have to play it on the PC of Xbox 360 to see what you guys are talking about.

Share this post


Link to post
Share on other sites
The stipple alpha exists on the PC version too, and not just for the shadows. The LOD pops are "masked" by using a stipple alpha fade.

I think that they are using stipple alpha to avoid having to sort polygons. Could be wrong, but its the only thing that really makes sense.

The PC version leaks resources worse that you can possibly imagine right now. Might want to hold off on getting it until a patch is released, as many people with very high end systems are having issues after 10..30 minutes of gameplay.

Share this post


Link to post
Share on other sites
I need to clarify a few things here:
There is a large team of people working on the graphics in each Rockstar game. There are graphics programmers in the game team and there are graphics programmers in the core technology group who contribute to a game.

R* does not share information about what kind of graphics techniques were used in R* games. In other words I am not in a position to share any info.
I assume that one of the main reasons why people use nicknames and not their real names is the fact that they are not allowed to share company related information.

There are only a few exceptions: there will be a ShaderX7 article on Faceted Shadow Maps that you want to look into (should be available in February). It might not hurt to check out what kind of PostFX work was covered on GDC in the past to figure out how the algorithms that impact lighting were developed.

In general because the world covered is very large everything regarding lighting and shadowing is done dynamically. This should give you an idea on the limitations and challenges with GTA IV and Midnight Club Los Angeles (that had even better looking lighting :-)).


Share this post


Link to post
Share on other sites
Thanks! I half expected you couldn't reveal any details...

I don't really know what to make of "(the) PostFX work (that) was covered on GDC"... I'm assuming GDC is the Game Developers Conference, but I can't find anything from 2008. I tried archive.org but all I get the is the gdconf.com homepage. Oh well, maybe I'll never find out ;-)

Everything dynamic sounds good though.

Share this post


Link to post
Share on other sites
I'm not sure exactly what is done on ambient, but simply adding a flat value for ambient doesn't give very good results. If there is no AO, and it still looks "psudo GI" it's possible that, instead of an 'ambient' value, you use the inverse value of N.L you got from your vector light (or main scene light), and multiply that by the ambient color. That basically gives you two-sided lighting, and looks much better than just a straight ambient value.

Harry, check out: http://coretechniques.info/index_2007.html
That is what Wolf is talking about.

Share this post


Link to post
Share on other sites

This topic is 3291 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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