7 #ifndef PXR_IMAGING_GLF_DRAW_TARGET_H
8 #define PXR_IMAGING_GLF_DRAW_TARGET_H
59 bool requestMSAA =
false );
70 static GlfDrawTargetRefPtr
New( GlfDrawTargetPtr
const & drawtarget );
109 GLuint samplerName)
override;
125 void _DeleteTexture();
138 unsigned int _numSamples;
185 bool HasMSAA()
const {
return (_numSamples > 1); }
215 static void Resolve(
const std::vector<GlfDrawTarget*>& drawTargets);
227 bool IsValid(std::string * reason = NULL);
249 void _GenFrameBuffer();
257 void _DeleteAttachments( );
261 bool _Validate(std::string * reason = NULL);
263 void _SaveBindingState();
265 void _RestoreBindingState();
272 GLuint _unbindRestoreReadFB,
273 _unbindRestoreDrawFB;
279 unsigned int _numSamples;
288 #endif // GLF_DRAW_TARGET_H
GLF_API bool WriteToFile(std::string const &name, std::string const &filename, GfMatrix4d const &viewMatrix=GfMatrix4d(1), GfMatrix4d const &projectionMatrix=GfMatrix4d(1))
Write the Attachment buffer to an image file (debugging).
bool HasMSAA() const
Returns if the draw target uses msaa.
GLF_API GlfDrawTarget(GfVec2i const &size, bool requestMSAA)
GLF_API AttachmentsMap const & GetAttachments() const
Returns the list of Attachments for this DrawTarget.
GT_API const UT_StringHolder filename
GLF_API void TouchContents()
GLF_API AttachmentRefPtr GetAttachment(std::string const &name)
Returns the attachment with a given name or TfNullPtr;.
std::map< std::string, AttachmentRefPtr > AttachmentsMap
GLF_API void ResizeTexture(const GfVec2i &size)
Resize the attachment recreating the texture.
TfDeclarePtrs< class Attachment >::RefPtr AttachmentRefPtr
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_AND_REF_PTRS(GlfDrawTarget)
GLF_API void SetSize(GfVec2i)
Resize the DrawTarget.
GLboolean GLboolean GLboolean GLboolean a
static GLF_API AttachmentRefPtr New(int glIndex, GLenum format, GLenum type, GLenum internalFormat, GfVec2i size, unsigned int numSamples)
GLF_API GLuint GetFramebufferMSId() const
Returns the id of the framebuffer object with MSAA buffers.
GLF_API void Unbind()
Unbinds the framebuffer.
GLF_API BindingVector GetBindings(TfToken const &identifier, GLuint samplerName) override
GLenum GetFormat() const
Returns the GL format of the texture (GL_RGB, GL_DEPTH_COMPONENT...)
AttachmentsMap attachments
GLsizei GLenum internalFormat
int GetAttach() const
Returns the GL attachment point index in the framebuffer.
GLint GLint GLsizei GLint GLenum GLenum type
GLF_API bool IsValid(std::string *reason=NULL)
GLenum GetInternalFormat() const
Returns the GL internalFormat of the texture.
GLF_API VtDictionary GetTextureInfo(bool forceLoad) override
GLint GLint GLsizei GLint GLenum format
GLuint GetGlTextureName() override
Returns the GL texture index (can be used as any regular GL texture)
GLF_API bool IsBound() const
Returns whether the framebuffer is currently bound.
GLF_API ~Attachment() override
GLuint const GLchar * name
TfDeclarePtrs< class Attachment >::RefPtr AttachmentRefPtr
GLF_API GLuint GetFramebufferId() const
Returns the framebuffer object Id.
std::shared_ptr< class GlfGLContext > GlfGLContextSharedPtr
GLenum GetType() const
Returns the GL type of the texture (GL_BYTE, GL_INT, GL_FLOAT...)
GLF_API void CloneAttachments(GlfDrawTargetPtr const &drawtarget)
Copies the list of attachments from DrawTarget.
GLF_API void TouchContents()
GfVec2i const & GetSize() const
Returns the size of the DrawTarget.
static GLF_API GlfDrawTargetRefPtr New(GfVec2i const &size, bool requestMSAA=false)
Returns a new instance.
virtual GLF_API ~GlfDrawTarget()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
GLF_API void ClearAttachments()
Clears all the attachments for this DrawTarget.
#define PXR_NAMESPACE_CLOSE_SCOPE
GLF_API void AddAttachment(std::string const &name, GLenum format, GLenum type, GLenum internalFormat)
Add an attachment to the DrawTarget.
GLF_API void Bind()
Binds the framebuffer.
IMF_EXPORT int numSamples(int s, int a, int b)
GLF_API void DeleteAttachment(std::string const &name)
Removes the named attachment from the DrawTarget.
std::vector< Binding > BindingVector
GLuint GetGlTextureMSName() const
Returns the GL texture index multisampled of this attachment.