Analysis of Starcraft 2 engine technology

Source: Internet
Author: User
Tags pixel coloring blizzard

Just after the conclusion of the Siggraph conference, AMD and blizzard released the official technical documents of StarCraft II on the amd official website, with the presentation of game engine technology, fans are getting more and more surprises.

Image optimization brings a test to the CPU
In terms of coloring, the use of 3D Studio Max on the basis of the use of prototype allows programmers to maximize the overall effect, and repeated refining makes the entire work as well as being carefully crafted by artists, combined with 8000 unique, non-repeated linear coloring Rendering Code To increase StarCraft II by N times compared with earlier game code.

At the early stage of game production, blizzard realized the powerful performance of GPU, so it adopted GPU-based optimization and significantly increased image quality.

With a large number of pixel rendering operations, if you choose to control hundreds of zerglings or Marines and other combat units in the game, collective operations will inevitably lead to CPU overload, even a powerful GPU is a test.
A large number of visual effects)
Including fp16 HDR, diffuse and specular for lighting, depth of field, fog volumes, and dynamic ambient occlusion) smart Displacement, and so on are the "BT" of StarCraft II.

However, as a real-time strategic game, blizzard is still working hard to set the "storyline". Under the influence of the game engine, the depth and average value of the latency buffer are, the coloring components are used to serve the effect. The use of lighting pipes and shadows also gives you the best effect of deep scenes and other special effects. However, these special effects are still under discussion.
In the early development process, the graphic engine was also designed as a key point:
Scalability first
For game engines, a major design goal is to expand the engine. Blizzard's game quality is well known, not only their capabilities, but more importantly, experience. From a series of previous game development experiences, the balance of capabilities across all races in the game is very important, and the compatibility between image effects must also be considered, this is also to ensure that the game is competitive, so that players with hardware on different platforms can experience the charm of the game, therefore, games can be easily played from ATI radeon 9800/NVIDIA geforce FXS series to ATI radeon HD 4800s and NVIDIA geforce g200s.
In contrast, the GPU load is the focus, and pixel coloring units are often unable to bear the GPU because of the emergence of a large number of units at the same time. The use of vertex coloring units must also be reasonable, the advanced GPU can experience the maximum effect, while the average GPU can only minimize the usage to ensure the smoothness of the game.
One engine, two dual nature of the engine)

This dual engine gives the game a more perfect experience. In fact, SC2 has two Visual View modes, one is an ordinary RTS view, and the other is a single player RPG view, of course, the image effects displayed in these two modes are different. There are two visual models because we have mentioned the story model. When switching to the single-player RPG perspective, players will experience the subtlety Blizzard has set for the entire game, through a series of interactions, including conversations and other means, in fact, in a sense, it is more like a first-person shooting game (FPS ).
Blizzard will also discuss these different settings in more detail so that players can experience the use of different technical effects.
Basic screen Effects
As another design goal of StarCraft II, the lighting environment mode allows more interaction in the game. Previously, in Warcraft III, each unit had a hard limitation on the brightness of each unit, it may be affected at any specific time. For this reason, the use of dynamic lighting is quite insignificant, but in StarCraft II, each unit has a lighting device. When one of them is turned on, others will turn on, which is very effective, however, the design and drawing of maps, including map terrain slicing, have become quite complicated. Even if this is solved, the GPU load is huge.
Blizzard has made many restrictions:
◆ Color components, not subject to local lighting, such as launch, environment map and color components before ignition;
◆ Depth;
◆ Normal per pixel;
◆ If static environment blocking is used, the exported environment blocking texture is ignored. If the screen space environment blocking is enabled;
◆ Colors of filled substances with lights;
◆ The color of the light mirror material.

Decoding Buffer
All buffers should use the same depth. Unfortunately, it seems that these buffers are far from meeting Blizzard's needs. These buffers push the output bandwidth in 24 bytes per pixel, in this way, the whole bandwidth is obviously insufficient. Therefore, you must sacrifice some resources when placing the light source.
In order to provide each pixel value to mrts for a variety of effects, the following are essential:
◆ Depth values include lighting, smog volumes, dynamic environment occlusion, intelligent depth of field, prediction, edge detection, and thickness measurement;
◆ The average value is dynamic environment occlusion;
◆ Diffuse and mirrored lighting.
Delayed Rendering
In StarCraft II, delayed rendering is only applicable to current rendering, including both lighting points and scattered surfaces. However, due to the fact that many lighting devices appear in the game, if such a method is used for rendering, the screen will be too slow, so the emergence of latency buffers also solves this problem. With the help of delayed rendering and coloring equations, computers can quickly draw different forms or more complex light sources, which also provides a post-processing process for other computations.
Pixel coordinate reconstruction

Thanks to the early examples, blizzard made it easier to design new shapes and colors, and released its CPU.

As we all know about the camera principle, we can use this model to make blizzard more visually understand how to design it.

Screen Space ambient light shielding
Space ambient occlusion (ssao ). If you are unfamiliar with this term, it is easy to mention the vivid Lighting Effect of crysis, which is unique in ssao technology.
Blizzard considered the effect and texture of the whole space when using this solution. Maybe from a certain aspect of writing, this is not necessary, but based on blizzard's philosophy, all Flaws are not allowed.

Take multiple samples (8 to 32) on any visible points and surfaces on the screen, these samples represent the 3D space from the current point calculations, the time and depth required to return to the expected screen space.

The purpose is to check whether the sampling points are deep. If the sampling points that are close to this distance can obtain information, this is a function problem and therefore requires complicated calculation.


However, this method is not used in map computing, just to form a space effect.
Blur Effect

All the above is to describe all the scenes in a more detailed manner. However, sometimes the game still needs some blurred graphics and images. If ssao technology is used all the time, it will inevitably lead to inaccuracy.
For ssao, although it is an advantage, intelligent judgment is also particularly important at this time. When high-precision and meticulous images are required, and when Dynamic Fuzzy effects are required, both coloring and rendering require a large amount of computing resources to show these complex effects.
Self-occlusion

This is also a very complex effect, just like generating an offset vector around a half sphere on the screen (which means a large number of latency buffers are needed ), each offset vector and normal vector are converted into one matrix to offset the vector.
Edge Processing
The offset vector is not the same in the space as in the screen space. As the lens is constantly moving, ssao is constantly changing. In this way, the edge of the lens needs to be processed during the moving process, to ensure the perfect visual effect, but it is not a simple task to handle the grain on the packaging.
Ssao Performance
The results provided by ssao are quite satisfactory. The processing of visual image quality is almost perfect, but the cost is too high. In addition, a large amount of use may still cause system performance bottlenecks, which outweighs the loss, therefore, the rational use of this technology is also one of the issues discussed.
Ssao and overall light effects
It is obvious that ssao's subtleties have been discovered, and such a realistic effect is amazing. In fact, more is the technical support behind ssao.



We can use the following process to describe all constraints:
◆ Execute a full screen for each pixel in the source image and storage and reduce the size of a CoC Image Buffer by 1/4 at each side of the alpha channel by calculating the chaotic loop results;
◆ Generate moderate fuzzy images using the RGB Gaussian Blur applied to the source image and weighted CoC for each sample;
◆ The maximum blur image generated is only 1/4 of the source image of the reduced RGB image buffer. Each COC and large blur buffer can use different channels at the same time;
◆ Weighted top fuzzy images and RGB samples are executed by reduced COC. COC is contained in the alpha channel, but the samples are not weighted;
◆ Scale down and blur a depth map into a scale-down depth image, reuse in-depth ssao scale-down (ssao non-fuzzy depth );
◆ Then start the final depth-of-field coloring, with a certain image source, medium and large fuzzy and fuzzy CoC images, non-fuzzy deep map and reduced Deep Image Rendering.



Depth of Field Rendering includes:
◇ Calculate the small Fuzzy Value and use a small sample to color the four nearest neighbor pixels;
◇ Calculate CoC pixels (reduced CoC will not match );
◇ Non-fuzzy samples: Fuzzy deep comparison-computer COC. If fuzzy depth is used, it is further deeper than non-fuzzy depth. Otherwise, COC value samples are used to blur the image of COC;
◇ Calculate contribution from every possible fuzzy image, calculate the small fuzzy color, medium and large Image Blur Based on CoC factors;
◇ Small, medium, and large fuzzy;
◇ Output the source (non-fuzzy) image of Alpha.
Processing transparent object Rendering
Transparency is an issue worth further research. When it comes to development, Blizzard's Board of Directors believes that delay rendering technology does not support transparency, it should be added elsewhere, it turns out that this is a correct choice.
As a typical problem is the delay rendering technology. The problem of transparency is also designed for a series of problems such as shade. Therefore, we must select some representative objects to mark and then discuss. The issue of light is once again mentioned in the talk about transparency, because it is a complementary thing, so blizzard is trying to find a solution when making it all.
Translucent shadow (Translucent shadows)
This technology can make smoke, explosion can also cast a shadow effect.

In the early stages of modeling, the video subsystem successfully used the screen space information to solve the tracking problem. Otherwise, it would be much more difficult, however, this blizzard will show how to extend each pixel information of the shadow map and some additional information channels, which can be used to enrich the shadow easily and implement translucent shadow support on the map.
The shadow map algorithm is used to extend the shadow information of the second map to form a translucent shadow. The shadow of most maps still contains the shadow of the opaque information, in addition, you also need to find translucent shadows in the color buffer. However, all this requires hardware support. If the hardware does not support it, there will be an empty color. Therefore, blizzard is still processing the shadow effect when considering special effects such as deep scenes.
First, clean up, reconcile with white, and then fill in the shadow of the rendered transparent object. In this way, a transparent shadow color buffer is formed. In addition, a test is added to process these transparent light filters, finally, the desired effect is formed.
Optical Filtering Processor

Summary:
From the brief official technical document above (because amd only releases this part), we can now learn about Blizzard's efforts and contributions in the SC2 game, i'm afraid the effect is amazing. As a masterpiece of Blizzard's more than a decade of history, StarCraft II contains the most advanced technologies and effects. Whether Blizzard's quality or technology is believed to be at the top of the world, such a game company is indeed striving for its own work! However, the waiting time remains a mystery.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.