Миграция с CryENGINE 2 на CryENGINE 3

Материал из CryWiki Russia

Версия от 18:05, 16 июня 2012; DCamer (Обсуждение | вклад)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск
Эта страница страница помечена как находящиеся в процессе перевода с: 16 июня 2012.
Статью пометил сам автор статьи.


Содержание

Importing Content From CryENGINE 2

CryENGINE 3 has received a plenty of technical improvements over CryENGINE 2 in respect to performance and rendering quality. Despite the many changes, basically all of the assets that were created for CryENGINE 2 can still be loaded in CryENGINE 3. The only asset type that requires special care is textures. There are several technical improvements in CryENGINE 3 that require many of the existing textures to be recompiled. Usually, the Resource Compiler will take care of the conversion but it requires all textures to be available as TIFF files.

Resource Compiler Overview

The Resource Compiler (RC) is an important part of CryENGINE's asset pipeline. The RC takes source textures that are stored in the TIFF format and compiles them to a platform-optimized format that can be loaded by the engine in an efficient way. In this process textures may be compressed to reduce memory requirements.

Normal Map Updates

The way in which normal maps are stored was slightly updated. All normal maps that were authored for CryENGINE 2 should be recompiled. If the RC finds the corresponding TIFF files, this recompilation will take place automatically once an outdated asset is loaded.

HDR Encoding

CryENGINE 3 uses a special encoding to store High Dynamic Range images like environmental cube maps. The alpha channel of an environment map stores a multiplier that determines the brightness of the pixels stored in the RGB channels. If no alpha channel is specified, a default alpha channel of 1/16.0 will be generated. However, existing environment maps without alpha channel often have an alpha value of 1.0 (pure white) by default, so they will appear very bright. This problem can be overcome by recompiling the environment maps which will happen automatically if the RC finds the TIFF source texture.

sRGB Color Space

In contrast to CryENGINE 2, CryENGINE 3 can perform gamma correct rendering. Many textures like diffuse maps that are painted or based on photos are usually stored in sRGB space. The engine has to convert these textures to linear space before doing any lighting or shading operations. However, not all textures are in sRGB space (e.g. normal maps), so sRGB textures need to be tagged as such. Whether a texture is supposed to be interpreted as sRGB is defined in the TIFF preset. To apply the settings stored there, all textures need to be recompiled by the RC.

If the textures are not recompiled, the scene will look too bright since the colors stored in the diffuse maps are not interpreted correctly by the engine. A quick workaround to this is to disable sRGB rendering. This can be done by setting the console variable r_UseSRGB to 0. Please note that switching between sRGB and non-sRGB at runtime will only work in D3D9, so it is better to put the setting into the system.cfg file.

Gamma correct rendering will in general produce more correct and better looking results. However, the results are different from non-sRGB rendering, so some assets and light settings may need to be tweaked to look good.

Terrain Texture Changes

CryENGINE 3 stores the terrain textures in a different way than before, so it is required to regenerate the surface texture. Furthermore, terrain detail textures are handled in a special way in respect to sRGB (sRGB is disabled for them). It is required to change the TIFF preset of terrain detail maps to TerrainDiffuseHighPassed so that the correct settings will be applied.