Search public documentation:
Last tested against UDK June, 2011
- Using Light Functions
- Textured strobe light
- Neon strobe light
- Simple strobe light
- Textured flickering light
- Interval flickering light
- Simple flickering light
- Cube mapped light
- Cloud light
- Cheap shadowed light
Light functions allow you to create more interesting lighting set ups, such as flickering lights, textured lights, etc. If you've worked with Unreal Engine 2, light functions would be similar to projectors. Light functions uses Unreal Engine 3's material system, which makes it easy to create them. This development kit gem will demonstrate a variety ways light functions can be used to enhance your game. Please review light functions to read all the technical details about them.
A textured strobe light will regularly flash a scene with a texture projected out from the light vector. This method allows you to easily project textures onto walls and could be useful for situations where you may want to throw caustics from lights in water. (Hover for animated preview)
A neon strobe light is similar to the textured strobe light, except that it projects a textures and alters the light's color. This style of light would be useful for neon signs, projectors and so forth. In this particular example, projector like behavior is created by clamping the texture so that it doesn't tile, and using the light function with a spot light instead of a point light. (Hover for animated preview)
A simple strobe light simply brightens and then darkens a room with a predictable time pattern. This is a very simple light function as it just alters the light's brightness at a constant rate. (Hover for animated preview)
A textured flickering light is handy effect when you want the room to flicker but with shadows being casted randomly. This gives the room a little more atmosphere and dynamics that a simple flickering light wouldn't. (Hover for animated preview)
An interval flickering light allows you to adjust the flickering light in an easy manner. This ensures that as you use the light function you can change the rate at which it flickers, by using material instancing. (Hover for animated preview)
This material works exactly the same way as the interval flickering light except that it doesn't have any parameters that you can alter. (Hover for animated preview)
When using textures, you can either use normal 2D textures or you can use a cube map. Cube maps more useful when the light has multiple directions such as point lights. For lights that define a singular direction such as directional lights and spot lights. When using 2D textures for point lights (or other lights with multiple directions) you may see texture stretching or banding. Cube maps solve this problem specifically.
This light function simply outputs a wrapped, panning texture to simulate clouds passing by. Simple to add, but adds so much to the scene.
This technique can be used to do cheap dynamic shadows. However, because you can a texture, you can create a mask to create shadowed areas. However, be aware that this only works when nothing can come between the light and the object casting the shadow. (Hover for animated preview)
- Download the content used by this gem. (LightFunctionGems.zip)