For NPR: In order to detect the edges for an object/geometry, we can just apply a convolution filter on the depth buffer both vertically and horizontally. Then to compute the amount of edge at a given pixel, we take the difference of the neighboring pixels. However, to get the outlines in the background/scene, instead of the depth buffer, we need to look at the surface normals of the planes building the background. If the angle between the surface normals for each pixel is above a threshold value, it can be considered as a corner that needs to be outlined.
For Motion Blur: To achieve the motion blur effect we can simply composite the color buffers of 2 consecutive frames. In order to do this, one needs to store the color buffer of the previous frame. In this project the previous frame is stored as a texture to be used in the current frame. By giving different coefficients to these 2 frames, different amounts of motion blur can be achieved.
|