Username:
Password:
Remember Me?
   Lost your password?
Search



Starcraft 2 uses Deferred Rendering

Starcraft 2: Technology and engine dissected

New details about the engine Blizzard uses for Starcraft 2 are available. So for example a Shader Model 2.0 graphics card is required in order to deal with the Deferred Renderer. The developers also say to stress the graphics card more than the main processor.
Starcraft 2: Technology and engine dissected
 
[Source: view picture gallery]
Starcraft 2 has to fill the shoes of the excellent but already ten years old predecessor and the Brood War add-on. Especially the graphics of the still very popular game are rather out of date when compared to modern games and Starcraft 2 is supposed to cut in right there, but Blizzard wants to get good performance even on older systems.

Some facts from the development document first:
• Up to 500 units (Peak!) with 1 million Vertices altogether displayed at the same time (Multiplayer)
• The engine offers a gameplay and a story mode
• More than 8,000 lines of unique shader code
• Shader Model 2 graphics card (Radeon 9800/Geforce FX) required for MRT support (Multiple Render Targets)
• HDR Rendering with MRTs in 16 Bit FP format

Select picture:  Ambient Occlusion sample distribution      Full illumination      Final image     



In-game screenshot of Starcraft II (Story Mode)
 
In-game screenshot of Starcraft II (Story Mode) [Source: view picture gallery]
Starcraft 2 – Engine in Story Mode with final illumination of 50(!) light sources including the Christmas lights and the the TV screens.
 
Starcraft 2 – Engine in Story Mode with final illumination of 50(!) light sources including the Christmas lights and the the TV screens. [Source: view picture gallery]
Requirements of the RTS game Starcraft 2
In a pdf document the developers reveal a lot of details about the Starcraft 2 engine. Accordingly, Blizzard is fully aware that in a real-time strategy game like Starcraft 2, the game mechanics and the simultaneous visualization of up to 500 units cause a high basic load for the CPU. Therefore they try to primarily stress the graphics card and not the processor with visual calculation. They especially kept an eye out for the minimization of the so called Batch-Count. Those geometry groups have to be calculated by the CPU one after another and thus can slow the system down if there are too many of them.

Thus Blizzard decided to use Deferred Rendering with a Multiple Render Target approach. Thereby the illumination information for all pixels is distributed and saved to the individual RGBA channels of the four MRTs - including the pixel depth (Depth Value), Per Pixel Normal, Ambient Occlusion Term and the unlighted Diffuse and Specular material colors.

Starcraft 2: Technology and engine dissected
 
[Source: view picture gallery]


Since a lot of information for each pixel is already stored in the MRTs, it's just logical to use it for additional effects. Lighting, volumetric smoke and fog, dynamic Ambient Occlusion and Depth of Field can be generated with the Depth Values while the Normal values can be used for dynamic Ambient Occlusion (see Mouseover picture); Diffuse and Specular texture values can be utilized for illumination.

The dynamic Ambient Occlusion (which can be switched off and replaced by pre-calculated versions) requires a lot of calculations. At first it has to be evaluated how strong or weak the occlusion effect has to be. Pixels in the middle of a smooth surface get less occlusion, pixels near to an edge, in corners of virtual objects or similar things, are darkened. Additionally 8 to 32 other pixels are accessed and their Depth Value is compared to the pixel which is actually worked on. Depending on how much those surrounding pixels are above the Z value of the pixel in question they affect the created shadow effect.

Starcraft 2: Technology and engine dissected
 
[Source: view picture gallery]
In order to appear realistic, the distribution of the samples has to be as coincidental as possible. To achieve this they are created form a 2D texture with 8x8 random vectors. This operation would overstrain every texture cache of the graphics card and thus is done with a decreased Z-Buffer value.

Later on the grainy pattern is removed via a Gaussian filter to receive a smooth transition.

In Story Mode the engine additionally offers a Blur effect to emphasize the dramatic effects of the simulated image focusing. The required calculations actually need Dynamic Branching so a Shader Model 3 graphics card would be necessary. But so that those players who have one of the widespread SM 2 cards can also play Starcraft 2, Blizzard decided to take a shortcut. Four pre-blurred pictures are, based on artificially defined focus points of the camera, calculated and a blurred-sharp-blurred transition between them is calculated.

Starcraft 2: Technology and engine dissected
 
[Source: view picture gallery]


Transparency problems
Like every other Deferred Renderer, the Unreal Engine 3 or the X-Ray Engine of Stalker for example, the Starcraft 2 Engine also has fundamental problems with transparent objects. But since those transparent objects only play a minor role in Starcraft 2 and occur in rare situations only, Blizzard marked those few objects in the code so that normal "Forward” Rendering is used for them. This had been a more economic decision than developing a special render path for those objects.


Update:Starcraftwire.net informed us that they already featured an article which is, like ours, based on the AMD document. As it is written with a different focus, it offers additional information for those interested in Starcraft 2.

Picture gallery  (enlarge to view source)

--
Author: Carsten Spille (Jan 28, 2009)


You’re looking for more information related to AMD/ATI products like Phenom, Athlon and Radeon? Then please check our special AMD landing page with news, reviews and guides.




Advertisement

Comments (11)

Comments 8 to 11  Read all comments here!
pcghx_Carsten Re: Starcraft 2: Technology and engine dissected
Junior Member
29.01.2009 21:41
Quote: (Originally Posted by Unregistered)
We are just so used to bigger sites nipping our news and reposting them in slightly different shapes as their own. Being good at finding news first does that to you...

Kristoffer contacted us, and they made a small amendment to the article, and we'll do a similar thing in a news item relating to your article on our end. I hope everyone is happy with this. =)

Right, we're just experiencing the same thing you're mention, being a rather small site ourselves.

So yes, let's try and not cannibalize on the scraps of attention we're managing to get from the public, fighting ourselves and thus serving the already big players.
pcghx_Carsten Re: Starcraft 2: Technology and engine dissected
Junior Member
29.01.2009 15:55
Quote: (Originally Posted by PCGH Carsten)
Hi there,

I wrote the article and stumbled upon it reading the beyond3d forum and then visited AMDs developer site. I wasn't aware that anyone was due credits other than AMD making it avaiable and possibly the posting at Beyond3D.com.

It's rather old, yes, but as Leord already pointed out, even after reading some of the original/older articles, our approach is a bit different and hasn't been covered in this manner until now.


Damn log-in-Fail.
Anyway, here's the link where i solely read about the PDF: forum.beyond3d.com/showpo... in case you chose to call me a liar.
pcghx_Kristoffer Re: Starcraft 2: Technology and engine dissected
Administrator
29.01.2009 10:06
Quote: (Originally Posted by Unregistered)
This has been up on Starcraftwire.net for over six months now; seeing as you've reported on other articles from the Kalos Chronicles before, you are aware of the source. As to this perticular one, it was covered in www.starcraftwire.net/art...

At least you gave me credit with the other two articles, wish you had with this one.
www.pcgameshardware.com/a...

Kalos


This coincident is most unfortunate, but we did not credit you, because we created the article only on the basis of the AMD document linked in the article. As you noticed yourself, we gave you credit for the articles that are related to your works at starcraftwire and we will always do so with any source.

Best Regards,
Kristoffer

Copyright © 2012 by Computec Media AG      About/Imprint  •  Terms/Conditions