Archive for the ‘Lighting’ Category

Mixed Shadowing Arts

October 27, 2010

Apparently, Mixed Martial Arts is huge at the moment, surpassing even the boxing according to some, and yes, the premise sounds great in the paper. In reality, though, matches often reduce to the lowest common denominator, and the fighters end up spending most of the time wrestling each other out against the cage, huffing and puffing. Interestingly, fever rules tend to lead to less interesting results, just like in arts in general.

So, Mixed Martial Arts as a sport is one of those cases that work better in a simulated form where there is some actual combating taking place.

However, what really makes these types of games interesting are the ultra challenging and unforgiving lighting conditions where there are supposedly hundreds of distinct lights illuminating the arena from almost every conceivable direction. And that’s a pickle.

EA Sports MMA’s offering as a solution for this classic problem can be described as peculiar, to say the least. The thing is, the opacity of the shadows in ES MMA depends on the distance they are in from the shadow-casting object, in the spirit of area shadows, but not quite. This applies to a certain height (around the knee) beyond which the gradient shadow is completely replaced with evenly blurred one. Notice the obvious threshold separating the two different types of shadows.

The shadows in ES MMA noticeably work best when the fighters are standing up, and conversely get really unnatural and weird when the action gets down on the mat, which is more apparent in motion. On a side note, the logic of how the shadow effect is rendered actually resembles a lot how z-buffer behaves.

Interestingly, prior released UFC Undisputed 2010 has a totally different approach to the same issue that is basically the scattered shadows. UFC combines couple of extra shadow maps per fighter with simple but effective ambient occlusion –effect that kicks in when ever something approaches the floor. UFC’s solution for shadows works like a charm and is far more consistent (and realistic) than the one ES MMA throws at you. A beautiful solution is beautiful.

It’s always intriguing to compare two different approaches to a given problem. ES MMA’s offering is a bit mix and match, and downright bizarre, while UFC pulls off the shadowing with flying colors, given the limitations of the current-gen console hardware. Perhaps the developer of ES MMA EA Tiburon didn’t have for some reason a decent ambient occlusion algorithm at their disposal, and thus ended up doing something rushed and unintuitive.

Either way, both games are great, at least so I have heard.

Three Green Lights

August 29, 2010

I highly doubt that the original Tom Clancy’s Splinter Cell developed by Ubisoft Montreal in 2002 was the first game to use sophisticated real-time point-light shadows, but I remember it back then being the first one in which I personally saw them in action. I was truly impressed by the shadows thinking “this is something completely new and subversive”. And those moments are the sole reason why I am (and everyone else should be) following the real-time image industry in the first place.

On that note, I find it fascinating that 8 years later I had almost the same exact experience with the newest installment of the same Splinter Cell –series, Tom Clancy’s Splinter Cell Conviction. Obviously, I’m talking about Conviction’s unique Dynamic Ambient Occlusion (DAO) system which is something I had never seen before in a real-time / video game context. And make no mistake about it; this is not a post-processing effect, like the Screen Space Ambient Occlusion (SSAO) found in Crysis and alike is, but a view-undependable, spatially genuine shadowing system, and one can only wonder how in the world Ubisoft Montreal pulled it off so neatly.

Of course, Conviction’s DAO is far from perfect and it seems to have a rather narrow sweet spot in which it performs best, due to the mainly relatively large scale of the effect. And there are some inconsistencies too, and downright errors. But still, I’d take it over SSAO anytime, anywhere.

What is the impact on performance then, you may ask? In the case of Conviction, it’s hard to tell precisely since Conviction seems to be not so well optimized as a whole. It stutters more or less with and without the DAO on my setup on which majority of the modern titles work otherwise fine. However, according to the developer, the performance hit should be somewhat equal to of SSAO, which is not a major issue.

All in all, in my opinion, it cannot be stressed enough how big of a deal Conviction’s DAO is. Indirect illumination is somewhat like the Holy Grail of real-time imagery, and this is a huge step in a right direction.

When do we see the next step?

No Shadows? Really?

August 20, 2010

The Fallout series is part of my pile of shame, excluding the (thus far) newest installment Fallout 3, and that undeniably questions my credibility as a gamer. It feels like everyone but me has played the first two Fallouts and everyone has a tale to tell about stealing kids, grotesque chain reactions, Dogmeat and so on.

Then again, what really boggles my mind is the shadowing in Fallout 3, or the lack of it. The only real-time shadows in the whole game are the ones cast by the characters, which was unacceptable even in 2008 the game was released. And not to mention there were such games as Crysis and Call of Duty 4: Modern Warfare been released a year earlier with full real-time cast shadows.

Another lighting related problem with Fallout 3 was the one that obviously stemmed from, once again, the dynamic time-of-day –lighting. It disabled the possibility for baked (non-real-time) shadows as well, so in terms of the shadows, Fallout 3 should almost be counted as a retro-game. Interestingly there is a mod that adds ambient occlusion shadows into the Fallout 3 but not basic cast shadows.

One can only speculate the reasons why Bethesda Softworks ended up with such a solution with Fallout 3, so let’s speculate.

I believe the open-world played a huge part when designing the Fallout 3 lighting solution. Obviously there’re still big problems involved when lighting massive areas with real-time shadows, one of the biggest being the absence of area shadows. And perhaps the developer simply aimed more resources towards the actual content of the game, which there are plenty of, than the technology itself. Something like decently performing real-time shadows can drain any studio’s resources in a minute, so perhaps it was about resource management from the get-go.

All in all, at the moment, the shadow-systems can be pretty unstable when applying them to unrestricted open-world environments, let alone when the lighting is a dynamic time-of-day -one. Although Crysis pulled it off pretty nicely but it was, and still is, a PC exclusive and heavy on the hardware, while Fallout 3 was a multiplatform title. On the other hand, Assassin’s Creed 2 is a multiplatform title and it has dynamic time-of-day lighting, of which shadows, however, perform in some conditions rather poorly (I bet the situation is even worse on the consoles). AC 2 has some tricks up its sleeve though, to which I come back later.

So, is Fallout 3 ugly game then? No. There’s so much going on in the geometry (even if a bit repetitive and procedural), textures, atmosphere, and architecture that the lack of shadows can be somewhat ignored.

And it’s a decent game.

Redneck Lighting

August 4, 2010

I wrote earlier about the limited options for simulating the light when using the ray-casting technique, so on that note, there were these particular lighting (or should I say “lighting”) elements in ray-casting game Redneck Rampage, which really caught my eye back in 1997. The effect was simply amazing at the time, although I had a feeling in the back of my mind that there was something fishy about the effect, but back then, I just couldn’t put my finger on it what it was. Indeed, that was because the “lighting” effect really was nothing more than a texture painted to portray the light cone hitting the surface, and thus wasn’t really a lighting simulation at all. In retrospect, one could say fittingly that the lighting effect in question was an authentic redneck solution for the problems the aging rendering technique, ray-casting, posed.

So why those particular lighting elements in RR looked so amazing at the time (at least for me), even though Quake, released a year earlier, had technically speaking way more sophisticated lighting throughout the game and not just in elements here and there? I believe it was the context. Quake wasn’t a ray-casting game anymore but a next generation title with true 3D space, so one should have expected, rightly so, more advanced lighting model from such a game.  So when you, for instance, encountered seemingly sophisticated lighting effect in a ray-casting game acknowledging the limitations graphics engine had, the experience in a way transcended the framework through which you thought you were observing the game. Technology became indistinguishable from magic for that brief moment, as late Arthur C. Clarke would put it.

It’s always about the context and expectations, as it is with life in general.

Area Shadows, Where Are You?

June 25, 2010

One feature that is pretty top on my wish list for real-time graphics is genuine area shadows. The shadows in question are results of so-called area lights which are light sources with spatial dimensions, like a sphere, a plane or a box for instance. The thing is, light sources with dimensions are so complicated to simulate in real-time that they are basically replaced with point light sources or their variant, directional light sources which behave, unfortunately, more often than not very unrealistically. Point light source’s main problem is that it always casts evenly sharp shadows no matter what the circumstances are, even though in real life, shadow’s softness increases as the distance increases between the object and the surface on which the object’s shadow is cast. Admittedly, the look of the shadow depends highly on the shape of the light source also, but still, the underlying logic remains as described.

This lack of area shadows creates all kinds of problems, which become increasingly evident the more there is distance between the shadow casting objects and the shadow receiving surfaces. That is to say, in small distances, point light sources work fine.

If you look at the left screen shot from Assassin’s Creed, the Altair’s shadow is perfectly acceptable, whereas the shadow cast by the distant wall in the background is obviously not.

Interestingly, in Crysis, there is this one particular level located in a valley in which the real-time area shadows are at least triedto simulate. It’s pretty given that laser sharp shadows cast by the hillsides would have looked rather silly, so evidently Crytek had to do something about it. The problem was, though, that they had made such a big deal out of their dynamic time-of-day lighting in Crysis that basically any static solution was ruled out from the get go. So, what they did was they used extremely (and I mean extremely) low-resolution shadow maps to mimic the softness the shadows would have had in that setting. Okay, so far so good. However, because the lighting conditions change as the sun travels in the sky, the shadows must update themselves constantly. Now we encounter the same exact problem the Assassin’s Creed II had with its shadows. That means, those particular shadows in Crysis stutter like there’s no tomorrow.

The solution Crytek came up with lighting that particular level of Crysis could almost be considered as a desperate move. They had painted themselves into the corner by dogmatic design decisions made early on (like dynamic time-of-day), and thus grabbed to whatever solution was left there. In still images the solution looks rather good, but in motion, not so much.

We are yet to see true real-time area shadows in video games, and I wonder how long it’s going to eventually take us to get there. Given the mathematical complexity of the area shadows, I’m afraid it’s going to  take a while.

UPDATE: There is some kind of emulation of area shadows included in Direct X 11 SDK dubbed as “contact hardening shadows” which is used only by STALKER: Call of Pripyat at the moment. I wonder how it performs in extreme conditions, though.

The Light Side of The Dark Forces

May 7, 2010

Back in the 1995, in the wake of the Doom-generated first-person-shooter-hype, LucasArts couldn’t help but make one themselves, Star Wars: Dark Forces that is. Doom was known for its graphical breakthroughs, including buttery smooth frame rate in majority of computers and diverse lighting, but particularly of its addicting multiplayer component, which was literally a game-changer. So, why didn’t LucasArts incorporate multiplayer on their doom-clone, while the multiplayer was the hottest thing out there at the time? One reason they gave us was they wanted to concentrate their resources solely to “excellent single player”, but I’m not buying that. I think the real reason for leaving multiplayer out was an aestethical one.

Doom and majority of its contemporaries, including SW:DF, used this technology called ray-casting which allows fast but limited 3D-space to be presented in your screen. There are two types of lighting in developers’ disposal when using this kind of ray-casting: static and dynamic, and the latter is unsurprisingly the problematic one. The dynamic lighting (or should I say shading) is realized by using something called depth cueing which darkens objects afar in order to simulate darkness (or in some cases fog) and to give certain kind of depth to the image.

However, the shading is constrained to distinct layers parallel to the screen due to the ray-casting technique and the limitations it poses.

The parallel layers can be easily spotted in SW:DF and alike and they have to do with the optimization of the performance.

When comparing SW:DF to other similar games, SW:DF seemed to have more sophisticated way to light its surroundings when firing the gun. In SW:DF the light emitted by player’s gun illuminates more realistically only the nearby surfaces, while in Doom the whole 3D space flashes evenly when using a weapon, which is rather unrealistic apporach.

The depth cueing really is, and was even then, the oldest trick in the book. Anyhow, the way SW:DF employs it, is not only to dim visibility in the distant, like it’s used in Doom or alike, but also to add brightness near when using weapons or the flash light and that’s the reason in my mind why there was no multiplayer in SW:DF. While the effect is feasible to render from the perspective of the shooter (but since the shading engine can operate only on parallel slices), it would be impossible to render in a multiplayer mode radial lighting the player 2 emits from the player 1’s point of view.

What backs up my case is that another ray-casting title 3D Realms’ Duke Nukem 3D, released a year later, didn’t have the SW:DF‘s gun lighting solution but did have a multiplayer. And so did the Shadow Warrior released year after DN3D also by 3D Realms.

Of course, there would have been plenty of workarounds for the situation, for instance they could have just ignored the effect altogether in multiplayer mode but that would have been a compromise from LucasArts’ behalf. Perhaps they hated compromises as much as I do.

Real-time graphics truly has always been about dreadful trade-offs and compromises, and I don’t see any change in that in the near (or even distant) future. In a way, those things make the real-time graphics even more exciting, since the limitations often feed creativity.


For Your Eyes Only

April 24, 2010

Simulation of human sight in video games is a tricky business. Usually it’s done with replicating features of human perception, which can be found also in a camera: motion blur, depth of field, exposure control and so on. One particular effect that is very popular at the moment, is the so-called HDR (High Dynamic Range) –effect, or “bloom” to which it is often erroneously confused. If you have played Battlefield: Bad Company 2, you know exactly what I’m talking about. In BC 2 the effect is so hideous and extreme, that I had to uninstall the game partly because of it. Furthermore, there are two other games in which the effect is almost equally unbearable but, however, don’t render the whole game unplayable: Techland’s Call of Juares 2 – Bound In Blood and Codemasters’ Operation Flashpoint: Dragon Rising. These screenshots below don’t really do “justice” for the effect, since it’s even more irritating in motion.

The effect should simulate human eye’s finite capacity to handle different volumes of light. The eye has this thing known as iris which regulates the amount of light hitting the retina in order to avoid over or under exposure. The eye is constantly adapting in new lighting conditions with little delay and this is what HDR –effect has come to simulate for.

However, it seems, that HDR –effect and post-processing effects by and large have become masking devices for graphics’ deficiencies and shortcomings, which is really sad. I can imagine how easy and tempting it is just to crank up the post-processing effects, when your game’s visual landscape doesn’t deliver otherwise. But when the effect is done right, it really is a valuable addition to the experience. In Call of Duty 4: Modern Warfare the effect is so subtle you barely notice it, but when you do, it works every time. Respectively Crysis does the HDR –effect exactly right, and the way Crysis handles all other post-processing effects should be ordered as mandatory to every developer making video games.

Final verdict is: do it, but don’t overdo it.