Intermediate Lighting: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(excuse any errors, done from memory (not final))
m (spelling)
Line 12: Line 12:
{{todo|add img}}
{{todo|add img}}


An invisible light source. Can be turned on and off through inputs. Able to set up with patterns given effects but cannot move locations. Light is cast in all directions from the origin of the entity. The brightness depends upon the falloff values you set up. This light entity is the simplest and cheapest of all lights and is the most usefull. Use this light whenever possible.{{clr}}
An invisible light source. Can be turned on and off through inputs. Able to set up with patterns given effects but cannot move locations. Light is cast in all directions from the origin of the entity. The brightness depends upon the falloff values you set up. This light entity is the simplest and cheapest of all lights and is the most useful. Use this light whenever possible.{{clr}}


==[[light_spot]]==
==[[light_spot]]==
Line 46: Line 46:
{{todo|add img}}
{{todo|add img}}


A normal light that lights only the particles created be an env_smokestack and lights nothing else. Usefull for enhancing lighting in areas with steam and such but rarely used due its specific nature.{{clr}}
A normal light that lights only the particles created be an env_smokestack and lights nothing else. Useful for enhancing lighting in areas with steam and such but rarely used due its specific nature.{{clr}}


==[[point_spotlight|(npc or point)_spotlight]]==
==[[point_spotlight|(npc or point)_spotlight]]==

Revision as of 16:31, 10 June 2006

Stub

This article or section is a stub. You can help by expanding it.

Introduction

Template:Int lvl design This tutorial will cover the more advanced lighting techniques used in Source maps. If you are new to lighting in Hammer, you may want to read the basic light tutorial first. To begin all the possible ways to create light and then move onto all the settings related to lighting. It will then finish by suggesting some common ways to implement lighting.

Light Entities

This is a list and rundown of each entity you can use to cast physical light. The titles for each section link to the page for the entity itself. Its important to remember that these entities cast light in some form or another.

light

Light.png
Todo: add img

An invisible light source. Can be turned on and off through inputs. Able to set up with patterns given effects but cannot move locations. Light is cast in all directions from the origin of the entity. The brightness depends upon the falloff values you set up. This light entity is the simplest and cheapest of all lights and is the most useful. Use this light whenever possible.

light_spot

Todo: add img

A directional form of the light entity, its cone-shape allows for a directed form of light. Again it can be turned on and off through inputs, though a switchable light_spot may cause lightmap errors. This is a static light that can be pointed in any direction. And is also recommende for common use.

Note.pngNote:When using this entity, it may be necessary to turn the brightness value up significantly to achive visible results. Streetlights for exmaple may need brightnesses of 3000-4000.

light_dynamic

Todo: add img

An invisible light source that can change and move over time. Itsa position can change and it can be aimed at moving objects. Dynamic lights are recalculated continuously, which means they have a higher processing cost but are much more flexible than static lighting. Use this type of light sparingly, because it is the most expensive light for the engine to render.

Note.pngNote:This entity actually consists of two lights, a cone shape light and a spot world light. Some values may affect one and not the other.

light_environment

The skybox texture
Todo: add img

A directional light cast in only one direction, the direction is decided by the keyvalues entered. The key is that the light is only cast from the tools/toolsskybox texture. The first keyvalue, Brightness, controls direct lighting. This approximates direct sunlight. The second keyvalue, Ambient, controls indirect lighting from the sky. This is the diffuse light the is cast on every face that can "see" the sky. Basically the shadow the light leaves.

If you don't want to come up with your own values for this entity, the values used in the official Valve games for each skybox, are given here.

Normally, only one light_environment entity is required per level. A 3D Skybox requires placement of an extra light_environment within the 3D skybox. If multiple light_environment entities are placed, Vrad uses the keyvalues from the first found light_environment to calculate the lighting.

Glowing Textures

Todo: write link + add img

In a few cases its possible to make the texture itself appear bright or even to emit light. Doing so requires the use of a .vmt or .rad file and is beyond the scope of this article. Doing so can save the mapper the effort of trying to create an even lighting affect across a surface thats meant to be the lights source.

env particlelight

Todo: add img

A normal light that lights only the particles created be an env_smokestack and lights nothing else. Useful for enhancing lighting in areas with steam and such but rarely used due its specific nature.

(npc or point)_spotlight

Todo: add img

A straight light beam used for a spotlight affect. A mix of several affects including a flare when looking at it directly, a beam along the direction its pointing, and a light_dynamic where the beam touches the ground. While incapable of moving on its own it may be tied to a moving entity, alternatley there is the npc_spotlight option. This is exactly the same as a spotlight but is controlled by an NPC's intelgence and therefore can be controlled precisley and fluently. Due to to the dynamic light this is an expensive lighting source to render and should be used sparingly.

Related Items

Todo: add img

This is a list of all the topics related to lighting itself but don't emit light. While none of these emit any physical light thier all essential to creating effects with it. If its controlling the lighting of entities or controlling an antlion's shadow they all fall under lighting effects.

Info lighting

Todo: add img

This is an entity used to specify the origin from which another entity is lit. Sometimes due to drastic changes in light over short distances or complex shadows a model can appear to be lit incorrectly. By using this entity the model will be lit as though it were stationed at this location.

env_lightglow

the lightglow effect
Todo: add img

Used to create a bright almost flare that will fade out at specified distances. Generally used to transition dark tunnels to bright outsides. Used as a precursor to the HDR effect to fake a change in exposure of the light.

env_sun

Todo: add img

Often misinterpreted as a light that creates lighting like the sun it is instead an effect that places a flare in the sky that looks and acts like the sun. Casting no light at all it is often used with a light_enviornment to create its lighting affect.

shadow_control

Todo: add img

Used to control all the dynamic shadows cast within the game. Shadows cast by NPC's or physics entities fall into this category. Used to line up the shadows angles so they appear correct with lighting. The one directional nature may be a problem but use of triggers to even it out should help.

info_no_dynamic_shadow

Todo: add img

This forces a particular brush face to not recive any of the dynamic shadows create by physics entities or npcs. Its used rareley but may be needed to hid incorrect or bad shadows that create an icorretc look.

env_tonemap_controller

Todo: add img

Used to control the exposure of the HDR lighting effects. Unless used with fully implemented HDR it has little/no effect.

Lightmaps

Todo: write link + add img

A lightmap is the surface on top of each face that stores all the lighting information of a face. The stored light is then added to the face giving it brightness. The lightmap's value is the size of each pixel of light (luxel) that the lightmap stores. Smaller values means smaller luxels, thus a better resoultion and quality but higher files size and compile times.

Vrad

It is the part of the compiling process that will generate all your lighting effects, its also one of the longest parts of a compile and can often be the one you need to run the most. With no way to estimate lighting effects appart from experince it can often be tiresome to compile enough time to get a light effect right. The topic of how to compile Rad well is tackled later. For now familiraization with its features and setup should be a priority.

Techniques

This covers how to use the mentioned items to create effective lighting.

Creating a true light source

Todo: talk about creating places for your light to come from and realistic sources

Static Vs Dynamic

Todo: discuss satic Vs Dynamic light, how and why

Using lightmaps well

Todo: discuss benefits of high lightmaps and downsides, show examples, talk about tactics to achive resolution and avoid downsides

Compiling RAD Well

Todo: how to perfect lighting effects in the shortest time, ways to estimate and work with light without compiling.

Conclusion

This covers the base of all lighting effects. Any lighting affect that can be achived is a mixture of all or some of these effects.

Todo: create nav bar