Graphics Reference
In-Depth Information
3
III
BokehEffectsontheSPU
Serge Bernier
3.1 Introduction
Graphics programmers work hard to spend their per-frame millisecond budget
wisely—by ensuring the color buffer gamma is correct, using a true high dynamic
range pipeline, or trying to have the best antialiasing technique possible. There-
fore it can be surprising to actually spend more milliseconds to produce a blurred
image! Many games use depth of field (DOF) to focus the player's attention on a
particular part of the frame, as well as to reinforce the depth illusion in the ren-
dered image. Depth of field has a natural home in cutscenes, which typically have
a more cinematographic feel, using framing and focus on a particular character
or object to deliver a critical plot line for the game.
Of course, the use of depth of field is mainly driven by the artistic direction
of a game, and this can differ dramatically from game to game. Typically, to
create the in-game depth-of-field lens effect, we blur a copy of the framebuffer
and interpolate between the blurred and non-blurred version depending on the
distance of each pixel to the focal plane. For many years the blurring technique
used was just a simple Gaussian blur to approximate the lens effect; however,
a new technique is around the corner that allows us to achieve a much more
real, filmic DOF effect. It is called bokeh , a Japanese word meaning “confused”
or “dizzy.” In our context we use it to qualify the aesthetic quality of the blur
applied to the out-of-focus part of the image. Typically the bokeh effect will make
highlights or light sources blur out into discs, or shapes that show the number of
iris blades in the camera lens. A DirectX11 implementation was shown at GDC
2011 in the Samaritan tech demo driven by the Unreal Engine. This technique
enhanced the DOF effect, giving something much closer to the look that we often
see in a movie. (See Figure 3.1.) Many techniques can be found on the web to
implement the bokeh effect, but in this chapter I will focus on the sprite-based
approach [Pettineo 11], applied to the Playstation 3 with a Synergistic Processing
Unit (SPU) twist! Instead of using the compute shader, geometry shader, or the
DrawInstancedIndirect call feature in the DX11 API, this chapter will explain
 
 
Search WWH ::




Custom Search