"Sonic World Adventure" Graphics Course for Zenji Nishikawa's 3D Game Fans -GAME Watch

"Sonic World Adventure" and "Hedgehog Engine" logos

■ Graphic specs of "Sonic World Adventure" -Sonic is now a 18,000 polygon character!

[Sonic's close-up shot and its wireframe shot]
[Close-up shots of enemy characters and their wireframe shots]

[Actual play scene and wireframe shot]
Mr. Yoshihisa Hashimoto, Game Director, SEGA Co., Ltd., 2nd CS Research and Development Department, 1st Program Section
SEGA Co., Ltd. 2nd CS Research and Development Department 1st Program Section Programmer Akifumi Ogino

Mr. Hashimoto "I haven't done almost anything about LOD, because in the case of" Sonic WA ", the load on the geometry side was hardly a problem. We prepared multi-polygon and low-polygon models for LOD. I was only preparing to do it, but considering cost effectiveness, I decided not to implement it because it would be unnecessary. It is LOD-like and only the texture mipmap was implemented in "Sonic WA" Is it? "

Mr. Ogino "Since the PS3 version also used Playstation Edge, I was not worried about the geomery performance. In the case of PS3, the main memory capacity is tight, so it was possible that the low polygon model would occupy the memory with the introduction of LOD. So I'm glad I didn't have to introduce it as a result (laughs). "

[HAVOK 5]
HAVOK Physics is mainly used for collision detection between dynamic characters and behavior control such as scattering of debris when destroyed.
HAVOK Animation is used for IK processing of attitude control when interacting with the character and background.

■ Pixar CG movie ambient feeling into game graphics

The statement "Aiming for Pixar Touch with 3D game graphics" is sometimes heard. The visual of VALVE's "TEAM FORTRESS 2" was also devised and introduced with a unique lighting technique to reproduce Pixar Touch.

Mr. Hashimoto "I think that the game graphics of this generation have become very shader-rich, but if parallel light sources (light sources that fall on the entire scene such as sunlight) and point light sources (light sources that locally illuminate all directions) hit directly. I started to think that the fact that the shadows of the missing parts were omitted might be "unsatisfactory". After that, the work of Pixar, who is famous as a feature-length CG movie production studio. We set out to develop real-time GI with the goal of reproducing the atmosphere of the group. "

An example of global illumination in the real world. The only light source in reality is the fluorescent light on the ceiling of the office, but the light reflects off the red file, which illuminates the white hedgehog paper doll as a secondary light source.Global illumination is simply a lighting event such as indirect lighting or mutual reflection. An example of global illumination reproduced in CG.The actual light source is a scene with only ceiling lighting, but the light is reflected on the left and right red and blue walls, and these become secondary light sources and illuminate the objects in the room with pale red and blue light. I understand

■ "Sonic WA" GI Technique (1) -GI for Static Objects

[GI texture]
A special shot showing only the GI texture. If you look closely, you should see something like spots.This is the calculation unit of GI texture
[GI Texture Part 2]
First, the formation of an optical network is performed.
[GI Texture Part 3]
Since the texel size of the image texture and the size of the GI texel are different, it is necessary to calculate the average value, but "Sonic WA" omits this calculation. "Sonic WA" adopts the color of the representative texel of the image texture that overlaps with the center of the GI texel.There are three types of light sources: parallel light source, point light source, and celestial sphere light.The image of actually arranging all the light sources in the scene and letting the light flow through the above-mentioned light transmission network.
(4) is calculated by "total amount of light" x "reflectance for each material" x "coefficient" ÷ "number of GI texels connected to this texel"
SEGA Co., Ltd., 2nd CS Research and Development Department, 1st Program Section Programmer Hiroshi Iwasaki

Mr. Iwasaki "The calculation unit of the GI texture can be set variable, but it's about 2 cm to 3 cm on each side. The daytime scene is not so noticeable, but the nighttime scene is the GI that the lighting such as street lights exerts. However, I was careful about the adjustment because it came out in an easy-to-understand manner. "

西川善司の3Dゲームファンのための「ソニック・ワールド・アドベンチャー」グラフィックス講座 -GAME Watch

Mr. Hashimoto "It took two days to calculate for a terrain of 500m x 500m with one PC. The completed GI texture is about 100MB. There are places where there is about 15km per stage, so a simple estimate I found that the GI texture size increased from several hundred MB to about 1 GB, and the calculation time was several months (laughs). This is not good, so the tool for generating GI textures is used for distributed computing. I made it correspond. "

[GI Texture 4]
Example of generated GI texture

Mr. Hashimoto: "We expanded dozens of PCs in the department for this distributed computing for GI texture calculation. Then we ran out of power, and when we turned on some equipment, we had a breaker at work. Has come to fall (laughs). In the end, I ended up having to do power boosting work. "

MI-TRACER screen

Mr. Iwasaki "Instead, the BGM and sounds in the game are on-memory. I have given a capacity limit to the sound, but I still allocated about 40MB, so the BGM and sounds used in one stage That's enough. Sonic runs at speeds of 100m / s or more, so I was worried whether it would be possible to read the GI texture in time, but when I designed the streaming reading of the GI texture so that it would be in time for the calculation on the desk, the result was There was no problem. "

[GI Texture Part 5]
GI texture only Only normal lighting without GI (many common game screens look like this) Completed shot with GI added
[GI Texture 6]
A screen that visualizes the mipmap level of the GI texture by color coding
[Difference in GI texture quality]
The upper row is the release version of GI texture quality, and the lower row is the DLC version of GI texture quality.

■ GI technique of "Sonic WA" (2) -GI for dynamic characters

Conceptual diagram of hemispherical lighting

Mr. Hashimoto "We have considered various things, but we decided to introduce a concept that is one step ahead of hemispherical writing. We used a technique called" light field "in the team to create a two-way environment for hemispherical writing. Ambient light from more directions than light is automatically calculated and placed in space. "

[Light field]
No light field (general game graphics look like this)
Screen displaying only the light field
Completed shot after applying light field
[Schematic diagram of light field]
Schematic diagram of the light field.In this figure, the ambient light set is just ●, but each ● is an image that emits light in eight directions.
Lightfield of "Sonic WA" which is similar to the concept of Valve's environmental cube

Mr. Hashimoto "In" Sonic WA ", each point in the light field has eight directions of ambient light as data, but due to the constant specifications of the pixel shader, there are six orthogonal directions of x, y, and z. In the case of straddling eight light field ambient lights, we sample multiple light fields in the immediate vicinity and calculate the weighted average for the subsequent lighting. "

Mr. Iwasaki "After generating a GI texture for a background or prop / prop object, the light field value is also calculated based on the scene to which the GI texture is applied. The light field spacing also depends on the scene. However, it is basically 2m to 3m, and there may be a little more detail if it is near a building with many objects. However, if there is little change between adjacent light fields, combine them into one. The distance between each light field is actually variable because it has been processed. "

[Light field section map]
A screen that visualizes the section of the light field.Can you see that the light fields are set at different intervals?
Conceptual diagram of GI Rim Light (Light Field Rim Light)

Mr. Hashimoto "Actually, depending on the material, the light field refers not only to the light field in the normal direction but also to the light field in the reflection vector direction opposite to the line-of-sight vector. By doing this, the ambient light on the other side penetrates. You can create a subtle shade effect that seems to be overflowing here as well. "

[GI Rim Light]
No rim light GI rim light onlyCompletion screen

Mr. Iwasaki "I also considered a plan to implement this light field using spherical harmonics (SH), but it doesn't make much sense when considering the balance between the memory capacity used and the effect obtained. I understand that I haven't adopted it. It seems that an implementation with 8-direction ambient light like our implementation can obtain sufficient quality without using SH. "

[Completion scene]
The background is only GI textureSonic is in light field only
Static shadows on GI texturesCompletion screen
[Lightfield demo]
Static shadow of GI texture → GI texture only → GI texture + normal lighting (no light field) → Apply light field → Repeat demo video

■ HDR rendering technique in "Sonic WA"

Mr. Iwasaki "HDR rendering of" Sonic WA "is an 8-bit integer 32-bit buffer specification of integer 8888, which is common to Xbox 360 and PS3. It is a so-called pseudo HDR rendering that assigns 0.0-2.0 to 0-255. I tried using FP16-64 bit at the beginning, but it was so tight in terms of performance that I made it to the current specifications. "

[HDR rendering expression]
The upper row is HDR rendering expression off, and the lower row is HDR rendering expression on.

Mr. Hashimoto "In the case of" Sonic WA ", the maximum brightness of 2.0 was sufficient because there were no scenes that were shaken with such high brightness. The reason why the Mach band is not noticeable is that there are few objects with a very flat surface expression. Is it because of it? "

[Tone mapping]
From bright to dark, and from dark to bright.Pay attention to the effect of tone mapping

Mr. Hashimoto "There are various reasons for this to make it easier to play, and for directing to show the scene firmly, but adjustments are still necessary. In the first place, the texture drawn by the designer is at the time of design. It is colored with an appropriate color, but it may not be the appropriate color under certain circumstances in terms of gradation level. "

[Post-process effect]
In the night scene, the post-process effect unique to HDR rendering such as Bloom and Star is easy to understand. Also pay attention to that when playing the game!

■ The secret of the fur of Sonic "Wearhog" at night

Mr. Iwasaki "The number of layers of fur is about 15 layers. At the time of development, the designer was able to adjust the number of layers and the density of hair. Shell polygons for applying fur are dynamically generated on the engine side. Since it is a mechanism, the character in the modeling stage does not have a multi-layered outer skin polygon. The number of layers is changed between the event scene and the game, and in the event scene it is often an up shot of the character, so the number of layers is increased. increase"

[Fur shader]
Example of hair cross-section textureHairless wear hog at the authoring stage
Hairless wear hog that appeared on the debug screenWear hog with hair applied
[Fur shader
From the NVIDIA demo.Hairless modelShell type fur shader only
Hair implanted by hair finsFinal shot

Mr. Iwasaki "We also tried putting hair fins in the development stage, but the wear hog of" Sonic WA "has not so much lack of hair density due to the large number of layers of shell type fur. So I stopped hiring. "

[Fur shader part 3]
Pay attention to the fur of the wear hog.The backcombing is due to the ingenuity of the fur shader.

Mr. Hashimoto "In addition to this, we are doing shading treatment so that specular appears in the direction of the hair tips, and by saying that the inner lower shell is shielded around, the hair tips are bright and the roots are darker. I think that the fur of "Sonic WA" went well, but there was a problem and when I was blurred with the expression of depth of field, my hair was blurred. It's a bit unnatural, isn't it? This is the weakness of the shell-type fur shader, or the future issue to be solved. "

[Depth of field effect]
The left is the depth of field effect off. You can see the fur. The depth of field effect is on on the right.The fur is blurred along with the background

■ Shadow generation in "Sonic WA"

[Shadow expression in "Sonic WA"]
Shadow representation in "Sonic WA" is a hybrid technique of dynamically generated shadows and pre-generated static shadows.
[Shadow generation]
Shadow as GI texture (left) and completed screen (right)
[Shadow generation 2]
A scene that is within the shadow range of the GI texture and the shadow of the background is projected on the dynamic character.
[Demonstration of shadow generation]
Specifically, the shadow of Sonic and the shadow of the tree falling on Sonic are dynamically generated. The shadow of the tree falling on the ground is statically generated by the GI texture. It's usually indistinguishable when you look at it. well done.Speaking of greed, I wish I had a little more static shadow
[Shadow generation 3]
From the upper left, GI texture pre-generated shadows only, LSPSM shadows only, test shots when all shadows are generated by LSPSM (this is not adopted in the product version), GI texture pre-generated shadows and LSPSM Completion screen that synthesizes the shadow of

Mr. Iwasaki "Even if all the shadows of static objects are drawn, they will match the shadows on the GI texture, but they will not match. However, for example, the shadow of a tree falling on the ground Players will not care if the shadows of the trees projected on the sonic match, and the shadow map generation of static objects is also narrow to the extent that dynamic characters will intersect. I'm done. "

Mr. Hashimoto "By the way, the shadow around the root of Sonic's pointed back hair is a correction of the shadow burned in 3ds MAX. The shadow that is very local and clear is also burned with an emphasis on appearance. There is. "

[Shadow generation 4]
The upper row is in the original state.The lower part is the local shadow burned in the authoring stage.

■ Other highlights of "Sonic WA" graphics

Half Lambert Lighting developed by Valve
[Half Lambert Writing]
The left is a test shot of normal Lambert writing. The shadows are too dark and the color of human skin is dark and unnatural.The screen on the right is the half Lambert lighting used in the product version.
[Camera light]
The upper row is the camera light off. The lower row is the camera light on. Highlights appear on the wall and floor normal maps to make them look more three-dimensional.It has an effect similar to that of lighting in movies.

Mr. Iwasaki "At the beginning of development, we used parallax mapping for the ripple expression, and realized a fairly three-dimensional ripple expression. However, due to the GPU load problem, we settled on the ripple expression by the current normal map. rice field"

[Water surface expression]
"Sonic WA" has a beautiful water surface expression.Let's observe the effect of Fresnel reflection and the mirror image of the dynamic character.

■ Bonus-The story of the development difficulties of PS3 version and Xbox 360 version

Mr. Hashimoto who draws a figure and explains

Mr. Ogino "Development of the PS3 version was quite difficult. Functions and functions equivalent to the library provided on Xbox 360 were ported to PS3 considerably. It was also difficult to handle the main memory. DMA convenience in PS3 Above, performance will not come out unless the data is aligned with a 128-byte border. Moreover, unlike the 512MB of Xbox 360 that can be used freely, the PS3 is divided into 256MB of main memory and 256MB of graphics memory according to usage. I will ... "

Mr. Ogino "In the development of this PS3 version, the library provided by SCE, Playstation Edge, helped me a lot. The edge geometry that utilizes the SPE (Synergistic Processor Element) in the CELL processor as a vertex shader is active. Of course, the effect of skinning was great, and the performance improved 10 times when it was processed only with RSX of PS3 (laugh). Many data are common with the Xbox 360 version. However, due to the fact that this Edge geometry is utilized, 3D model data etc. are optimized exclusively for PS3. "


■ 3D game graphics lighting evolves in the direction of GI

Mr. Hashimoto carefully explained each implementation technology while demonstrating it in a demo.

Mr. Hashimoto "When it comes to GI, I wish I could handle specular (specular reflection) information. Currently, our GI technique deals only with diffuse reflection systems. Spherical harmonics. I think that if you can use a function to include information such as what kind of light is coming about each surface of the object in the scene, you can get a very beautiful luster. You can manually create a cube map etc. There seems to be a way to arrange it in a large number of spaces, but again, I would like to create a system that generates data fully automatically instead of manually setting it by the artist. There is room for the artist to make adjustments. I think it's best to have.


(C) SEGA