Graphics Reference
In-Depth Information
5. Another shader program is made current. This one is a 2D image filter-
ing program like we have seen before. It can do blur-sharpen or edge
detection. The texture unit into which we just rendered the 3D scene is
supplied to this program as uInUnit .
6. A quad is drawn. You know that it is drawing a 2D quad, but because it is
using the results of the previous 3D render as the quad's texture, the user
thinks that a 3D object is being drawn here.
7. The Filter2 shader changes the appearance of the 3D render.
Figure 9.13 shows this shader in action.
Figure 9.13. Render-to-texture and multipass in action: the original, unmodified, teapot
(top left); teapot with the noise turned on (top right); noise teapot, sharpened (botom left);
noise teapot, edge detected (botom right).
Search WWH ::




Custom Search