Shaders and DirectXThe engine behind Project Offset is designed with Shader Model 3.0 in mind, introduced in the DirectX 9.0c. However, Green says that SM 2.0 is supported and is the baseline for running the game.An important thing to understand about SM 2.0 and SM 3.0 is that they are very similar. The primary advantage of an SM 3.0 codepath is the ability to use more instructions in a shader and the availability of additional instructions. Green uses the example of partial derivates, a function that allows for the calculation of one variable while related variables remain constant, which is included in SM 3.0 but not SM 2.0. Obviously, these sorts of functions allow an SM 3.0 codepath to typically be more efficient than a functionally-identical one in SM 2.0.Currently Offset is being developed with DirectX 9. Green says that the engine is ready to be switch over to DirectX 10 (and presumably SM 4.0) once Vista hits. Although they haven't had much of chance to play around with DX 10/SM 4.0, Green says that from what they've seen, they should be able to draw more objects on screen at one time. LEFT: HDR off. RIGHT: HDR onHigh Dynamic RangeHDR isn't so much an effect as it is a type of calculation. Basically, HDR calculations are used to figure out colour values that exceed the brightness levels of the current bit-depth (usually 24 or 32) and are always floating-point (not integer). The result is better representation of light in various environments, and allows the use of actual effects like bloom and exposure. Due to the use of FP rather than INT, HDR typically incurs a noticeable speed hit.HDR was introduced with SM 2.0 in DirectX 9. The introduction of SM 3.0 in DX 9.0c did make improvements to HDR (upping precision from 24-bits to 32) but not to any great degree.Performance hit: 'Low - This is a core "feature" to the rendering pipeline, and the [Offset] engine was designed from the ground up to support it,' explains Green. Difficulty/Time to implement: 'Moderate - to convert an established engine over to HDR can be a little tricky, but with a engine written from scratch it's pretty straight forward,' says Green.
LEFT: Specular bloom off. RIGHT: Specular bloom on.Specular BloomA benefit of implementing HDR into a rendering pipeline is the easy in which specular bloom can be added and indeed is what many people incorrect describe as HDR lighting itself. A bright light has a tendency in real life to 'feather' out from the edges of objects it shines through. Green describes to as a 'soft glowing halo' and the effect can be seen to great effect in the above screenshots. '[It] creates some great visuals when you are in a dark area looking into a bright outdoor environment. Or for blowing out those specular highlights,' explains Green.Performance hit: 'Low to medium - adds several post processing (screen buffer) passes, and adjusts the quality of the halo effect based on user settings.'Difficulty/Time to implement: 'The bloom effect was simple to add into the engine thanks to its post processing architecture. This was the first post processing effect added to the engine, and there are several variations on the effect implemented.'
Issue: 133 | February, 2012