OpenWalnut
1.3.1
|
This type of node basically is a convenience class for managing and creating offscreen renderings. More...
#include <WGEOffscreenRenderNode.h>
Public Types | |
typedef osg::ref_ptr < WGEOffscreenRenderNode > | RefPtr |
Convenience typedef for an osg::ref_ptr. | |
typedef osg::ref_ptr< const WGEOffscreenRenderNode > | ConstRefPtr |
Convenience typedef for an osg::ref_ptr; const. | |
![]() | |
typedef WPredicateHelper::ArbitraryPredicateBase < osg::ref_ptr< osg::Node > const > | NodePredicate |
The base type of predicate. |
Public Member Functions | |
WGEOffscreenRenderNode (osg::ref_ptr< osg::Camera > reference, size_t width=2048, size_t height=2048, bool noHud=false) | |
Create a new managing instance. | |
virtual | ~WGEOffscreenRenderNode () |
Destructor. | |
osg::ref_ptr< WGETextureHud > | getTextureHUD () const |
Returns the instance of the texture HUD. | |
virtual osg::ref_ptr < WGEOffscreenRenderPass > | addGeometryRenderPass (osg::ref_ptr< osg::Node > node, std::string name="Unnamed") |
Creates a new offscreen-render-pass coupled with the reference camera which renders a specified OSG graph to a texture. | |
virtual osg::ref_ptr < WGEOffscreenRenderPass > | addGeometryRenderPass (osg::ref_ptr< osg::Node > node, osg::ref_ptr< WGEShader > shader, std::string name="Unnamed") |
Creates a new offscreen-render-pass coupled with the reference camera which renders a specified OSG graph to a texture. | |
virtual osg::ref_ptr < WGEOffscreenTexturePass > | addTextureProcessingPass (std::string name="Unnamed") |
Creates a new offscreen-render-pass coupled with the reference camera which simply processes textures. | |
virtual osg::ref_ptr < WGEOffscreenTexturePass > | addTextureProcessingPass (osg::ref_ptr< WGEShader > shader, std::string name="Unnamed") |
Creates a new offscreen-render-pass coupled with the reference camera which simply processes textures. | |
virtual osg::ref_ptr < WGEOffscreenFinalPass > | addFinalOnScreenPass (std::string name="Unnamed") |
Creates a new render pass which can be seen as put-textures-back-on-screen-pass. | |
virtual osg::ref_ptr < WGEOffscreenFinalPass > | addFinalOnScreenPass (osg::ref_ptr< WGEShader > shader, std::string name="Unnamed") |
Creates a new render pass which can be seen as put-textures-back-on-screen-pass. | |
template<typename T > | |
osg::ref_ptr< T > | addRenderPass (std::string name="Unnamed") |
Creates a new offscreen-render-pass coupled with the reference camera. | |
![]() | |
WGEGroupNode () | |
Default constructor. | |
void | insert (osg::ref_ptr< osg::Node > node) |
Adds the specified node to the child list of this node in a safe manner. | |
void | remove (osg::ref_ptr< osg::Node > node) |
Removes the specified node from this group in a thread safe manner. | |
void | remove_if (boost::shared_ptr< WGEGroupNode::NodePredicate > predicate) |
Removes a node if the specified predicate evaluates to true. | |
void | clear () |
Removes all children from this node. |
Private Attributes | |
osg::ref_ptr< osg::Camera > | m_referenceCamera |
The camera to which is used for setting this camera up. | |
osg::ref_ptr< WGETextureHud > | m_hud |
The pointer to the hud used to render all used texture buffers. | |
size_t | m_textureWidth |
The width of each texture in this offscreen rendering. | |
size_t | m_textureHeight |
The height of each texture in this offscreen rendering. | |
size_t | m_nextPassNum |
The number of the next pass getting added. |
Additional Inherited Members | |
![]() | |
enum | ChildOperationType { INSERT = 0, REMOVE, REMOVE_IF, CLEAR } |
The type of operation to perform. More... | |
![]() | |
virtual | ~WGEGroupNode () |
Destructor. | |
![]() | |
osg::ref_ptr< SafeUpdaterCallback > | m_nodeUpdater |
Node callback used to update this root node. | |
std::queue< boost::shared_ptr < ChildOperation > > | m_childOperationQueue |
Queue of childs that need to be added/removed during the next update cycle. | |
boost::shared_mutex | m_childOperationQueueLock |
Lock used for inserting and removing childs into the child insertion/removal queue. | |
bool | m_childOperationQueueDirty |
Flag denoting whether the m_childOperationQueue should be considered during the next update of the node. | |
bool | m_removeAll |
True whenever all child nodes should be removed. |
This type of node basically is a convenience class for managing and creating offscreen renderings.
The children of this node should be of type WGEOffscreenRenderPass. This class provides factories to create offscreen-render-pass instances with proper sizes with a coupling to a reference camera. This is useful to provide automatic viewport scaling etc. to each render-pass. You do not explicitly need this class to create offscreen-renderings at all. You can manually manage multiple WGEOffscreenRenderPass instances.
It is important to understand, that the graph (your scene) must not be a children of this node. This node can be placed somewhere in your scene. The OSG collects all the cameras (and offscreen-cameras) and render then independently from their position in the graph (except for transformations inherited from others).
Definition at line 54 of file WGEOffscreenRenderNode.h.
typedef osg::ref_ptr< const WGEOffscreenRenderNode > WGEOffscreenRenderNode::ConstRefPtr |
Convenience typedef for an osg::ref_ptr; const.
Definition at line 65 of file WGEOffscreenRenderNode.h.
typedef osg::ref_ptr< WGEOffscreenRenderNode > WGEOffscreenRenderNode::RefPtr |
Convenience typedef for an osg::ref_ptr.
Definition at line 60 of file WGEOffscreenRenderNode.h.
WGEOffscreenRenderNode::WGEOffscreenRenderNode | ( | osg::ref_ptr< osg::Camera > | reference, |
size_t | width = 2048 , |
||
size_t | height = 2048 , |
||
bool | noHud = false |
||
) |
Create a new managing instance.
It uses the specified camera as reference to all created offscreen-render-pass instances. Especially viewport, clear-mask and clear-color get used. The default texture resolution is 2048x2048 which is more than full-HD resolution. So it should be enough.
reference | camera used as reference |
width | the width of the textures used in this rendering. Must be in [8,4096] and a power of two. |
height | the height of the textures used in this rendering. Must be in [8,4096] and a power of two. |
noHud | If true, no hud gets displayed showing the created and used textures. |
Definition at line 43 of file WGEOffscreenRenderNode.cpp.
References WGEGroupNode::insert(), m_hud, and m_referenceCamera.
|
virtual |
Destructor.
Definition at line 63 of file WGEOffscreenRenderNode.cpp.
|
virtual |
Creates a new render pass which can be seen as put-textures-back-on-screen-pass.
It renders a full-screen quad to the on-screen frame-buffer. An optional shader can be used for final processing (most commonly clipping, blending, color-mapping and so on).
name | the name of the render pass. You should specify it to enable the nice debugging feature of WGETextureHud. |
Definition at line 100 of file WGEOffscreenRenderNode.cpp.
|
virtual |
Creates a new render pass which can be seen as put-textures-back-on-screen-pass.
It renders a full-screen quad to the on-screen frame-buffer. An optional shader can be used for final processing (most commonly clipping, blending, color-mapping and so on).
shader | the shader to add |
name | the name of the render pass. You should specify it to enable the nice debugging feature of WGETextureHud. |
Definition at line 106 of file WGEOffscreenRenderNode.cpp.
|
virtual |
Creates a new offscreen-render-pass coupled with the reference camera which renders a specified OSG graph to a texture.
node | the node which represents the subgraph. |
name | the name of the render pass. You should specify it to enable the nice debugging feature of WGETextureHud. |
Definition at line 68 of file WGEOffscreenRenderNode.cpp.
|
virtual |
Creates a new offscreen-render-pass coupled with the reference camera which renders a specified OSG graph to a texture.
node | the node which represents the subgraph. |
name | the name of the render pass. You should specify it to enable the nice debugging feature of WGETextureHud. |
shader | the shader to add. |
Definition at line 76 of file WGEOffscreenRenderNode.cpp.
osg::ref_ptr< T > WGEOffscreenRenderNode::addRenderPass | ( | std::string | name = "Unnamed" | ) |
Creates a new offscreen-render-pass coupled with the reference camera.
This pass actually does nothing. The method is useful for custom variants of WGEOffscreenRenderPass.
name | the name of the render pass. You should specify it to enable the nice debugging feature of WGETextureHud. |
T | the type of pass to create. |
Definition at line 210 of file WGEOffscreenRenderNode.h.
References WGEGroupNode::insert(), m_hud, m_nextPassNum, m_referenceCamera, m_textureHeight, and m_textureWidth.
|
virtual |
Creates a new offscreen-render-pass coupled with the reference camera which simply processes textures.
All the in- and output textures have to be specified manually.
name | the name of the render pass. You should specify it to enable the nice debugging feature of WGETextureHud. |
Definition at line 87 of file WGEOffscreenRenderNode.cpp.
|
virtual |
Creates a new offscreen-render-pass coupled with the reference camera which simply processes textures.
All the in- and output textures have to be specified manually.
name | the name of the render pass. You should specify it to enable the nice debugging feature of WGETextureHud. |
shader | the shader to add. |
Definition at line 93 of file WGEOffscreenRenderNode.cpp.
osg::ref_ptr< WGETextureHud > WGEOffscreenRenderNode::getTextureHUD | ( | ) | const |
Returns the instance of the texture HUD.
Definition at line 113 of file WGEOffscreenRenderNode.cpp.
References m_hud.
|
private |
The pointer to the hud used to render all used texture buffers.
This can be NULL. It gets distributed to all created render-pass instances.
Definition at line 191 of file WGEOffscreenRenderNode.h.
Referenced by addRenderPass(), getTextureHUD(), and WGEOffscreenRenderNode().
|
private |
The number of the next pass getting added.
Definition at line 206 of file WGEOffscreenRenderNode.h.
Referenced by addRenderPass().
|
private |
The camera to which is used for setting this camera up.
Definition at line 185 of file WGEOffscreenRenderNode.h.
Referenced by addRenderPass(), and WGEOffscreenRenderNode().
|
private |
The height of each texture in this offscreen rendering.
Definition at line 201 of file WGEOffscreenRenderNode.h.
Referenced by addRenderPass().
|
private |
The width of each texture in this offscreen rendering.
Definition at line 196 of file WGEOffscreenRenderNode.h.
Referenced by addRenderPass().