Image Component Library (ICL)
|
Scene Implementation that is used to handle a list of objects and cameras. More...
#include <Scene.h>
Classes | |
struct | PBufferIndex |
Public Types | |
enum | DepthBufferMode { RawDepth01, DistToCamPlane, DistToCamCenter } |
Public Types inherited from icl::utils::Configurable | |
typedef Function< void, const Property & > | Callback |
Function type for changed properties. More... | |
Public Member Functions | |
Scene () | |
Base constructor (creates an empty scene) More... | |
~Scene () | |
Destructor. More... | |
Scene (const Scene &scene) | |
Explicitly implemented deep copy (performs complete deep copy of all cameras and objects) More... | |
Scene & | operator= (const Scene &scene) |
Assignment operator (complete deep copy) More... | |
void | addCamera (const Camera &cam, float visSize=1.0) |
Adds a new Camera to the scene. More... | |
void | removeCamera (int index) |
removed the camera at given index More... | |
Camera & | getCamera (int camIndex=0) |
returns a reference to the i-th camera More... | |
const Camera & | getCamera (int camIndex=0) const |
returns the i-th scene camera More... | |
int | getCameraCount () const |
returns the count of contained cameras More... | |
std::vector< Camera * > | getAllCameras (int firstIndex=0, int num=-1) |
returns a vector with pointers to all cameras in given range More... | |
void | addObject (SceneObject *object, bool passOwnerShip=false) |
adds a new top-level object to the Scene instance More... | |
void | removeObject (int idx) |
removed object at given index More... | |
void | removeObject (const SceneObject *obj) |
removes given top-level object from scene (not recursive) More... | |
void | removeObjects (int startIndex, int endIndex=-1) |
removed object at given indices More... | |
int | getObjectCount () const |
returns the number of top-level objects More... | |
SceneObject * | getObject (int index) |
returns contained object at given index More... | |
const SceneObject * | getObject (int index) const |
returns contained object at given index (const) More... | |
SceneObject * | getObject (const std::vector< int > recursiveIndices) |
returns a child that is deeper in the scene graph More... | |
SceneObject * | getObject (const std::vector< int > recursiveIndices) const |
returns a child that is deeper in the scene graph (const) More... | |
std::vector< int > | findPath (const SceneObject *o) const |
finds the recursive indices for a given object. More... | |
void | clear (bool camerasToo=false) |
deletes and removes all objects, handlers and callbacks More... | |
qt::MouseHandler * | getMouseHandler (int camIndex=0) |
returns a mouse handler that adapts the scene's camera using mouse-interaction More... | |
void | setMouseHandler (SceneMouseHandler *sceneMouseHandler, int camIndex=0) |
registeres a custom SceneMouseHandler for given camera index More... | |
qt::ICLDrawWidget3D::GLCallback * | getGLCallback (int camIndex) |
returns a callback that is used to render the scene into a GL-context More... | |
const core::Img8u & | render (int camIndx, const core::ImgBase *background=0, core::Img32f *depthBuffer=0, DepthBufferMode mode=DistToCamCenter, bool fastRendering=false) |
void | setDrawCamerasEnabled (bool enabled) |
sets wheter cameras are also visualized in scenes. More... | |
bool | getDrawCamerasEnabled () const |
returns whether cameras are visualized More... | |
void | setDrawLightsEnabled (bool enabled, float lightSize=1) |
sets wheter lights are also visualized in scenes. More... | |
bool | getDrawLightsEnabled () const |
returns whether lights are visualized More... | |
void | setDrawCoordinateFrameEnabled (bool enabled, float size=120) |
sets wheter a coordinate frame is automatically inserted into the scene More... | |
bool | getDrawCoordinateFrameEnabled () const |
returns wheter a coordinate frame is automatically shown in the scene More... | |
void | setDrawObjectFramesEnabled (bool enabled, float size) |
sets whether all object frames are visualized More... | |
bool | getDrawObjectFramesEnabled () const |
returns whether object frames are visualized More... | |
void | setCursor (Vec newPosition) |
sets the Position of the cursor More... | |
Vec | getCursor () |
gets the Position of the cursor More... | |
void | activateCursor (bool activate=true) |
activate or deactivate the cursor More... | |
SceneLight & | getLight (int index) |
returns a reference to a light with given index More... | |
const SceneLight & | getLight (int index) const |
returns a const reference to a light with given index More... | |
void | setLightingEnabled (bool flag) |
sets whether OpenGL's lighting is globally activated More... | |
void | setGlobalAmbientLight (const GeomColor &color) |
this can be used to change OpenGL's global ambient light color More... | |
Hit | findObject (int camIndex, int xScreen, int yScreen) |
picks the closest contained scene-object clicked at given ScreenPosition More... | |
Hit | findObject (const ViewRay &v) |
picks the first object that is hit by the given viewray More... | |
std::vector< Hit > | findObjects (const ViewRay &v) |
retunrs all objects intersected by the given viewray More... | |
std::vector< Hit > | findObjects (int camIndex, int xScreen, int ySceen) |
retunrs all objects on that are intersected by the defined cameras viewray through given x and y More... | |
void | setBounds (float minX, float maxX=0, float minY=0, float mayY=0, float minZ=0, float maxZ=0) |
sets the expected bounds of contained objects More... | |
void | setBackgroundColor (const GeomColor &color) |
sets the scene's background color (alpha is not used) More... | |
GeomColor | getBackgroundColor () const |
returns the current background colo More... | |
virtual void | grab (PointCloudObjectBase &dst) |
implements the PointCloudGrabber interface More... | |
Public Member Functions inherited from icl::utils::Lockable | |
Lockable (bool recursive=false) | |
Default constructor. More... | |
Lockable (const Lockable &l) | |
copy constructor (does not copy the source mutex) More... | |
Lockable & | operator= (const Lockable &l) |
assignment operator (does not copy the source mutex) More... | |
~Lockable () | |
Destructor. More... | |
void | lock () const |
lock object More... | |
void | unlock () const |
unlock object More... | |
Mutex & | getMutex () const |
returns mutex of this object More... | |
Public Member Functions inherited from icl::geom::PointCloudGrabber | |
virtual | ~PointCloudGrabber () |
virtual, but empty destructor More... | |
virtual const core::Img32f * | getDepthImage () const |
returns the last grabbed point cloud's underlying depth image (if available) More... | |
virtual const core::Img8u * | getColorImage () const |
returns the last grabbed point cloud's underlying depth image (if available) More... | |
virtual Camera | getDepthCamera () const |
returns current depth camera (CAN be implemented by implementation More... | |
virtual Camera | getColorCamera () const |
virtual void | setCameraWorldFrame (const math::FixedMatrix< float, 4, 4 > &T) |
virtual void | reinit (const std::string &description) |
re-initializes the current device More... | |
Public Member Functions inherited from icl::utils::Configurable | |
virtual | ~Configurable () |
virtual destructor More... | |
Configurable (const Configurable &other) | |
Copy constructor. More... | |
Configurable & | operator= (const Configurable &other) |
Assignment operator. More... | |
void | setConfigurableID (const std::string &ID) |
sets the ID of this configurable More... | |
const std::string & | getConfigurableID () const |
returns the configurables static ID More... | |
bool | isOrderedFlagSet () const |
returns whether the ordered flag is set More... | |
void | deactivateProperty (const std::string &pattern) |
adds an additional deativation pattern More... | |
void | deleteDeactivationPattern (const std::string &pattern) |
removed a formerly added deactivation pattern More... | |
std::vector< std::string > | getPropertyListWithoutDeactivated () const |
this returns a filtered list of properties (using all filters added by deactivateProperty) More... | |
virtual void | adaptProperty (const std::string &name, const std::string &newType, const std::string &newInfo, const std::string &newToolTip) |
this function can be used to adapt a specific property afterwards More... | |
void | registerCallback (const Callback &cb) |
add a callback for changed properties More... | |
void | removedCallback (const Callback &cb) |
removes a callback that was registered before More... | |
void | syncChangesTo (Configurable *others, int num=1) |
this can be used to let this instance also apply property changes to others More... | |
virtual void | setPropertyValue (const std::string &propertyName, const Any &value) |
sets a property value More... | |
virtual std::vector< std::string > | getPropertyList () const |
returns a list of All properties, that can be set using setProperty More... | |
virtual bool | supportsProperty (const std::string &propertyName) const |
base implementation for property check (seaches in the property list) More... | |
virtual void | saveProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC) const |
writes all available properties into a file More... | |
virtual void | loadProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC) |
reads a camera config file from disc More... | |
virtual std::string | getPropertyType (const std::string &propertyName) const |
get type of property More... | |
virtual std::string | getPropertyInfo (const std::string &propertyName) const |
get information of a properties valid values More... | |
virtual Any | getPropertyValue (const std::string &propertyName) const |
returns the current value of a property or a parameter More... | |
virtual std::string | getPropertyToolTip (const std::string &propertyName) const |
returns the tooltip description for a given property More... | |
virtual int | getPropertyVolatileness (const std::string &propertyName) const |
Returns whether this property may be changed internally. More... | |
Public Attributes | |
icl::qt::GLFragmentShader * | m_shaders [ShaderUtil::COUNT] |
renders the current scene using an instance of pbuffer More... | |
RenderSettings * | m_renderSettings |
FBOData * | m_fboData |
Protected Member Functions | |
void | createDisplayList (SceneObject *o) const |
creates a displaylist for the given object More... | |
void | freeDisplayList (SceneObject *o) const |
frees the display list, that is associated with an object More... | |
void | renderScene (int camIndex, qt::ICLDrawWidget3D *widget=0) const |
internally used rendering method More... | |
void | renderShadow (const unsigned int light, const unsigned int shadow, unsigned int size, int camID) const |
renders the shadowmap More... | |
void | renderSceneObjectRecursiveShadow (ShaderUtil *util, SceneObject *o, int camID) const |
void | renderSceneObjectRecursive (SceneObject *o, int camID) const |
internally used rendering method for recursive rendering of the scene graph More... | |
void | renderSceneObjectRecursive (ShaderUtil *util, SceneObject *o, int camID) const |
internally used rendering method for recursive rendering of the scene graph More... | |
void | renderObjectFramesRecursive (SceneObject *o, SceneObject *cs, int camID) const |
recursively renders object frames for all scene objects More... | |
float | getMaxSceneDim () const |
internally used utility method that computes the extend of the Scene content More... | |
void | extendMaxSceneDimRecursive (float &minX, float &maxX, float &minY, float &maxY, float &minZ, float &maxZ, SceneObject *o) const |
recursive utility method More... | |
void | freeAllPBuffers () |
frees all pbuffers allocated before More... | |
void | freePBuffer (const utils::Size &size) |
frees the pbffer associated with given size (if there is one) More... | |
Protected Member Functions inherited from icl::utils::Configurable | |
void | addProperty (const std::string &name, const std::string &type, const std::string &info, const Any &value=Any(), const int volatileness=0, const std::string &tooltip=std::string()) |
This can be used by derived classes to store supported properties in the internal list. More... | |
void | addChildConfigurable (Configurable *configurable, const std::string &childPrefix="") |
This adds another configurable as child. More... | |
void | removeChildConfigurable (Configurable *configurable) |
removes the given child configurable More... | |
Property & | prop (const std::string &propertyName) |
this CAN be used e.g. to store a property value in internal property-list More... | |
const Property & | prop (const std::string &propertyName) const |
this CAN be used e.g. to store a property value in internal property-list More... | |
Configurable (const std::string &ID="", bool ordered=true) | |
create this configurable with given ID More... | |
void | call_callbacks (const std::string &propertyName, const Configurable *caller) const |
calls all registered callbacks More... | |
Protected Attributes | |
std::vector< Camera > | m_cameras |
internal list of cameras More... | |
std::vector< utils::SmartPtr< SceneObject > > | m_objects |
internal list of top-level objects More... | |
std::vector< utils::SmartPtr< SceneObject > > | m_cameraObjects |
internal list of top-level camera objects used for camera visualization More... | |
std::vector< utils::SmartPtr< SceneMouseHandler > > | m_mouseHandlers |
internally used list of mouse handlers More... | |
std::vector< utils::SmartPtr< GLCallback > > | m_glCallbacks |
internally used list of callbacks More... | |
std::map< PBufferIndex, PBuffer * > | m_pbuffers |
utils::SmartPtr< SceneObject > | m_coordinateFrameObject |
internally used scene object More... | |
utils::SmartPtr< SceneObject > | m_objectFrameObject |
also internally used object frame object More... | |
utils::SmartPtr< SceneLight > | m_lights [8] |
internal list of lights More... | |
utils::SmartPtr< SceneObject > | m_shadowCameraObjects [8] |
list of cameras for visualisation of shadowcameras More... | |
bool | m_previousLightState [8][4] |
previous lightstate More... | |
utils::SmartArray< utils::Range32f > | m_bounds |
optionally given bounds of the scene More... | |
math::FixedColVector< int, 4 > | m_globalAmbientLight |
global ambient light More... | |
GeomColor | m_backgroundColor |
current scene background color More... | |
utils::FPSEstimator | m_fps |
Protected Attributes inherited from icl::utils::Configurable | |
std::vector< Callback > | callbacks |
internally managed list of callbacks More... | |
Static Private Member Functions | |
static void | freeDisplayList (void *handle) |
called from the SceneObject class More... | |
Private Attributes | |
SceneObject * | m_cursor |
Friends | |
class | SceneObject |
make SceneObject friend of Scene More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from icl::utils::Configurable | |
static std::string | create_default_ID (const std::string &prefix) |
this function can be used in subclasses to create a default ID More... | |
static Configurable * | get (const std::string &id) |
returns configurable by given ID More... | |
static void | register_configurable_type (const std::string &classname, Function< Configurable * > creator) |
registers a configurable type More... | |
static std::vector< std::string > | get_registered_configurables () |
returns a list of all registered configurable classnames More... | |
static Configurable * | create_configurable (const std::string &classname) |
creates a configurable by given name More... | |
Static Public Attributes inherited from icl::utils::Configurable | |
static const std::vector< std::string > | EMPTY_VEC |
used as shortcut – just an empty vector of std::strings More... | |
Scene Implementation that is used to handle a list of objects and cameras.
The scene combines visual objects (icl::SceneObject) which define nodes of a scene graph and cameras. You can use ICL's camera calibration tool icl-cam-calib (and icl-cam-calib-2) to calibrate cameras in your scene. Later, you can define a scene (including SceneObject-instances) and use the calibrated camera to draw the Scene as an image overlay.
The following example demonstrates how to use the Scene class. The example can also be found at ICLGeom/examples/geom-demo-simple.cpp. A more complex demo that also uses the Scene's scene graph can be found at ICLGeom/examples/scene-graph-demo.cpp
Enumerator | |
---|---|
RawDepth01 | raw core::depth buffer in range [0,1] |
DistToCamPlane | core::depth buffer values define distance to the camera's z=0 plane |
DistToCamCenter | core::depth buffer values define distanct to the camera center |
icl::geom::Scene::Scene | ( | ) |
Base constructor (creates an empty scene)
icl::geom::Scene::~Scene | ( | ) |
Destructor.
icl::geom::Scene::Scene | ( | const Scene & | scene | ) |
Explicitly implemented deep copy (performs complete deep copy of all cameras and objects)
void icl::geom::Scene::activateCursor | ( | bool | activate = true | ) |
activate or deactivate the cursor
void icl::geom::Scene::addCamera | ( | const Camera & | cam, |
float | visSize = 1.0 |
||
) |
Adds a new Camera to the scene.
cam | which is copied into the scene |
visSize | this parameter determines the size of the 3D visualized cameras in the scene. If visSize is 1.0, The camera coordinate system is visualized with size 50x50x50. Actually, the visSize you need depends on the unit you use for your scene in your application. The default visSize is quite appropriate if you work with mm. If you e.g. use cm instead, visSize should be set to 0.1. |
void icl::geom::Scene::addObject | ( | SceneObject * | object, |
bool | passOwnerShip = false |
||
) |
void icl::geom::Scene::clear | ( | bool | camerasToo = false | ) |
deletes and removes all objects, handlers and callbacks
If camerasToo is set to true, also all cameras are removed
|
protected |
creates a displaylist for the given object
|
protected |
recursive utility method
|
inline |
picks the closest contained scene-object clicked at given ScreenPosition
returns 0 if no object was hit, if contactPos is not 0, the 3D-contact position is stored there.
picks the first object that is hit by the given viewray
The first object that is returned has the smallest distance to the given viewRay's offset. If contactPos is not 0, the contact point is stored there.
retunrs all objects intersected by the given viewray
|
inline |
retunrs all objects on that are intersected by the defined cameras viewray through given x and y
std::vector<int> icl::geom::Scene::findPath | ( | const SceneObject * | o | ) | const |
finds the recursive indices for a given object.
If no exceptions are thrown, getObject(findPath(o)) is always o. throws ans exception if the given object cannot be found.
|
protected |
frees all pbuffers allocated before
|
protected |
frees the display list, that is associated with an object
|
staticprivate |
called from the SceneObject class
|
protected |
frees the pbffer associated with given size (if there is one)
std::vector<Camera*> icl::geom::Scene::getAllCameras | ( | int | firstIndex = 0 , |
int | num = -1 |
||
) |
returns a vector with pointers to all cameras in given range
Please note, that the results become invalid if addCamera() or removeCamera() was called. If 'num' selects more cameras than possible, is it just increased appropriately automatically.
GeomColor icl::geom::Scene::getBackgroundColor | ( | ) | const |
returns the current background colo
Camera& icl::geom::Scene::getCamera | ( | int | camIndex = 0 | ) |
returns a reference to the i-th camera
This can also be used to set the camera or to set's some of it's properties:
const Camera& icl::geom::Scene::getCamera | ( | int | camIndex = 0 | ) | const |
returns the i-th scene camera
|
inline |
returns the count of contained cameras
Vec icl::geom::Scene::getCursor | ( | ) |
gets the Position of the cursor
bool icl::geom::Scene::getDrawCamerasEnabled | ( | ) | const |
returns whether cameras are visualized
bool icl::geom::Scene::getDrawCoordinateFrameEnabled | ( | ) | const |
returns wheter a coordinate frame is automatically shown in the scene
bool icl::geom::Scene::getDrawLightsEnabled | ( | ) | const |
returns whether lights are visualized
bool icl::geom::Scene::getDrawObjectFramesEnabled | ( | ) | const |
returns whether object frames are visualized
qt::ICLDrawWidget3D::GLCallback* icl::geom::Scene::getGLCallback | ( | int | camIndex | ) |
returns a callback that is used to render the scene into a GL-context
please see ICLQt::ICLDrawWidget3D::callback
SceneLight& icl::geom::Scene::getLight | ( | int | index | ) |
returns a reference to a light with given index
The returned reference cam be used to set lighting parameters. Since OpenGL does only support 8 lights, allowed indices are 0-7. If another index is passed, an exception is thrown.
const SceneLight& icl::geom::Scene::getLight | ( | int | index | ) | const |
returns a const reference to a light with given index
Since OpenGL does only support 8 lights, allowed indices are 0-7. If another index is passed, an exception is thrown.
|
protected |
internally used utility method that computes the extend of the Scene content
The extend is used when scene mouse handlers are created. Here, it will e.g. compute a usefull step when moving forward or strafing.
qt::MouseHandler* icl::geom::Scene::getMouseHandler | ( | int | camIndex = 0 | ) |
returns a mouse handler that adapts the scene's camera using mouse-interaction
SceneObject* icl::geom::Scene::getObject | ( | int | index | ) |
returns contained object at given index
If the index is not valid, an exception is thrown
const SceneObject* icl::geom::Scene::getObject | ( | int | index | ) | const |
returns contained object at given index (const)
If the index is not valid, an exception is thrown
SceneObject* icl::geom::Scene::getObject | ( | const std::vector< int > | recursiveIndices | ) |
returns a child that is deeper in the scene graph
e.g. if recursiveIndices is [1,2,3], then first, the Scene's object at index 1 is used. Then this objects child at index 2. And finally that objects child at index 3 is returned. An exception is thrown if one of the indices is wrong.
SceneObject* icl::geom::Scene::getObject | ( | const std::vector< int > | recursiveIndices | ) | const |
returns a child that is deeper in the scene graph (const)
e.g. if recursiveIndices is [1,2,3], then first, the Scene's object at index 1 is used. Then this objects child at index 2. And finally that objects child at index 3 is returned. An exception is thrown if one of the indices is wrong.
|
inline |
returns the number of top-level objects
|
virtual |
implements the PointCloudGrabber interface
Internally uses the camera index that can be defined by setting the int-property "point cloud grabber cam" by setting the "grab depth feature" property, the destination point cloud will be filled with a depth -field as well
Implements icl::geom::PointCloudGrabber.
void icl::geom::Scene::removeCamera | ( | int | index | ) |
removed the camera at given index
void icl::geom::Scene::removeObject | ( | int | idx | ) |
removed object at given index
The object is deleted if it's ownwership was passed
void icl::geom::Scene::removeObject | ( | const SceneObject * | obj | ) |
removes given top-level object from scene (not recursive)
The object is deleted if it's ownwership was passed
void icl::geom::Scene::removeObjects | ( | int | startIndex, |
int | endIndex = -1 |
||
) |
removed object at given indices
The object's are deleted if their ownwership was passed
const core::Img8u& icl::geom::Scene::render | ( | int | camIndx, |
const core::ImgBase * | background = 0 , |
||
core::Img32f * | depthBuffer = 0 , |
||
DepthBufferMode | mode = DistToCamCenter , |
||
bool | fastRendering = false |
||
) |
|
protected |
recursively renders object frames for all scene objects
|
protected |
internally used rendering method
|
inlineprotected |
internally used rendering method for recursive rendering of the scene graph
|
protected |
internally used rendering method for recursive rendering of the scene graph
|
protected |
|
protected |
renders the shadowmap
void icl::geom::Scene::setBackgroundColor | ( | const GeomColor & | color | ) |
sets the scene's background color (alpha is not used)
channel ranges are assumed to be in [0,255]. The default background color is black
void icl::geom::Scene::setBounds | ( | float | minX, |
float | maxX = 0 , |
||
float | minY = 0 , |
||
float | mayY = 0 , |
||
float | minZ = 0 , |
||
float | maxZ = 0 |
||
) |
sets the expected bounds of contained objects
The set information is used when a mouse-handler is created, in order to estimate appropriate step sizes. If the scene bounds were not explicitly, the scene tries to infer this information from the contained objects
Each [min-max] range where min=max, is automatically set to [minX,maxX]. If additionally, minX is equal to maxX, max is is set to -minX. If the resulting x-range has still zero length, the bounds are deleted internally
void icl::geom::Scene::setCursor | ( | Vec | newPosition | ) |
sets the Position of the cursor
void icl::geom::Scene::setDrawCamerasEnabled | ( | bool | enabled | ) |
sets wheter cameras are also visualized in scenes.
This means, that you will be able to see e.g. camera 1 in the view of camera 0
void icl::geom::Scene::setDrawCoordinateFrameEnabled | ( | bool | enabled, |
float | size = 120 |
||
) |
sets wheter a coordinate frame is automatically inserted into the scene
void icl::geom::Scene::setDrawLightsEnabled | ( | bool | enabled, |
float | lightSize = 1 |
||
) |
sets wheter lights are also visualized in scenes.
void icl::geom::Scene::setDrawObjectFramesEnabled | ( | bool | enabled, |
float | size | ||
) |
sets whether all object frames are visualized
void icl::geom::Scene::setGlobalAmbientLight | ( | const GeomColor & | color | ) |
this can be used to change OpenGL's global ambient light color
by default, we use a very weak white ambient background light of [255,255,255,20]. The color values are given in ranges [0,255]
void icl::geom::Scene::setLightingEnabled | ( | bool | flag | ) |
sets whether OpenGL's lighting is globally activated
by default, lighting is activated
void icl::geom::Scene::setMouseHandler | ( | SceneMouseHandler * | sceneMouseHandler, |
int | camIndex = 0 |
||
) |
registeres a custom SceneMouseHandler for given camera index
|
friend |
make SceneObject friend of Scene
|
protected |
current scene background color
|
protected |
optionally given bounds of the scene
|
protected |
internal list of top-level camera objects used for camera visualization
|
protected |
internal list of cameras
|
mutableprotected |
internally used scene object
|
private |
|
mutable |
|
protected |
|
protected |
internally used list of callbacks
|
protected |
global ambient light
|
protected |
internal list of lights
|
protected |
internally used list of mouse handlers
|
mutableprotected |
also internally used object frame object
|
protected |
internal list of top-level objects
|
mutableprotected |
|
mutableprotected |
previous lightstate
|
mutable |
|
mutable |
renders the current scene using an instance of pbuffer
This method is currently only supported on linux systems, since the used pbuffer (OpenGL offscreen framebuffer object)
The method trys to create a default r8 g8 b8 pbuffer with 24Bit depthbuffer. If this is not supported, an at least 4 4 4 16 context is tryed to be created. If this does also fail, an exception will be thrown.
When a single scene is used for both on- and offscreen rendering, an internal optimation needs to be deactivated by calling Scene::enableSharedOffscreenRendering.
Please note: The rendering pbuffer is allocated on the graphics card. Per definition, pbuffers are located in the screenbuffer memory segment which might be much smaller than the actual memory of your graphics card. Therefore, it is strongly recommended to free all pbuffers when they are no longer used. The pbuffer that is created to render the image in this method is stored internally and it will remain allocated for later use. If you need to render images of different sizes (the output image is rendered to the image size that the camera at given index has), you should free the pbuffers from time to time using Scene::freeAllPBuffers and Scene::freePBuffer(const utils::Size&).
If a non-null depthBuffer parameter is provided, it is filled with data from the scene core::depth buffer usually, the raw core::depth buffer does not provide useful information for further processing. In OpenGL, the standard core::depth buffer values are highly non-linearily distributed within the near and far clipping plane. If the core::depth buffer mode is not RawDepth01, this is compensated and the core::depth buffer is filled with (metric) core::depth values that denote either a pixel's distance to the z=0 plane in camera space or the distance to the camera center. For correcting the linearized core::depth buffer values that are computed for the DistToCamPlane mode, a set of correction coefficients has to be computed, which entails creation of all camera viewrays. This can last about a second in the first call. In later calls, the values are just re-used.Vector containing the shaders used in ImprovedShading
|
protected |
list of cameras for visualisation of shadowcameras