Thursday, March 28, 2013

How it's done...





A look at modern day ancient Greece

The God of War series has always been known to push the boundaries of next-gen consoles, whether in terms of graphics, gameplay, or scale. This week we took a look at this gaming titan's method of cascaded shadow mapping in the third installments of this stellar franchise. But I say why don't we discuss the epic achievements of this game even further. Why don't we talk not only about the shadow mapping system but all the other graphical implementations that make this game great. This blog discusses the triumphs of God of War III as well as what makes it different from many other AAA titles that came out at about the same time. Information on this blog can be traced back to Sony Santa Monica's GDC 09 presentation of God of War III. 


Mythology meets art

Art has always been a crucial component in God of War games. Ever since the battle with the Hydra in the beginning of the first game, fans have been in love with the artistic nature of the series. Remaining true to the roots of greek mythology, the artists that have worked on God of War have put in countless man hours to place incredible attention to detail which almost seems to exceed the resolution requirements of the host platform. God of Warr III is no exception and pushed the boundaries with significant detail within both texture and geometry which surpasses that of previous games in the series. The programmable pixel shaders were a big part of the additional quality that gave assets the push they needed to be great. There is of course a cost to all of this, a drop in the framerate - yet, God of War manages the fluctuating framerate well enough to prevent a drop below 30FPS with V-sync engaged throughout the game. 

The models are created via low-poly meshes in Maya before being sent to 3D modelers for detailing, rigging and animating. It's interesting to note that the polygon count for Kratos is considerably lower than that of in-game Nathan Drake in Uncharted 2. Ken Feldman, art director on the project says, 

"We use as many polys as it takes. Off the top of my head, texture sized for these characters are quite big. I think we are using 2048s for the lower, upper body and head. Each character gets a normal, diffuse, specular, gloss (power map), ambient occlusion, and skin shader map. We also use layered textures to create more tiling, and use environment maps where needed." 





Compared to the PS2 model, Kratos is abour 4 times the polys on the PS3, as well his number of textures from 3 to 20 and the animation data would be six times as big. Blended normal mapping aids the realism of the basic model and enhances the range of animation available. This simply means that Kratos is able to believably unleash his wrath on the Gods through accurate facial and muscle movements. While all main protagonists were animated by hand, secondary characters' facial animation were mapped from those of the voice actors playing the characters. Furthermore, Dynamic Simulation was used to accurately generate more insignificant motions such as the writhing of a serpent's tail or a gorgon's hair. 

With so much impressive art, Sony Santa Monica couldn't help but show it off with their impressive camerawork which was never in the player's control and would often pan around the environment to reveal beautifully detailed landscapes. There is a range of cameras for every scene from dynamic to on-rails and combat cameras which are paired well with dynamic object traversal to create unreal animated sequences and moving platforms such as those portrayed in the beginning of the game. The following battle with Poseidon is a remarkable example of the aforementioned techniques used to make this game unique. 






Memory management

All this dynamic movement brings up the interesting question of RAM management which was an immense challenge in the production of God of War III. Not only are textures and geometry sufficiently detailed at both the micro and macro levels, but there are seamless transitions between the two which are kept in the system memory. Thousands upon thousands of polys in any single scene which change on the fly with dynamic enemy generation and all this needs to be kept in the system's RAM. You can see why this would have never worked on the PlayStation 2.

In place is a data streaming system which runs continuously in the background during gameplay. This allows for no pauses in loading and runs with no mandatory hard disk installation causing everything to be streamed from the Blu-Ray Disk to the system memory in the background. Amazingly, the executable on the Blu-Ray Disk is just 5.3MB in size including all SPU binaries, compared to the total 35GB of space the game disk uses. For the developers like Tim Moss, this is a "point of pride" because it leaves "more memory for content."




Let's talk Graphics

A core component of what makes God of War III look and feel so great comes from the setup of the framebuffer and the implementation of HDR (high-dynamic range) lighting. The game's framebuffer uses their own version of RGBM, a setup which allows for a greater range of lighting across an image while successfully maintaining detail and reducing washout. As such, God of War III allows for a massively expanded colour palette which affords the artists a higher-precision range of colours to create the unique look they feel would best suit the game. Here is another area where God of War triumphs over Uncharted in their implementation of HDR - while the latter decided to go with a LogLUV setup, the former's choice to use RGBM meant a significant saving in processing with a forfeit of some precision. 

As someone who has never been one to think too highly of motion blur, I was quite impressed when God of War III was able to use this post-processing effect in moderation to give the game an additional boost in realism. The motion blur in God of War III effectively manages to smooth some of the judder caused by the varying framerate the game employs. The manner in which Sony calculates motion blur is not just on the camera (as is the case with most games nowadays), but also on an individual object and inner object basis. This allows the motion blur to be subtle and effective in creating a cinematic look. 




The filmic look of God of War III is preserved using new anti-aliasing technology. While the game initially used the RSX chip to carry out traditional 2x multisampling anti-aliasing effect combined with a lack of high-contrast edges, an edge smoothing technique called MLAA (morphological anti-aliasing) was later employed in the game's final release. This nearly eliminates aliasing completely and turns down the sub-pixel jitter associated with the technique significantly. But this is all just one example of how developers are using the Cell CPU as a parallel graphics chip working in tandem with the RSX. 

Developers are attempting to move tasks such as post-processing typically performed by the graphics chip over to the Cell. Though this may be more computationally expensive, you get a higher-quality result at the end of the day. With that said, results can be seen in the render time for any given frame in God of War III. The MLAA algorithm takes a total of 20ms of CPU time running across 5 SPUs which causes the overall latency to be 4ms allowing more GPU time to be used for other tasks. 






All of the lights

One of the most remarkable features of the God of War III engine is dynamic lighting, with up to 50 lights per game object, and that without the use of a deferred lighting scheme. With that said, where there is light there is also shadow and the developers at Sony have strived to make their shadows as realistic as possible because they know that we gamers notice these details. Ben Diamand spent roughly three years gradually developing the deferred shadowing system used in God of War III. His system effectively eliminates artifacts associated with dynamic shadow casting and blends dynamically-generated shadows along with those pre-baked within scenery. Despite the immense accomplishment in new-age shadowing techniques, it is crucial to keep in mind that this is just one cog in the development process of the renderer. 


In Conclusion

Before God of War II was released, work on the third game had already begun with work on shading, rendering, shadowing, optimisations, SPU work, HDR implementation, tone mapping, bloom, the effects framework and tools. It just goes to show the enormity of the task associated with creating the graphical system for a game. There is enough enough refining or optimising involved before a game can be called perfect. What makes God of War III stand out is the immensely talented team that took on a great task and pushed themselves beyond the boundaries to create a game worth adding to any gamer's collection. 

It is important to note that the art is not the only thing that makes the game unique, the combination of highly-detailed characters and environments in combination with the rendering technology is what makes God of War stand out amongst other games in its league. 





No comments:

Post a Comment