Ru/Lighting: Difference between revisions
< Ru
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{otherlang2 | {{otherlang2 | ||
| | |title=Освещение | ||
|zh-cn=Lighting:zh-cn | |zh-cn=Lighting:zh-cn | ||
|ru=Lighting:ru | |||
}} | }} | ||
{{ | {{Abstract Mapping}} | ||
== Руководства == | |||
[[Image:Proper lighting example.png|right|thumb|Пример хорошо освещённой комнаты.]] | |||
* [[Adding Light:ru|Добавление света]] - Уроки для начинающих о том, как настраивать основные энтити [[light|света]]. | |||
* [[Intermediate Lighting:ru|Промежуточное освещение]] - Подробный материал о всех источниках света. | |||
* [[Advanced Lighting:ru|Продвинутое освещение]] | |||
* [[Constant-Linear-Quadratic Falloff|Линейно-квадратичная постоянная рассеивания]] - Простое объяснение старой системы C-L-Q затухания света. | |||
* [[HDR]] - Высокий динамический диапазон освещения. | |||
== | == Виды == | ||
=== Статичные источники света === | |||
{{tip:ru|Статичный свет компилируется в [[Lightmap:ru|карты освещения]], которые освещают и [[brush|браши]], и [[model|модели]], и [[Cubemaps|кубмапы]], и дают статичные [[reflection|отражения]]. | |||
Это | Это [[free|облегчает]] визуализацию, поскольку огни уже прописаны в карту.}} | ||
;[[light]]:A static, omni-directional point light source. (e.g. a naked light bulb or flame.) | |||
;[[light_spot]]:A static, uni-directional point light source. (e.g. a torch or flashlight) The conical beam angle cannot exceed 90°. | |||
;[[light_environment]]: Provides two linked light sources: | |||
:*A diffuse 'ambient' light (representing reflected light from clouds and the atmosphere in general) that emits from all skybox surfaces | |||
:*A directional 'brightness' light (representing sunlight or moonlight) that is only cast in a single direction. | |||
:Both are emitted from the [[Tool textures#skybox|toolsskybox]] material wherever it is used on a map. See also [[Skybox]]. | |||
;[[env_particlelight]]: Illuminates particles produced by [[env_smokestack]]. Particles are not affected by normal lighting. Use (no more than) two of these to make (only) [[env_smokestack]] particles appear to reflect ambient lighting. | |||
;[[Glowing Textures]] | |||
:[[Brush]] surfaces with a light-emitting material (as defined in <code>game_dir/lights.rad</code>) applied will cast volumetric light in a 180° cone. | |||
=== Static light receivers === | |||
;[[Brush]]es | |||
:This [[Hammer Face Edit Dialog]] tool '[[Lightmap Scale]]' can be used to control how sharp or diffuse the lightmap of a brush surface will be - an effect most noticeable between areas of high contrast, e.g. shadows. Note that while adding extra light sources will not significantly affect performance, decreasing lightmap scale (i.e. increasing resolution) will more directly increase map file size and memory usage. | |||
;[[prop_static]] | |||
:Unlike other model entities, prop_static are lit statically: a lighting value is stored for every [[vertex]], and the model's [[collision mesh]] (or, optionally, [[reference mesh]]) is used to calculate lightmap shadows. | |||
:There are the following options: | |||
:*<code>disableshadows</code> - Do not cast lightmap shadows | |||
:*<code>disablevertexlighting</code> - Only store a single lighting value for the entire model | |||
:*<code>disableselfshadowing</code> - Prevents the entity from casting shadows on itself | |||
:*<code>ignorenormals</code> - Ignores normals of vertex data to calculate lighting. This is extremely useful for foliage, and other thin types of vertex meshes. | |||
=== Dynamic light sources === | |||
{{tip|Dynamic lighting is calculated at runtime, which makes it [[expensive]] to render.}} | |||
[[Image:Shadowmap.jpg|thumb|180px|[[env_projectedtexture]] shines from a doorway.]] | |||
;[[light_dynamic]]:A simple, uni-directional dynamic light that can be moved, turned, and adjusted. | |||
;[[point_spotlight]]:A dynamic spotlight beam effect, with an optional dynamic light source where it hits a surface. | |||
;[[npc_spotlight]]:A spotlight [[NPC]], similar to point_spotlight but with the capability of tracking targets. | |||
;[[env_projectedtexture]]:A dynamic light that lights with a texture rather than a solid colour, and which also 'subtracts' realistic dynamic shadows. Affects all surfaces that can accept lighting, and is used for the player [[flashlight]] in [[Episode Two]]. | |||
=== Dynamic shadows === | |||
{{tip|Dynamic Shadows are cast only by world [[model]]s (NPCs, phys-props, etc), and only onto [[brush]] surfaces (from both Static and Dynamic light sources). They are calculated at runtime, so they are quite crude and relatively [[showbudget|expensive]] to render.}} | |||
[[Category: | {{warning| These are not *really* shadows, they are procedural(generated in code) textures projected away from the caster. In Left 4 Dead, Portal 2 and Alien Swarm, the direction of a shadow is calculated on a per-entity basis, and dictated by the closest light to the entity. But not in Source2006/2007/2013 mods, unless you apply [[Dynamic RTT shadow angles in Source 2007]] to your mod.}} | ||
{{warning|Dynamic Shadows can sometimes project through walls and floors, giving away the location of players or objects. Use [[info_no_dynamic_shadow]] to workaround this problem if you encounter it.}} | |||
{{note|Shadows are "cast" by the visual mesh only if there is no [[shadowlod]] defined in the [[QC]]. Shadow LODs are just low detail meshes used to generate the shadow. These don't apply to shadowmapping (flashlights, [[env_projectedtexture]]) }} | |||
{{note|Dynamic Shadows do not merge with each other or with Lightmaps when they overlap. This can produce undesirable 'doubling up' effects when, for instance, phys props are placed on a phys prop table. You can enable and disable shadows on dynamic entities to work around this.}} | |||
{{note|Dynamic Shadows support translucency. If your model has varying levels of opacity, it can show up in the shadow [http://img4.imageshack.us/img4/3627/parttrans.png as seen here].}} | |||
;[[shadow_control]]:Point entity used to control Dynamic Shadow projections for the entire map, including maximum distance cast, direction cast, and sharpness/diffuseness. | |||
;[[info_no_dynamic_shadow]]:Point entity used to list [[Brush]] surfaces that should ''not'' receive Dynamic Shadows. | |||
;[[prop_physics]] entities : have a "shadowcastdist" keyvalue to override how far this object casts Dynamic Shadows. | |||
;[[prop_dynamic]] entities : have a "disableshadows" keyvalue, and "enableshadows" and "disableshadows" inputs to control Dynamic Shadows cast by them. | |||
;NPC entities : have the prop_dynamic shadow controls, plus a "disablereceiveshadows" {{TODO|to prevent...?}} | |||
=== Tyndall effects === | |||
[[Wikipedia:Tyndall effect|Tyndall effects]] are caused by light scattering on suspended (colloid) particles in a transparent medium. E.g., car headlights in fog. | |||
* [[Wikipedia:Halo_(optical_phenomenon)|Halo]] (Glow Sprite) effects : | |||
:*[[env_sprite]] - entity used to create omni-directional glow or flare effects. | |||
:*[[env_lightglow]] - an asymmetrical glow (for areas of contrasting light). | |||
:*[[env_sun]] - adds a bright haloed spot to the [[Skybox]] to represent the position of the Sun or Moon. | |||
* [[Wikipedia:Light beam|Lightbeam]] (Volumetric Light) effects : | |||
:*Brush texture : <code>models/effects/vol_light001</code> | |||
:*Brush texture : <code>models/effects/vol_light002</code> | |||
:*Model : <code>models/Effects/vol_light.mdl</code> - use with [[prop_static]]. | |||
* See also [[Render Modes]] for sprites, particularly [[Render Modes#World Space Glow (9)|World Space Glow]]''. | |||
== Common values == | |||
;Car Headlights | |||
:Brightness <code>231 223 192</code> {{note|Taken from L4D2 SDK}} | |||
;City 17 day | |||
:Brightness <code>237 218 143 800</code> | |||
:Ambience <code>190 201 220 100</code> | |||
;Ravenholm night | |||
:Brightness <code>175 230 239 50</code> | |||
:Ambience <code>43 45 57 5</code> | |||
;Combine lamp | |||
:Brightness <code>147 226 240 3000</code> | |||
:Ambience N/A | |||
;Tungsten bulb | |||
:Brightness <code>254 216 146</code> | |||
:Ambience N/A | |||
;Fluorescent bulb | |||
:Brightness <code>159 237 215</code> | |||
:Ambience N/A | |||
For values to accompany the stock [[skybox]] materials, see [[Sky List]]. | |||
== Notes == | |||
*Naming a light makes it more expensive. Only name lights when you need to. Multiple lights sharing the same name are cheaper than lights with separate names. | |||
*[[light_dynamic]] is especially expensive, and will not even show up on some systems | |||
*The basic light entities do not come with a visible representation (e.g. a lightbulb). For that you need a prop. See [[HL2 light props]] for a list. | |||
*The basic light entities do not come with a "glow" as you'd expect to see in a foggy or misty area. To provide this, either compile and run the map with [[HDR]] enabled, or add a [[point_spotlight]] (with dynamic lighting ''off'' unless needed) or [[env_lightglow]] entity. | |||
*Maps will not be lit unless you run [[vrad]] (or equivalent). Vrad will not run properly and will not calculate realistic light bounces unless the level is free of [[leak]]s. | |||
*Several textures provide their own light & can do so using <code>[[lights.rad]]</code> in a mod's directory or the one in <code>sourcesdk/bin</code>. | |||
*Moving brushed-based objects will not change the way they are lit. Their lighting will be calculated only according to their positions in Hammer. (e.g. a brush in a dark room will not become bright if it is brought into a bright room.) | |||
== [[Console command]]s == | |||
[[Image:Mat fullbright 2.jpg|thumb|<code>mat_fullbright 2</code>. The bright white physics props seem to be a bug; they are lit correctly when in motion. ]] | |||
;<code>mat_fullbright <0-2></code> | |||
:<code>0</code> is normal lighting. | |||
:<code>1</code> is 'full bright' lighting, where everything is 100% lit. | |||
:<code>2</code> has been introduced with the Orange Box and is 'lighting only'. It replaces all textures' images with a colourless monotone, allowing you to see exactly what is lit, where, and probably how. | |||
== See also == | |||
* [[HL2 light props]] | |||
* [[Color theory (level design)]] | |||
* [[List_of_entities#Light_entities|Light entities]] - A list of light entities. | |||
* [[Intermediate_Lighting|Intermediate Lighting]] | |||
* [[Advanced_Lighting|Advanced Lighting]] | |||
* [[Window lighting]] - How to simulate refracted sunlight through openings. | |||
== External links == | |||
<!-- | |||
* [http://www.halflifestorm.com/?page=tutorials&tutorial=18 Understanding and Using Lightmaps] - Tutorial | |||
* [http://www.halflifestorm.com/?page=tutorials&tutorial=44 Volumetric Lighting] - Tutorial | |||
the Half-Life Storm website seems to have gone AWOL --> | |||
* [http://source-tutorials.synthasite.com/lighting-tutorial.php Lighting Tutorial] - Covers entities & variables with examples | |||
* [http://www.editlife.net/tutorials.php?id=15 Quadratic/Linear/Constant in Lights] | |||
<!-- SDK nuts has closed. When (and if) this tutorial is ported onto the VDC, please link to it instead! | |||
*[http://www.sdknuts.net/akg/?sdk=tutlights HDR/Shaped Light/Burning Light/Darkness/Sun/Volumetric] | |||
--> | |||
[[Category:Level Design]] | |||
[[Category:Hubs]] | |||
[[Category:Lighting|*]] |
Revision as of 02:25, 21 March 2016
Серия Воссоздание окружающей обстановки Выскажите свои мысли — Помогите нам воплотить больше идей |
---|
Снаряжение | Животные и существа | Муравьиные львы | Лучи и лазеры | Кабели и верёвки | Движущиеся облака | Теория цвета | Битвы | Комбайны | Сжатие ресурсов | Двери | Пыль, туман и дым | Лифты | Переключение карт | Внешнее освещение, солнце, погода и окружение | Взрывы | Огонь | Растительность | Стекло и окна | Хэдкраб | Жизнеспособность | Лестницы | Освещение | Оптимизация | Физические объекты | Сканеры сетчатки | Звук и музыка | Спецэффекты | Ландшафт | Поезда | Турели | Вода | Оружие | Зомби |
Руководства
- Добавление света - Уроки для начинающих о том, как настраивать основные энтити света.
- Промежуточное освещение - Подробный материал о всех источниках света.
- Продвинутое освещение
- Линейно-квадратичная постоянная рассеивания - Простое объяснение старой системы C-L-Q затухания света.
- HDR - Высокий динамический диапазон освещения.
Виды
Статичные источники света
- light
- A static, omni-directional point light source. (e.g. a naked light bulb or flame.)
- light_spot
- A static, uni-directional point light source. (e.g. a torch or flashlight) The conical beam angle cannot exceed 90°.
- light_environment
- Provides two linked light sources:
- A diffuse 'ambient' light (representing reflected light from clouds and the atmosphere in general) that emits from all skybox surfaces
- A directional 'brightness' light (representing sunlight or moonlight) that is only cast in a single direction.
- Both are emitted from the toolsskybox material wherever it is used on a map. See also Skybox.
- env_particlelight
- Illuminates particles produced by env_smokestack. Particles are not affected by normal lighting. Use (no more than) two of these to make (only) env_smokestack particles appear to reflect ambient lighting.
- Glowing Textures
- Brush surfaces with a light-emitting material (as defined in
game_dir/lights.rad
) applied will cast volumetric light in a 180° cone.
Static light receivers
- Brushes
- This Hammer Face Edit Dialog tool 'Lightmap Scale' can be used to control how sharp or diffuse the lightmap of a brush surface will be - an effect most noticeable between areas of high contrast, e.g. shadows. Note that while adding extra light sources will not significantly affect performance, decreasing lightmap scale (i.e. increasing resolution) will more directly increase map file size and memory usage.
- prop_static
- Unlike other model entities, prop_static are lit statically: a lighting value is stored for every vertex, and the model's collision mesh (or, optionally, reference mesh) is used to calculate lightmap shadows.
- There are the following options:
disableshadows
- Do not cast lightmap shadowsdisablevertexlighting
- Only store a single lighting value for the entire modeldisableselfshadowing
- Prevents the entity from casting shadows on itselfignorenormals
- Ignores normals of vertex data to calculate lighting. This is extremely useful for foliage, and other thin types of vertex meshes.
Dynamic light sources


env_projectedtexture shines from a doorway.
- light_dynamic
- A simple, uni-directional dynamic light that can be moved, turned, and adjusted.
- point_spotlight
- A dynamic spotlight beam effect, with an optional dynamic light source where it hits a surface.
- npc_spotlight
- A spotlight NPC, similar to point_spotlight but with the capability of tracking targets.
- env_projectedtexture
- A dynamic light that lights with a texture rather than a solid colour, and which also 'subtracts' realistic dynamic shadows. Affects all surfaces that can accept lighting, and is used for the player flashlight in Episode Two.
Dynamic shadows






- shadow_control
- Point entity used to control Dynamic Shadow projections for the entire map, including maximum distance cast, direction cast, and sharpness/diffuseness.
- info_no_dynamic_shadow
- Point entity used to list Brush surfaces that should not receive Dynamic Shadows.
- prop_physics entities
- have a "shadowcastdist" keyvalue to override how far this object casts Dynamic Shadows.
- prop_dynamic entities
- have a "disableshadows" keyvalue, and "enableshadows" and "disableshadows" inputs to control Dynamic Shadows cast by them.
- NPC entities
- have the prop_dynamic shadow controls, plus a "disablereceiveshadows" Нужно сделать: to prevent...?
Tyndall effects
Tyndall effects are caused by light scattering on suspended (colloid) particles in a transparent medium. E.g., car headlights in fog.
- Halo (Glow Sprite) effects :
- env_sprite - entity used to create omni-directional glow or flare effects.
- env_lightglow - an asymmetrical glow (for areas of contrasting light).
- env_sun - adds a bright haloed spot to the Skybox to represent the position of the Sun or Moon.
- Lightbeam (Volumetric Light) effects :
- Brush texture :
models/effects/vol_light001
- Brush texture :
models/effects/vol_light002
- Model :
models/Effects/vol_light.mdl
- use with prop_static.
- Brush texture :
- See also Render Modes for sprites, particularly World Space Glow.
Common values
- Car Headlights
- Brightness
231 223 192
Примечание:Taken from L4D2 SDK
- City 17 day
- Brightness
237 218 143 800
- Ambience
190 201 220 100
- Ravenholm night
- Brightness
175 230 239 50
- Ambience
43 45 57 5
- Combine lamp
- Brightness
147 226 240 3000
- Ambience N/A
- Tungsten bulb
- Brightness
254 216 146
- Ambience N/A
- Fluorescent bulb
- Brightness
159 237 215
- Ambience N/A
For values to accompany the stock skybox materials, see Sky List.
Notes
- Naming a light makes it more expensive. Only name lights when you need to. Multiple lights sharing the same name are cheaper than lights with separate names.
- light_dynamic is especially expensive, and will not even show up on some systems
- The basic light entities do not come with a visible representation (e.g. a lightbulb). For that you need a prop. See HL2 light props for a list.
- The basic light entities do not come with a "glow" as you'd expect to see in a foggy or misty area. To provide this, either compile and run the map with HDR enabled, or add a point_spotlight (with dynamic lighting off unless needed) or env_lightglow entity.
- Maps will not be lit unless you run vrad (or equivalent). Vrad will not run properly and will not calculate realistic light bounces unless the level is free of leaks.
- Several textures provide their own light & can do so using
lights.rad
in a mod's directory or the one insourcesdk/bin
. - Moving brushed-based objects will not change the way they are lit. Their lighting will be calculated only according to their positions in Hammer. (e.g. a brush in a dark room will not become bright if it is brought into a bright room.)
Console commands
mat_fullbright <0-2>
0
is normal lighting.1
is 'full bright' lighting, where everything is 100% lit.2
has been introduced with the Orange Box and is 'lighting only'. It replaces all textures' images with a colourless monotone, allowing you to see exactly what is lit, where, and probably how.
See also
- HL2 light props
- Color theory (level design)
- Light entities - A list of light entities.
- Intermediate Lighting
- Advanced Lighting
- Window lighting - How to simulate refracted sunlight through openings.
External links
- Lighting Tutorial - Covers entities & variables with examples
- Quadratic/Linear/Constant in Lights