An Introduction to RadiosityWhat does it do?This very simple question has quite a few answers, none of which are as simple as I would wish. In a nutshell, what a radiosity program does is analyze the lighting of an uncompiled level and apply the predicted results to the surfaces of the level. Confusing? Read the descriptions below, and hopefully it will clarify. Point lightsIn Quake, point lights were the only way to light a level. In Quake2, point lights are still valuable, but not the only option. A point light is a light entity tied to a specific coordinate in space. The keyvalues assigned to a point light tell the radiosity program how the light interacts with the level. Surface lightsSurface lighting properties are assigned to particular surfaces during editing, or are defaulted to the surface from the texture's .wal file. Surface lighting is not entirely different than point lighting, it just does all the work for you. (This statement is not entirely true, the falloff method is different, but for an introductory purpose the explanation will suffice). When compiling, the radiosity program divides a lit surface into separate lit areas, and then runs light as if each of the surface's areas were a point light. The color is derived from the surface's average texture color, however, and not from an entity key value. Surface lights can be a boon or bane, depending on how it is used. Bmodel lightsBmodel lighting works like surface lighting with a few exceptions. Functions that require solids like func_wall can emit surface light. In addition, since bmodels are part of an entity, light styles and other light properties can be added. How does it work?The following section will briefly describe the way in which a radiosity program creates light. LightmapsTo ease the burden on computers running Quake2, lighting is static. The way that a radiosity program outputs the lighting results for the game is through a lightmap. In Quake2, light does not exist in rays like it does in reality, instead, it exists on the surfaces of the shapes of the level. Essentially, there is no radiosity information for the space that you are standing in. The illusion of light is achieved by changing the brightness of the textures that define the level. Think of it as a small room with a light bulb. If we take away the bulb, but the room somehow stays lit, then we would think that there is light in the room. The intensities of the surfaces' brightness is defined by the lightmap, which is created by the radiosity program. Light stylesLight styles are lights that appear to change during runtime based on predefined properties. Although not truly dynamic lights, light styles can be used to emulate dynamic lighting. All of the switchable, pulsing, and flickering lights in the game use light styles. Since light styles are not actually dynamic lights, they still use lightmapped faces. In order to keep the game from getting too complex, Quake2 has set a limit of four lightstyles per face. Any more than four will spit out an error and yield wacky results. Colored lightsWith a 3d accelerated video card, you can experience Quake2 with colored lighting. Colored lighting is decided by the radiosity program based on texture information and the color keyvalue field in entity lighting. Colored lighting does not work in the software rendering video mode. What can’t it do?Radiosity cannot create moving light sources, and it cannot block light sources with entities. What this means is that trains cannot emit lights that will follow them. Doors cannot block light between rooms. Entities such as doors, func_walls, and func_trains will not cast shadows. How can I get around it?ArghRad’s support of negative light intensity values allows you to use negative light to counteract the bleed through effect of lights, such as lights that insist on shining through doors. It will also allow you to creatively cast shadows. Play around with spotlights with negative light values for shadow effects that were previously unavailable. Func_walls that emit light can be accompanied by switchable lights to emulate the effect of light dynamics. Linking lights to path_corners can make trains appear to project light if used properly, but the light styles per face limitation makes the effectiveness of this technique very limited. Which causes are hopeless?Hopeless!? With enough work, almost anything is possible. |