Offscreen render location backed by a texture. More...
#include <Target.hpp>
Public Member Functions | |
Target (const Tag &tag) | |
virtual void | attach () |
virtual int | getSize () const |
string | toString () const |
Protected Member Functions | |
void | associate () |
Private Attributes | |
Texture2D * | texture |
string | link |
Offscreen render location backed by a texture.
Attaches itself to a color attachment of a Framebuffer. When the framebuffer is active, any rendering done to that attachment will be stored in the Texture referenced by the target. Thus, results of one rendering pass can be referenced in a later one.
Multiple targets can be added to one framebuffer. The framebuffer will assign them sequential indices ranging from 0 to GL_MAX_COLOR_ATTACHMENTS. The built-in (but deprecated) gl_FragData array references these attachments directly, but Bind can be used to assign user-defined out variables to the attachments.
XML Name
XML Attributes
name | User-defined name that can be referenced by other nodes. |
link | Name of the texture that backs the render target. |
XML Example
<texture name="layer0" > <texture name="layer1" > <framebuffer> <target link="layer0" /> <target link="layer1" /> </framebuffer> </texture> </texture>
Notes
void associate | ( | ) | [protected, virtual] |
Finds the framebuffer and texture to use.
NodeException | if cannot find texture with correct name. | |
NodeException | from Attachment::associate(). |
Reimplemented from Attachment.
void attach | ( | ) | [virtual] |
Attaches the target's texture to the framebuffer.
Implements Attachment.
int getSize | ( | ) | const [inline, virtual] |
string toString | ( | ) | const [virtual] |
Reimplemented from Attachment.