Ru/3D Skybox: Difference between revisions

From Valve Developer Community
< Ru
Jump to navigation Jump to search
Line 20: Line 20:
===Основные характеристики===
===Основные характеристики===


3D Skyboxes have the following characteristics:
3D-скайбоксы имеют следующие характеристики:


* Are constructed (by default) in 1/16 scale in the Hammer editor and then rendered at 16 times size in the engine to match the world geometry.
* По умолчанию создаются в масштабе 1/16 в редакторе и отображаются в 16 раз больше во время игры для увеличения геометрии локации.
* Support materials with shader effects such as normal mapping, water, environment mapping, proxies, etc.
* Поддерживаются материалы с шейдерами, такими как карты нормалей, вода, карты окружения, прокси, и.т.п.
* Are non-interactive players and other world entities cannot enter 3D skyboxes. The 3D skybox is just a visual extension of the map extents.
* 3D-скайбоксы - не интерактивные зоны игроки и другие ентити уровня не могут находится внутри.  
* Can be constructed with brushes, displacements, static and dynamic props, lights, brush entities, and point entities (such as [[env_sprite]]).
* Создается из брашей, деформированных ландшафтов, статичныхи динамичных моделей,источников освещения, брашевых ентитей, и точечных(таких как [[env_sprite]]).
* Any models that are placed in the 3D skybox must be authored at 1/16 scale. Standard models ([[Prop_Types_Overview|props]]) are not scaled properly for 3D skybox. Special 1/16 scale versions must be used. For [[Half-Life 2]], these props can be found in the <code>models/props_skybox</code> directory.
* Any models that are placed in the 3D skybox must be authored at 1/16 scale. Standard models ([[Prop_Types_Overview|props]]) are not scaled properly for 3D skybox. Special 1/16 scale versions must be used. For [[Half-Life 2]], these props can be found in the <code>models/props_skybox</code> directory.
* Should not contain [[info_player_start]], NPCs or monsters.
* Should not contain [[info_player_start]], NPCs or monsters.

Revision as of 12:21, 29 August 2008

Template:Totranslate:ru

Введение

Добавление 3d-скайбокса может существенно улучшить вид карты. 3D-скайбокс - это дополнительная зона, создаваемая дизайнером уровней за пределами основной зоны, отвечающей за геймплей карты. Как только карта загрузится, движок увеличивает объекты, находящиеся в зоне 3D-скайбокса и помещает их за пределы уровня, между скайбоксом и игроком. Это используется для визуального расширения мира вокруг вашего уровня, без лишних затрат на ресурсы, т.к. по умолчанию используется масштаб 1:16. 3D-скайбоксы - это неинтерактивные части уровня - игрок и другие ентити не могут попасть в 3D-скайбокс.Геометрия 3D-скайбокса ничем не отличается от обычной геометрии уровня. Вполне возможны бесшовные переходы от обычной геометрии к объектам 3D-скайбокса - см. официальные карты на Counter-Strike: Source

Note.pngПримечание: 3D-скайбокс не заменяет 2D skybox. 2D-скайбокс всегда на фоне 3D-скайбокса. Чтобы изменить 2D-скайбокс, см. Skybox (2D).

Преимущества

Обычные скайбоксы - это простые двухмерные изображения, наложенные на грани куба, т.к. они окружают уровень. 3D скайбоксы - это 3D-геометрия, точно синхронизированная с перемещением игрока. Т.к. они обрабатываются в реальном времени, они масштабируются с текущим разрешением видеокарты и поддерживают шейдеры в реальном времени, недоступные для 2D-скайбоксов.

Основным преимуществом 3D-скайбокса является возможность визуально увеличить карту. Максимальный размер карты без 3D-скайбокса - 32768 юнитов на каждой стороне. Используя 3D-скайбокс, карта увеличивается в 16 раз.

Карты такого размера возможны, т.к. 3D-скайбоксы создаются в редакторе в масштабе 1/16. При компиляции карты, движок игры масштабирует их. Это не только сохраненное место в редакторе, это еще ускоряет компиляцию и визуализацию.

При их масштабе, у 3D-скайбоксов намного меньше карты освещенности и разрешение текстур. Поэтому объекты 3D-скайбокса не так ресурсоёмки, как обычные.

3D-скайбоксы могут быть использованы для преодоления лимита расстояний между локациями, если они будут созданы как основная карта в малом разрешении. Команда разработчиков мода должна учитывать это для облегчения перехода от одной карты к другой.

Основные характеристики

3D-скайбоксы имеют следующие характеристики:

  • По умолчанию создаются в масштабе 1/16 в редакторе и отображаются в 16 раз больше во время игры для увеличения геометрии локации.
  • Поддерживаются материалы с шейдерами, такими как карты нормалей, вода, карты окружения, прокси, и.т.п.
  • 3D-скайбоксы - не интерактивные зоны – игроки и другие ентити уровня не могут находится внутри.
  • Создается из брашей, деформированных ландшафтов, статичныхи динамичных моделей,источников освещения, брашевых ентитей, и точечных(таких как env_sprite).
  • Any models that are placed in the 3D skybox must be authored at 1/16 scale. Standard models (props) are not scaled properly for 3D skybox. Special 1/16 scale versions must be used. For Half-Life 2, these props can be found in the models/props_skybox directory.
  • Should not contain info_player_start, NPCs or monsters.
  • Have lower lightmap and texture resolution because of the scale at which they are created.
  • Must have their own lighting sources, although a light_environment in the non-skybox section will also be used for the 3D skybox lighting.
  • Use the sky_camera entity to control how they line up with the non-skybox world geometry.
  • 3D skyboxes have their own fog parameters, adjustable in the sky_camera entity.
  • Geometry in the 3D skybox is not occluded or culled like the rest of the level geometry. Adding lots of detailed brush geometry or models to the 3D skybox, especially with translucent materials, can severely affect performance.
  • A map must have a light_environment in it, otherwise models in the 3d skybox will be lit incorrectly. A light_environment in the non-skybox part of the map negates the need for one in the 3D skybox.

Construction of 3D skyboxes

  • A note for Portal developers: 3D skyboxes are not visible when observed through portals.
  • A note about the sky_camera entity: point entities do not scale down.

The most efficient way of creating a 3D skybox that matches or "lines up" with the your current map is to use some of the geometry in the main part of the level. Follow these steps after you've created your main level geometry:

  1. Add a sky_camera entity at the world origin (coordinates 0, 0, 0), the center of the map grid. The sky_camera is a reference point used by the renderer to align the 3D skybox with the main part of the map. In other words, it acts as a marker telling the renderer how the 3D skybox's origin and the world's origin relate to one another. You can think of this process as being similar to selecting all the 3D skybox geometry and then aligning the sky_camera entity in that selection with the world's origin (0,0,0). The geometry is translated back to that position in the world. This is the same concept used when the skybox is rendered in the engine.
  2. Select some distinct parts of the level that you can use a guideline for scale and position in the 3D skybox. Common elements to select for this purpose would be some of the larger structures, as well as the walls, cliffs, hills, etc. that define the edges of the map. Make sure you also have the sky_camera you created selected as well.
    Note.pngПримечание:It is important not to select any model entities, only brushes. Models cannot be used as reference geometry, because models cannot be scaled down in the Hammer editor.
  3. Choose Copy from the Edit menu, or hit CTRL-C.
  4. Choose Paste Special from the Edit menu. Set the Number of copies to paste to 1, and all other values to 0. Hit OK. This makes a duplicate of the geometry you had selected.
  5. Turn on Scaling Texture Lock in the toolbar, if it is not already on. Its icon resembles <tl>. This will shrink the textures along with the geometry.
  6. Leaving geometry selected, choose Transform from the Tools menu. Select the radio button next to Scale. Type in a value of .0625 for X, Y and Z. This is the decimal equivalent to 1/16 – the scale of the 3D skybox. Click OK.
    Note.pngПримечание:If you want textures on the geometry to scale accordingly, make sure you have texture lock enabled.
  7. You now have a 1/16 scale version of your reference geometry. Now drag (move) it to another part of the map where you wish build your 3D skybox. It doesn't matter where it is as long as it's not touching any part of the main level geometry area.
  8. Delete the sky_camera entity from the normal world map area you started from. Important: only the sky_camera entity in the 3D skybox should remain in the map.
  9. Build your 3D skybox geometry around the reference geometry, using it as a guide. You can build skybox geometry that meets the reference geometry seamlessly. You can use brush and displacement geometry. Models can also be placed, but since the 3D skybox is at 1/16 scale, any models must also be at 1/16 scale. The model hl2\models\props_skybox\coast01.mdl is a sample model in 1/16 scale. Try positioning the 3D view camera near the height of the player. This will give you a good idea of how the 3D skybox will look when it's rendered in the engine.
  10. Add a hollow cube of brushes around your reference geometry and assign the tools\toolsskybox material to it. The standard 2D cubic skybox will appear on these surfaces. The 3D skybox area must be sealed with these brushes.
  11. When you're done, delete or hide all of the reference geometry except for the sky_camera entity. You may find that it work best to add the reference geometry to its own visgroup so that it can be toggled on and off or re-placed. Just make sure you turn it off before you save and compile the level, or it will be compiled into the 3D skybox.
  12. Your original map still needs the tools\toolsskybox material wherever you want to see the sky, however it will now show the 3D skybox as well as the 2D skybox (which is what it did previously).

Testing

If you properly sealed your 3D skybox, you can now compile the map and check out your new 3D skybox in the engine.

Examples

Статьи об окружающей среде
Текстуры неба и создание неба Source Source: Небосвод (2D)Объёмное небо (3D)HDR-текстуры небаСоздание текстур неба в TerragenСоздание текстур неба в Terragen - подробноСписок текстур неба


Source 2 Source 2: Объёмное небо (3D)

Создание рельефа местности и деформация поверхностей Деформированные поверхностиСоздание отверстий в деформированных поверхностяхЦифровые модели местностиСоздание рельефа в Worldmachine

Template:Otherlang:en Template:Otherlang:en:ru