Volumetric LightingVolumetric lighting has been a goal of 3D game designers for many years now but it's appearance has been limited by the capabilities and performance of the graphics card at the time of each particular attempt; however, we're now at a stage where it can be tackled with real gusto. To begin with though, let's take a look at how basic lighting works in a 3D game - to demonstrate the first examples, we're using demos from dhpoware. The simplest way of lighting up a scene is called vertex lighting - vertices are the points in space which are used define the shapes of everything we see; they form the corners of all the polygons in the frame. Each vertex carries with it a stack of information (where it is in the 3D space, what textures are linked to it, how far away it is from the camera, what colour it should be) and this data is used to figure out what the models will look like.
In the images above, a simple cube is drawn with a brick wall texture applied to it. There's a single spotlight in the 3D space, right in front of the camera (it's invisible!) and pointing directly along the same line as the camera is facing; vertex lighting works out the colour of the whole object by calculating it at the vertices first and then blending out in between them (interpolating). The result is simple but very quick; however, the colour of the surface looks "flat" because there's no calculating done for each pixel in the cube. For that, you need per-pixel lighting! In the two images below, the same cube is now created by calculating the colour of each pixel across the surface - the result is considerably more realistic:
Further calculations for each pixel can enhance the realism and techniques called normal mapping or parallax mapping have given modern games incredible visuals for us all to enjoy. However, the above demos are artificial in the sense that the only thing being lit is just the cube - in the real world and 3D games, there are hundreds and thousands of objects to illuminate. Even then, such renderings still look unnatural and sterile because the processes cannot take into account that the air is often full of suspended particles, water droplets, small pieces of material and so on, which all get in the way of the beams of light. Particle effects, seen here in Futuremark's 3DMark03, can be used to create smoke trails but they don't change the lighting of the scene. There are various "hacks" to try and replicate this - fog and particle effects are the most frequently used. The former is often a sequence of semi-transparent squares, overlapping each other, to give the impression of the thickness of air. As for particles, how many times how you played a game where you've shot the ground and a dust cloud appears? That's a particle effect (although with many games it's often the same trick as fog), where lots of little simple little objects are rendered.
|
|||||||||||||||||||||||||||||||||||
![]() |