Drawing to custom attachments

Attachments allow you to draw to multiple targets at once. You can use them to implement deferred rendering, post-processing, etc.

This is the first time I’m showing the drawAdvanced function. It’s a more powerful version of draw that allows you to specify more options. We’ll go in depth in a later section.

Just know that any attachments you specify inside of drawAdvanced will be used as the render targets for the draw call. You can access them via out.attachmentX where x is the index of the attachment in the same order as the input attachment array.

Example

See the deferred rendering shadeup for a more complex example:

Loading null