![]() |
VR-Forces 4.7 Class Documentation
|
A helper classes for creating a RTT target, optionally including depth buffer. More...
Public Types | |
| enum | ImageType { RGB8, RGBA8, RG16F, RGB16F, RGB32F, RGBA16F, RGBA32F, D16, D24, D32 } |
Public Member Functions | |
| DtGlRenderTexture (const std::string &name, int width, int height, int samples=0) | |
| 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 | ~DtGlRenderTexture () |
| DTOR. | |
| bool | init (ImageType colorFormat=RGB32F, GLenum minFilter=GL_LINEAR, GLenum wrapMode=GL_CLAMP_TO_EDGE) |
| initialize the RTT with a texture format and sampling/wrapping hints | |
| bool | initDepth (ImageType depthFormat=D32) |
| Optionally create a depth texture to go with the RTT that is bound when drawing into. | |
| void | activateForDrawingInto () |
| activate this RTT for drawing into. Binds the internal FBO and color/depth targets | |
| void | deactivateForDrawingInto () |
| deactivates the RTT | |
| void | bindColorTexture (int unit) |
| bind the color texture to a given texture unit for use as a source texture for rendering | |
| void | unbindColorTexture (int unit) |
| bind the depth texture, if it exists, to a given texture unit for use as a source for rendering | |
| int | width () const |
| returns width of the RTT | |
| int | height () const |
| returns height of the RTT | |
| unsigned int | colorId () const |
| returns the OpenGL texture id of the color texture. Must be initialized first otherwise it will return 0. | |
| unsigned int | depthId () const |
| returns the OpenGL texture id of the depth texture. Must be initialized first otherwise it will return 0. | |
| int | numSamples () const |
| returns the number of multi samples to use with this render to texture | |
Protected Member Functions | |
| void | initColorTexture (const std::string &name, GLenum minfilter, GLenum wrapMode) |
| void | initDepthBufferTexture (const std::string &name) |
| void | initFBO (const std::string &name) |
| GLenum | getGLInternalTypes (ImageType colorType) |
Protected Attributes | |
| unsigned int | myFboId |
| unsigned int | myMultisampleFboId |
| unsigned int | myMultisampleColorBuffer |
| unsigned int | myMultisampleDepthBuffer |
| unsigned int | myColorId |
| unsigned int | myDepthId |
| int | myWidth |
| int | myHeight |
| bool | myHasDepth |
| bool | myIsValid |
| GLenum | myColorFormat |
| GLenum | myDepthFormat |
| std::string | myName |
| int | myNumSamples |
Private Member Functions | |
| DtGlRenderTexture () | |
| private default constructor | |
| DtGlRenderTexture (const DtGlRenderTexture &) | |
| prevent copy-construction | |
| DtGlRenderTexture & | operator= (const DtGlRenderTexture &) |
| prevent assignment | |
A helper classes for creating a RTT target, optionally including depth buffer.
|
private |
private default constructor
|
private |
prevent copy-construction
| makVrv::DtGlRenderTexture::DtGlRenderTexture | ( | const std::string & | name, |
| int | width, | ||
| int | height, | ||
| int | samples = 0 |
||
| ) |
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
| bool makVrv::DtGlRenderTexture::init | ( | ImageType | colorFormat = RGB32F, |
| GLenum | minFilter = GL_LINEAR, |
||
| GLenum | wrapMode = GL_CLAMP_TO_EDGE |
||
| ) |
initialize the RTT with a texture format and sampling/wrapping hints
Optionally create a depth texture to go with the RTT that is bound when drawing into.
| void makVrv::DtGlRenderTexture::activateForDrawingInto | ( | ) |
activate this RTT for drawing into. Binds the internal FBO and color/depth targets
| void makVrv::DtGlRenderTexture::deactivateForDrawingInto | ( | ) |
deactivates the RTT
| void makVrv::DtGlRenderTexture::bindColorTexture | ( | int | unit | ) |
bind the color texture to a given texture unit for use as a source texture for rendering
| void makVrv::DtGlRenderTexture::unbindColorTexture | ( | int | unit | ) |
bind the depth texture, if it exists, to a given texture unit for use as a source for rendering
| int makVrv::DtGlRenderTexture::width | ( | ) | const |
returns width of the RTT
| int makVrv::DtGlRenderTexture::height | ( | ) | const |
returns height 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.
| int makVrv::DtGlRenderTexture::numSamples | ( | ) | const |
returns the number of multi samples to use with this render to texture
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |