![]() |
VR-Forces 5.0.3 Developer's Guide
|
A helper classes for creating a RTT target, optionally including depth buffer.
Public Member Functions | |
| DtGlRenderTexture (const DtGlRenderTextureInitializer &initializer) | |
| virtual | ~DtGlRenderTexture () |
| virtual bool | init (DtGlImageType colorFormat=RGB32F, GLenum minFilter=GL_LINEAR, GLenum wrapMode=GL_CLAMP_TO_EDGE) |
| virtual bool | init (unsigned int glColorTexId) |
| virtual bool | initDepth (DtGlImageType depthFormat=D32) |
| virtual bool | initDepth (unsigned int glDepthTexId) |
| virtual void | activateForDrawingInto (bool shouldClear=true, bool setViewport=true) |
| virtual void | copyFromFramebuffer (unsigned int srcFbo, unsigned int bufferBits) |
| virtual void | copyFromTexture (unsigned int srcTexture, bool isDepth, bool isArray=false, unsigned int srclayer=0, unsigned int layerCount=1) |
| virtual void | deactivateForDrawingInto () |
| virtual void | setFboTextureLayer (unsigned int layer) |
| virtual void | bindColorTexture (int unit) |
| virtual void | bindDepthTexture (int unit) |
| virtual void | unbindColorTexture (int unit) |
| virtual void | unbindDepthTexture (int unit) |
| virtual int | width () const |
| virtual int | height () const |
| virtual int | layers () const |
| virtual unsigned int | colorId () const |
| virtual unsigned int | depthId () const |
| virtual int | numSamples () const |
| virtual bool | useMultiView () const |
| virtual bool | usingStencil () const |
| virtual void | setDeleteFbosOnDestruction (bool val) |
| virtual bool | deleteFbosOnDestruction (void) const |
| virtual DtGlFboAndContext | fbo (void) const |
| virtual DtGlFboAndContext | multiSampleFbo (void) const |
Protected Member Functions | |
| virtual bool | hasColorTexture (void) const |
| virtual void | attemptToDeleteFbo (DtGlFboAndContext &fbo) |
| virtual void | initFBO (const std::string &name) |
| virtual GLenum | getGLInternalTypes (DtGlImageType colorType) |
Protected Attributes | |
| DtGlFboAndContext | myFboId |
| DtGlFboAndContext | myMultisampleFboId |
| unsigned int | myMultisampleColorBuffer |
| unsigned int | myMultisampleDepthBuffer |
| bool | myDeleteFbosOnDestruction |
| int | myWidth |
| int | myHeight |
| int | myLayers |
| bool | myHasDepth |
| bool | myIsFrameBufferValid |
| bool | myUseMultiView |
| DtGlTexture * | myColorTexture = nullptr |
| DtGlTexture * | myDepthTexture = nullptr |
| std::string | myName |
| int | myNumSamples |
Private Member Functions | |
| DtGlRenderTexture () | |
| DtGlRenderTexture (const DtGlRenderTexture &) | |
| DtGlRenderTexture & | operator= (const DtGlRenderTexture &) |
|
private |
private default constructor
|
private |
prevent copy-construction
| makVrv::DtGlRenderTexture::DtGlRenderTexture | ( | const DtGlRenderTextureInitializer & | initializer | ) |
create a RTT with a given name, with a given height and width if number of samples is greater than 0 then it will use a multisample render buffer
|
virtual |
DTOR.
|
private |
prevent assignment
|
virtual |
initialize the RTT with a texture format and sampling/wrapping hints
Initialize the RTT color from an existing OpenGL Texture. Assumes the texture sampling and wrapping hints have already been setup. If DtGlRenderTexture was created with multiple samples, this texture needs to match.
|
virtual |
Optionally create a depth texture to go with the RTT that is bound when drawing into.
Initialize depth texture from an existing OpenGL texture. Assumes the texture sampling and wrapping hints have already been setup.
|
virtual |
activate this RTT for drawing into. Binds the internal FBO and color/depth targets
|
virtual |
copy the framebuffer specified by srcFbo into the textures in this object. buffer bits are the GL mask of which buffers to copy (GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT for example)
|
virtual |
copy the srcTexture into our color texture or depth texture if isDepth is true.
|
virtual |
deactivates the RTT
set the fbo texture layer, only useful for texture arrays
|
virtual |
bind the color texture to a given texture unit for use as a source texture for rendering
|
virtual |
bind the depth texture, if it exists, to a given texture unit for use as a source for rendering
|
virtual |
unbind the color texture (set the currently bound texture to 0 for the specified unit
|
virtual |
unbind the depth texture (set the currently bound texture to 0 for the specified unit
|
virtual |
returns width of the RTT
|
virtual |
returns height of the RTT
|
virtual |
returns layers of the RTT
returns the OpenGL texture id of the color texture. Must be initialized first otherwise it will return 0.
returns the OpenGL texture id of the depth texture. Must be initialized first otherwise it will return 0.
|
virtual |
returns the number of multi samples to use with this render to texture
|
virtual |
return weather or not multiview is being used
|
virtual |
return true if there's a depth texture and it's using a packed stencil format
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
protectedvirtual |
helper
|
protectedvirtual |
helper
|
protectedvirtual |
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |