Ocean
|
This class is the base class for all rendering framebuffers. More...
Data Structures | |
class | FramebufferConfig |
This class holds framebuffer configurations. More... | |
Public Member Functions | |
virtual FramebufferType | framebufferType () const =0 |
Returns the type of this framebuffer. More... | |
virtual const Scenes & | scenes () const |
Returns the scene connected with this framebuffer. More... | |
virtual const ViewRef & | view () const |
Returns the view connected with this framebuffer. More... | |
virtual void | viewport (unsigned int &left, unsigned int &top, unsigned int &width, unsigned int &height) const |
Returns the viewport of this framebuffer. More... | |
virtual FaceMode | faceMode () const |
Returns the global face mode of the entire framebuffer. More... | |
virtual CullingMode | cullingMode () const |
Returns the global face culling mode of the entire framebuffer. More... | |
virtual LightingMode | lightingMode () const |
Returns the global lighting mode of the entire framebuffer. More... | |
virtual RenderTechnique | renderTechnique () const |
Returns the render technique of the entire framebuffer. More... | |
virtual bool | isQuadbufferedStereoSupported () const |
Returns whether the framebuffer supports quad-buffered stereo views. More... | |
virtual bool | isAntialiasingSupported (const unsigned int buffers) const |
Returns whether the framebuffer supports hardware anti-aliasing. More... | |
virtual bool | isAntialiasing () const |
Returns whether the framebuffer uses hardware anti-aliasing. More... | |
virtual ShadowTechnique | shadowTechnique () const |
Returns the shadow technique of the entire framebuffer. More... | |
virtual HomogenousMatrix4 | device_T_display () const |
Returns the transformation between display and device. More... | |
virtual bool | verticalSynchronization () const |
Returns whether the framebuffer is synchronized with the vertical sync signal of the display device. More... | |
virtual std::string | extensions () const |
Returns all supported extensions of this framebuffer. More... | |
virtual bool | hasExtension (const std::string &extension) const |
Returns whether the framebuffer and thus e.g. More... | |
virtual void | addScene (const SceneRef &scene) |
Adds a new scene to the framebuffer. More... | |
virtual void | removeScene (const SceneRef &scene) |
Removes a scene from the framebuffer. More... | |
virtual void | clearScenes () |
Clears all scenes registered at the framebuffer. More... | |
virtual void | setView (const ViewRef &view) |
Connects a view with this framebuffer. More... | |
virtual void | setViewport (const unsigned int left, const unsigned int top, const unsigned int width, const unsigned int height) |
Sets the viewport of this framebuffer. More... | |
virtual void | setPreferredPixelFormat (const FrameType::PixelFormat pixelFormat) |
Sets the preferred pixel format of this framebuffer. More... | |
virtual void | setFaceMode (const FaceMode faceMode) |
Sets the global face mode of the entire framebuffer. More... | |
virtual void | setCullingMode (const CullingMode cullingMode) |
Sets the global culling mode of the entire framebuffer. More... | |
virtual void | setLightingMode (const LightingMode lightingMode) |
Sets the global lighting mode of the entire framebuffer. More... | |
virtual void | setRenderTechnique (const RenderTechnique technique) |
Sets the rendering technique of the entire framebuffer. More... | |
virtual bool | setSupportQuadbufferedStereo (const bool enable) |
Sets whether this framebuffer will support quad-buffered stereo views. More... | |
virtual bool | setSupportAntialiasing (const unsigned int buffers) |
Sets whether this framebuffer will support hardware anti-aliasing. More... | |
virtual bool | setAntialiasing (const bool antialiasing) |
Sets whether the framebuffer uses hardware anti-aliasing. More... | |
virtual void | setShadowTechnique (const ShadowTechnique technique) |
Sets the shadow technique of the entire framebuffer. More... | |
virtual bool | setDevice_T_display (const HomogenousMatrix4 &device_T_display) |
Sets the transformation between display and device. More... | |
virtual void | setVerticalSynchronization (const bool synchronize) |
Sets whether the framebuffer will is synchronized with the vertical sync signal of the display device. More... | |
void | setPreRenderCallback (const RenderCallback &renderCallback) |
Sets an optional callback function for pre-render events. More... | |
void | setPostRenderCallback (const RenderCallback &renderCallback) |
Sets an optional callback function for pre-render events. More... | |
virtual void | render () |
Renders the next frame into the framebuffer. More... | |
virtual bool | render (Frame &frame, Frame *depthFrame=nullptr) |
Renders the next frame and copies the image content into to a given frame. More... | |
virtual bool | intersection (const Line3 &ray, RenderableRef &renderable, Vector3 &position) |
Returns the renderable object intersected by a given ray. More... | |
virtual void | makeCurrent () |
Makes this framebuffer to the current one. More... | |
virtual void | makeNoncurrent () |
Makes this framebuffer to non current. More... | |
virtual bool | linearizeDepthFrame (Frame &depthFrame, const Scalar nearDistance, const Scalar farDistance) const |
Linearizes a given z-buffer depth frame with non-linear (e.g., logarithmic) depth. More... | |
ObjectType | type () const override |
Returns the type of this object. More... | |
Lock & | lock () const |
Returns the lock object of this engine. More... | |
Public Member Functions inherited from Ocean::Rendering::Object | |
ObjectId | id () const |
Returns the unique object id of this object. More... | |
const std::string & | name () const |
Returns the name of this object. More... | |
virtual void | setName (const std::string &name) |
Sets or changes the name of this object. More... | |
virtual const std::string & | engineName () const =0 |
Returns the name of the owner engine. More... | |
ObjectRefs | parentObjects () const |
Returns all parent objects. More... | |
ObjectRefSet | parentNodes () const |
Returns all parent nodes. More... | |
virtual std::string | descriptiveInformation () const |
Returns descriptive information about the object as string. More... | |
Protected Member Functions | |
Framebuffer () | |
Creates a new framebuffer. More... | |
~Framebuffer () override | |
Destructs a framebuffer. More... | |
virtual bool | initialize (const FramebufferRef &shareFramebuffer=FramebufferRef()) |
Initializes the framebuffer. More... | |
virtual void | release () |
Releases the framebuffer. More... | |
Protected Member Functions inherited from Ocean::Rendering::Object | |
Object () | |
Creates a new object. More... | |
Object (const Object &object)=delete | |
Disabled copy constructor. More... | |
virtual | ~Object () |
Destructs an object. More... | |
Engine & | engine () const |
Returns the render engine which is owner of this object. More... | |
void | registerParent (const ObjectId parentId) |
Registers a parent node for this (child) node. More... | |
void | unregisterParent (const ObjectId parentId) |
Unregisters a parent node for this (child) node. More... | |
void | registerThisObjectAsParent (const ObjectRef &child) |
Registers this object at a child as parent object. More... | |
void | unregisterThisObjectAsParent (const ObjectRef &child) |
Unregisters this object from a child as parent. More... | |
Object & | operator= (const Object &object)=delete |
Disabled copy operator. More... | |
Protected Attributes | |
Scenes | framebufferScenes |
Scenes registered at the framebuffer. More... | |
ViewRef | framebufferView |
View connected with the framebuffer. More... | |
RenderCallback | preRenderCallback_ |
Optional callback function for pre-render events. More... | |
RenderCallback | postRenderCallback_ |
Optional callback function for post-render events. More... | |
Protected Attributes inherited from Ocean::Rendering::Object | |
Lock | objectLock |
Lock for the object. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Ocean::Rendering::Object | |
static std::string | translateObjectType (const ObjectType objectType) |
Translates an object type to a readable string. More... | |
This class is the base class for all rendering framebuffers.
The framebuffer holds the view, the scene and is able to render frames respectively.
A framebuffer instance can be received from the associated engine instance.
Definition of different rendering face culling modes.
These modes correspond to those defined in PrimitiveAttribute except the meaning of the default culling mode.
The default culling mode gives the responsibility to the renderable object themselves, and does not overwrite the global state.
Definition of different rendering face modes.
These modes correspond to those defined in PrimitiveAttribute except the meaning of the default mode.
The default face mode gives the responsibility to the renderable object themselves, and does not overwrite the global state.
Definition of different face lighting modes.
These modes correspond to those defined in PrimitiveAttribute except the meaning of the default lighting mode.
The default culling mode gives the responsibility to the renderable object themselves, and does not overwrite the global state.
Definition of different rendering phantom modes.
These modes correspond to those defined in PhantomMode except the meaning of the default culling mode.
The default culling mode gives the responsibility to the renderable objects themselves, and does not overwrite the global state.
typedef Callback<void, const size_t, const HomogenousMatrix4, const SquareMatrix4, const Timestamp> Ocean::Rendering::Framebuffer::RenderCallback |
Definition of a callback function for render events.
This callback can be used to apply custom render calls if necessary. First parameter (eyeIndex): The index of the framebuffer (eye) to be rendered, will always be 0 in a mono view Second parameter (view_T_world): The current transformation between world and the current view (camera/eye), also known as viewing matrix Third parameter (projection): The projection matrix of the view (eye) Fourth parameter (predictedDisplayTime): The predicted timestamp when the image will be display
|
protected |
Creates a new framebuffer.
|
overrideprotected |
Destructs a framebuffer.
|
virtual |
Adds a new scene to the framebuffer.
scene | The scene to add |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer.
|
virtual |
Clears all scenes registered at the framebuffer.
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer.
|
virtual |
Returns the global face culling mode of the entire framebuffer.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
virtual |
Returns the transformation between display and device.
Reimplemented in Ocean::Rendering::GLESceneGraph::QT::GLESWindowFramebuffer, and Ocean::Rendering::GLESceneGraph::Apple::GLESWindowFramebuffer.
|
virtual |
Returns all supported extensions of this framebuffer.
NotSupportedException | Is thrown if this function is not supported |
|
virtual |
Returns the global face mode of the entire framebuffer.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
pure virtual |
Returns the type of this framebuffer.
Implemented in Ocean::Rendering::WindowFramebuffer, and Ocean::Rendering::BitmapFramebuffer.
|
virtual |
Returns whether the framebuffer and thus e.g.
the platform supports a specific extension.
extension | The extension to check, must be valid |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
protectedvirtual |
Initializes the framebuffer.
shareFramebuffer | Optional framebuffer to share resources with |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIBitmapFramebuffer, Ocean::Rendering::GLESceneGraph::Windows::GLESBitmapFramebuffer, Ocean::Rendering::GLESceneGraph::GLESFramebuffer, Ocean::Rendering::GLESceneGraph::Apple::GLESBitmapFramebuffer, and Ocean::Rendering::BitmapFramebuffer.
|
virtual |
Returns the renderable object intersected by a given ray.
ray | Intersection ray |
renderable | Resulting renderable object intersected by the given ray, if any |
position | Resulting intersection point on the renderable object |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
virtual |
Returns whether the framebuffer uses hardware anti-aliasing.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, Ocean::Rendering::GLESceneGraph::Windows::GLESWindowFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
virtual |
Returns whether the framebuffer supports hardware anti-aliasing.
buffers | Number of buffers to be checked |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, Ocean::Rendering::GLESceneGraph::Windows::GLESWindowFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
virtual |
Returns whether the framebuffer supports quad-buffered stereo views.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer.
|
virtual |
Returns the global lighting mode of the entire framebuffer.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIWindowFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
virtual |
Linearizes a given z-buffer depth frame with non-linear (e.g., logarithmic) depth.
depthFrame | The non-linear depth to linearize, must be valid |
nearDistance | The distance to the near clipping plane of the depth frame, with range (0, infinity) |
farDistance | The distance to the far clipping plane of the depth frame, with range (nearDistance, infinity) |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
inline |
Returns the lock object of this engine.
Beware: Use this lock with caution.
|
virtual |
Makes this framebuffer to the current one.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, Ocean::Rendering::GLESceneGraph::Windows::GLESWindowFramebuffer, Ocean::Rendering::GLESceneGraph::Windows::GLESBitmapFramebuffer, and Ocean::Rendering::GLESceneGraph::Apple::GLESBitmapFramebuffer.
|
virtual |
Makes this framebuffer to non current.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, Ocean::Rendering::GLESceneGraph::Windows::GLESBitmapFramebuffer, and Ocean::Rendering::GLESceneGraph::Apple::GLESBitmapFramebuffer.
|
protectedvirtual |
Releases the framebuffer.
This function will be called one before the framebuffer will be destroyed.
Reimplemented in Ocean::Rendering::GlobalIllumination::GIWindowFramebuffer, Ocean::Rendering::GlobalIllumination::GIFramebuffer, Ocean::Rendering::GLESceneGraph::Windows::GLESWindowFramebuffer, Ocean::Rendering::GLESceneGraph::Windows::GLESBitmapFramebuffer, Ocean::Rendering::GLESceneGraph::Quest::OpenXR::GLESWindowFramebuffer, Ocean::Rendering::GLESceneGraph::GLESFramebuffer, and Ocean::Rendering::GLESceneGraph::Apple::GLESBitmapFramebuffer.
|
virtual |
Removes a scene from the framebuffer.
scene | The scene to remove |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer.
|
virtual |
Renders the next frame into the framebuffer.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIWindowFramebuffer, Ocean::Rendering::GlobalIllumination::GIFramebuffer, Ocean::Rendering::GLESceneGraph::Windows::GLESWindowFramebuffer, Ocean::Rendering::GLESceneGraph::Windows::GLESBitmapFramebuffer, Ocean::Rendering::GLESceneGraph::Quest::OpenXR::GLESWindowFramebuffer, Ocean::Rendering::GLESceneGraph::QT::GLESWindowFramebuffer, Ocean::Rendering::GLESceneGraph::GLESFramebuffer, and Ocean::Rendering::GLESceneGraph::Apple::GLESBitmapFramebuffer.
|
virtual |
Renders the next frame and copies the image content into to a given frame.
frame | The frame receiving the image content, will be modified if the frame is invalid or if the frame type does not match |
depthFrame | Optional resulting depth frame, nullptr if not of interest |
Reimplemented in Ocean::Rendering::GLESceneGraph::Windows::GLESBitmapFramebuffer, and Ocean::Rendering::GLESceneGraph::Apple::GLESBitmapFramebuffer.
|
virtual |
Returns the render technique of the entire framebuffer.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
virtual |
Returns the scene connected with this framebuffer.
|
virtual |
Sets whether the framebuffer uses hardware anti-aliasing.
The framebuffer must support anti-aliasing to set this option.
antialiasing | True, if so |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
virtual |
Sets the global culling mode of the entire framebuffer.
This culling mode can be used to overwrite the individual modes of all renderable nodes.
cullingMode | Global culling mode to set |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
virtual |
Sets the transformation between display and device.
device_T_display | The transformation between display and device, must be valid |
Reimplemented in Ocean::Rendering::GLESceneGraph::QT::GLESWindowFramebuffer, and Ocean::Rendering::GLESceneGraph::Apple::GLESWindowFramebuffer.
|
virtual |
Sets the global face mode of the entire framebuffer.
This face mode can be used to overwrite the individual modes of all renderable nodes.
faceMode | Global face mode to set |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GLESceneGraph::GLESFramebuffer, and Ocean::Rendering::GlobalIllumination::GIFramebuffer.
|
virtual |
Sets the global lighting mode of the entire framebuffer.
This lighting mode can be used to overwrite the individual modes of all renderable nodes.
lightingMode | Global lighting mode to set |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIWindowFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
inline |
Sets an optional callback function for pre-render events.
The callback function will be invoked after the scene graph content has been rendered into the framebuffer.
renderCallback | The callback function to be set, an invalid object to remove a previously registered callback |
|
virtual |
Sets the preferred pixel format of this framebuffer.
This value should be defined before initialization during e.g. a window context.
Beware: There is no guarantee that this pixel format can be provides by the underlying hardware!
pixelFormat | The preferred pixel format used for rendering |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GLESceneGraph::Windows::GLESWindowFramebuffer.
|
inline |
Sets an optional callback function for pre-render events.
The callback function will be invoked after the framebuffer has been cleared but before the scene graph content is rendered into the framebuffer.
renderCallback | The callback function to be set, an invalid object to remove a previously registered callback |
|
virtual |
Sets the rendering technique of the entire framebuffer.
technique | Render technique to set |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
virtual |
Sets the shadow technique of the entire framebuffer.
technique | Shadow technique to set |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIWindowFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
virtual |
Sets whether this framebuffer will support hardware anti-aliasing.
Beware: Set this option once before initialization
buffers | Number of buffers used for anti-aliasing |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, and Ocean::Rendering::GLESceneGraph::Windows::GLESWindowFramebuffer.
|
virtual |
Sets whether this framebuffer will support quad-buffered stereo views.
Beware: Set this option once before initialization
enable | True, if quad-buffered stereo views will be supported |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer.
|
virtual |
Sets whether the framebuffer will is synchronized with the vertical sync signal of the display device.
synchronize | True, if so |
NotSupportedException | Is thrown if this function is not supported |
|
virtual |
Connects a view with this framebuffer.
view | The view to set |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer.
|
virtual |
Sets the viewport of this framebuffer.
left | New left position of the framebuffer in pixel |
top | New top position of the framebuffer in pixel |
width | New width of the framebuffer in pixel |
height | New height of the framebuffer in pixel |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, Ocean::Rendering::GLESceneGraph::Windows::GLESBitmapFramebuffer, Ocean::Rendering::GLESceneGraph::GLESFramebuffer, and Ocean::Rendering::GLESceneGraph::Apple::GLESBitmapFramebuffer.
|
virtual |
Returns the shadow technique of the entire framebuffer.
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIWindowFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
overridevirtual |
Returns the type of this object.
Reimplemented from Ocean::Rendering::Object.
Reimplemented in Ocean::Rendering::WindowFramebuffer.
|
virtual |
Returns whether the framebuffer is synchronized with the vertical sync signal of the display device.
NotSupportedException | Is thrown if this function is not supported |
|
virtual |
|
virtual |
Returns the viewport of this framebuffer.
left | Resulting left framebuffer position in pixel |
top | Resulting top framebuffer position in pixel |
width | Resulting framebuffer width in pixel |
height | Resulting framebuffer height in pixel |
NotSupportedException | Is thrown if this function is not supported |
Reimplemented in Ocean::Rendering::GlobalIllumination::GIFramebuffer, and Ocean::Rendering::GLESceneGraph::GLESFramebuffer.
|
protected |
Scenes registered at the framebuffer.
|
protected |
View connected with the framebuffer.
|
protected |
Optional callback function for post-render events.
|
protected |
Optional callback function for pre-render events.