Public Member Functions | Public Attributes

FBRenderer Class Reference

This reference page is linked to from the following overview topics: MotionBuilder 2014, MotionBuilder 2013, FBSystem - The System Class, FBCamera - Cameras, Updated Objects.


Search for all occurrences

Detailed Description

Open Reality renderer interface.

Definition at line 438 of file fbrenderer.h.

#include <fbrenderer.h>

Inheritance diagram for FBRenderer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FBRenderer (HIObject pObject)
 Constructor.
void SetViewport (int pX, int pY, int pW, int pH)
 Must be called before inputing if the same renderer is used on multiple views/cameras in the same application.
bool RenderBegin (int pX, int pY, int pW, int pH)
 RenderBegin.
bool RenderEnd (FBView *pView=NULL)
 RenderEnd.
bool PreRender (int pLayer=-1)
 PreRenders one frame (needed for some shaders) This functions destroys the frame buffer content and must be called every time a render is called the typical order of call must be Renderer->Prerender // at this point the frame buffer is garbage -Clear the ogl -Do your render functions Renderer->Render.
bool Render (int pLayer=-1)
 Renders one frame.
void OGLSetupSceneLights (FBRenderOptions &pRenderOptions)
 Setup the scene lights in OpenGL.
void OGLModelDisplay (FBRenderOptions &pRenderOptions, FBModel &pModel)
bool SetViewingOptions (FBViewingOptions &pOptions)
 Set the viewing options.
FBViewingOptionsGetViewingOptions ()
 Obtain the current viewing options.
bool FrameCurrentCameraWithModels (bool pAll)
 Frame the current camera either with all models or with the currently selected models.
bool MouseInput (int pX, int pY, FBInputType pInputType, int pButtonKey, FBInputModifier pModifier, int pLayer=-1)
 Mouse input.
bool MouseInputNormalized (float pX, float pY, FBInputType pInputType, int pButtonKey, FBInputModifier pModifier, int pLayer=-1, int pPaneId=-1)
 Mouse input.
bool Pick (int pX, int pY, FBPickInfosList &pPickInfosList, bool pNeedIntersectPosition=false)
 Object picking selection.
bool PickNormalized (float pX, float pY, FBPickInfosList &pPickInfosList, bool pNeedIntersectPosition=false, int pPaneId=-1)
 Object picking selection.
bool RectPick (int pX1, int pY1, int pX2, int pY2, FBPickInfosList &pPickInfosList)
 Object rectangle selection.
bool RectPickNormalized (float pX1, float pY1, float pX2, float pY2, FBPickInfosList &pPickInfosList, int pPaneId=-1)
 Object rectangle selection.
int GetLastPickInfoList (FBPickInfosList &pPickInfosList)
 Return the last picking info list in the current view pane.
void KeyboardInput (FBDeviceKeyboardKey pKeyIndex, bool pKeyState, bool pIsTrigger=false)
 Keyboard input.
FBModelGetDisplayableGeometry (int pIndex)
 Get the displayable geometry model.
FBLightGetDisplayableLight (int pIndex)
 Get the displayable light.
const FBModelListGetDisplayableGeometryInCameraFrustum (FBModelList *pModelList=NULL, FBCamera *pCamera=NULL)
 Get a list of displayable geometry inside given camera's frustum.
bool IsModelInsideCameraFrustum (FBModel *pGeometry, FBCamera *pCamera=NULL)
 To tell if given model is located inside camera's frustum.

Public Attributes

FBPropertyCamera CurrentCamera
 Read Write Property: Current camera.
FBPropertyBool UseCameraSwitcher
 Read Write Property: Activate/Deactivate usage of camera switcher for the first model view of main viewer.
FBPropertyManipulatorTransform ManipulatorTransform
 Read Only Property: Manipulator responsible of moving objects
FBPropertyListManipulator Manipulators
 List: of manipulators.
FBPropertyScene Scene
 Read Write Property: Scene that the renderer will use/draw
FBPropertyBool AutoEvaluate
 Read Write Property: Indicate if a call to RenderBegin will also cause a re-evaluation of the scene.
FBPropertyBool Background
 Read Write Property: The renderer.
FBPropertyBool ShowStats
 Read Write Property: Show the stats about FPS, Evaluation rate ...
FBPropertyBool FrustumCulling
 Read Write Property: Turn on/off the early frustum culling optimization.
FBPropertyBool DisplayNormals
 Read Write Property: Display model normals in main viewer.
FBPropertyBool IDBufferPicking
 Read write Property: Use ID (Color) Buffer for picking, instead of OpenGl selection buffer picking.
FBPropertyDouble IDBufferPickingAlpha
 Read write Property: Those Semi-transparent (Alpha Blend) geometry(region) contribute less than this threshold, will be considered as invisible during ID picking.
FBPropertyBool IDBufferDisplay
 Read write Property: Render Model's unique Color ID into color Buffer (used for picking)
FBPropertyBool SelectionOverride
 Read write Property: Add transparent color override layer on selected models if true.
FBPropertyDouble SelectionOverrideTransparency
 Read write Property: Selection override layer transparency.
FBPropertyColor SelectionOverrideColor
 Read write Property: Selection override layer color.
FBPropertyBool SelectionForceSnapPointsDisplay
 Read write Property: Force show all feature points (pivots and etc) on selected models if true, ignore individual model's settings.
FBPropertyInt DisplaySetUpdateId
 Read Only Property: Current DisplaySet Update Id.
FBPropertyInt RendererUpdateId
 Read Only Property: Current Render Update Id.
FBPropertyInt DisplayableGeometryCount
 Read Only Property: Displayable geometry count.
FBPropertyInt DisplayableLightCount
 Read Only Property: Displayable light count.
FBPropertyListRendererCallback RendererCallbacks
 List: Renderer Callbacks attached.
FBPropertyInt RegisteredCallbackCount
 Read Only Property: Registered Renderer Callback Count.
FBPropertyInt CurrentPaneCallbackIndex
 Read Write Property: Current Pane's Renderer Callback Index.
FBPropertyInt CurrentPaneCallbackPrefIndex
 Read Write Property: Current Pane's Renderer Callback Preference Index.
FBPropertyBool AdvancedMaterialMode
 Read write Property: Turn on/off advanced material setting UI widgets.
FBPropertyBool AdvancedLightingMode
 Read write Property: Turn on/off advanced lighting setting UI widgets.

Constructor & Destructor Documentation

FBRenderer ( HIObject  pObject)

Constructor.

Client code cannot instantiate objects of this class. The FBSystem and FBScene classes provide access to the current renderer.

Parameters:
pObjectFor internal use only.

Member Function Documentation

void SetViewport ( int  pX,
int  pY,
int  pW,
int  pH 
)

Must be called before inputing if the same renderer is used on multiple views/cameras in the same application.

Parameters:
pXX position where to render.
pYY position where to render.
pWWidth of render area.
pHHight of render area.
bool RenderBegin ( int  pX,
int  pY,
int  pW,
int  pH 
)

RenderBegin.

Parameters:
pXX position where to render.
pYY position where to render.
pWWidth of render area.
pHHight of render area.

must be called before rendering can happen

bool RenderEnd ( FBView pView = NULL)

RenderEnd.

Parameters:
pViewIf you want the renderer to draw artifacts, such as TimeCode, CameraLabel or SafeArea, you must provide the FBView on which the renderer draws on.
Remarks:
Must be called at the end of rendering.
bool PreRender ( int  pLayer = -1)

PreRenders one frame (needed for some shaders) This functions destroys the frame buffer content and must be called every time a render is called the typical order of call must be Renderer->Prerender // at this point the frame buffer is garbage -Clear the ogl -Do your render functions Renderer->Render.

Parameters:
pLayerRendering layer ID(default=-1).
Returns:
true if successful.
bool Render ( int  pLayer = -1)

Renders one frame.

Parameters:
pLayerRendering layer ID(default=-1).
Returns:
true if successful.
void OGLSetupSceneLights ( FBRenderOptions pRenderOptions)

Setup the scene lights in OpenGL.

Parameters:
pRenderOptionsSee FBRenderOptions for more detail.
void OGLModelDisplay ( FBRenderOptions pRenderOptions,
FBModel pModel 
)

Display Model in OpenGL. For Internal testing purpose only.

Parameters:
pRendererOptionsSee FBRenderOptions for more detail.
pModelmodel to be displayed.
bool SetViewingOptions ( FBViewingOptions pOptions)

Set the viewing options.

Parameters:
pOptionsSee FBViewingOptions for more detail.
FBViewingOptions* GetViewingOptions ( )

Obtain the current viewing options.

Returns:
A structure that can be queried and updated for a call to SetViewingOptions.
bool FrameCurrentCameraWithModels ( bool  pAll)

Frame the current camera either with all models or with the currently selected models.

Parameters:
pAlltrue to frame with all models.
Returns:
true if successful.
bool MouseInput ( int  pX,
int  pY,
FBInputType  pInputType,
int  pButtonKey,
FBInputModifier  pModifier,
int  pLayer = -1 
)

Mouse input.

Parameters:
pXX position.
pYY position.
pInputTypeType of input.
pButtonKeyButton/Key pressed.
pModifierModifier pressed (CTRL/ALT/SHIFT).
pLayerRendering layer ID(default=-1).
Returns:
true if successful.
bool MouseInputNormalized ( float  pX,
float  pY,
FBInputType  pInputType,
int  pButtonKey,
FBInputModifier  pModifier,
int  pLayer = -1,
int  pPaneId = -1 
)

Mouse input.

Parameters:
pXX position, normalized to the range of [0, 1] in the view port dimension.
pYY position, normalized to the range of [0, 1] in the view port dimension.
pInputTypeType of input.
pButtonKeyButton/Key pressed.
pModifierModifier pressed (CTRL/ALT/SHIFT).
pLayerRendering layer ID(default=-1).
pPaneIdspecify which pane's dimension used for normalization, default (-1) for the whole viewer.
Returns:
true if successful.
bool Pick ( int  pX,
int  pY,
FBPickInfosList pPickInfosList,
bool  pNeedIntersectPosition = false 
)

Object picking selection.

Parameters:
pXX position.
pYY position.
pPickInfosListThe list of pick infos.
pNeedIntersectPositionrequire valid intersection position if true, this will take more time to process, and not reliable with very dense mesh.
bool PickNormalized ( float  pX,
float  pY,
FBPickInfosList pPickInfosList,
bool  pNeedIntersectPosition = false,
int  pPaneId = -1 
)

Object picking selection.

Parameters:
pXX position, normalized to the range of [0, 1] in the view port dimension.
pYY position, normalized to the range of [0, 1] in the view port dimension.
pPickInfosListThe list of pick infos.
pNeedIntersectPositionrequire valid intersection position if true, this will take more time to process, and not reliable with very dense mesh.
pPaneIdspecify which pane's dimension used for normalization, default (-1) for the whole viewer.
bool RectPick ( int  pX1,
int  pY1,
int  pX2,
int  pY2,
FBPickInfosList pPickInfosList 
)

Object rectangle selection.

Parameters:
pX1Left upper corner X position.
pY1Left upper corner y position.
pX2Right bottom corner X position.
pY2Right bottom corner y position.
pPickInfosListThe list of pick infos.
bool RectPickNormalized ( float  pX1,
float  pY1,
float  pX2,
float  pY2,
FBPickInfosList pPickInfosList,
int  pPaneId = -1 
)

Object rectangle selection.

Parameters:
pX1Left upper corner X position, normalized to the range of [0, 1] in the viewport dimension.
pY1Left upper corner y position, normalized to the range of [0, 1] in the viewport dimension.
pX2Right bottom corner X position, normalized to the range of [0, 1] in the viewport dimension.
pY2Right bottom corner y position, normalized to the range of [0, 1] in the viewport dimension.
pPickInfosListThe list of pick infos.
pPaneIdspecify which pane's dimension used for normalization, default (-1) for the whole viewer.
int GetLastPickInfoList ( FBPickInfosList pPickInfosList)

Return the last picking info list in the current view pane.

Parameters:
pPickInfosListThe list of pick infos.
Returns:
number of item in the list.
void KeyboardInput ( FBDeviceKeyboardKey  pKeyIndex,
bool  pKeyState,
bool  pIsTrigger = false 
)

Keyboard input.

Parameters:
pKeyIndexKey index. (See "enum FBDeviceKeyboardKey" above for supported keys)
pKeyStateKey state. (True == key is down, False == key is up)
pIsTriggerWhen setting pKeyState to True, resets key state to False right after operation.
FBModel* GetDisplayableGeometry ( int  pIndex)

Get the displayable geometry model.

Those geometry models which have Show property ON are considered as "displayable".

Parameters:
pIndexdisplayable geometry model index to query.
Returns:
displayable geometry model.
FBLight* GetDisplayableLight ( int  pIndex)

Get the displayable light.

Those light models which have Show property ON are considered as "displayable".

Parameters:
pIndexdisplayable light index to query.
Returns:
displayable light.
const FBModelList& GetDisplayableGeometryInCameraFrustum ( FBModelList pModelList = NULL,
FBCamera pCamera = NULL 
)

Get a list of displayable geometry inside given camera's frustum.

This function will return conservative result. It's possible for some geometry outside of the frustum will be considered to be visible, but it will not skip any real visible geometry. This function should only be called in the main rendering thread.

Parameters:
pModelListModelList holding the return models.
pCamerause current camera if NULL.
Returns:
Reference to pModelList. if pModelList is NULL return a const reference to internal static FBModelList and consecutive call to this function will invalidate the result of previous call.
bool IsModelInsideCameraFrustum ( FBModel pGeometry,
FBCamera pCamera = NULL 
)

To tell if given model is located inside camera's frustum.

This function will return conservative result. It's possible for some geometry outside of the frustum will be considered to be visible, but it will not skip any real visible geometry. This function should only be called in the main rendering thread.

Parameters:
pGeometrythe geometry to be queried.
pCamerause current camera if NULL.
Returns:
true if Model is inside camera frustum.

Member Data Documentation

FBPropertyCamera CurrentCamera

Read Write Property: Current camera.

if UseCameraSwitcher is on, this will Get/Set camera switcher's current camera;

Definition at line 637 of file fbrenderer.h.

Read Write Property: Activate/Deactivate usage of camera switcher for the first model view of main viewer.

Definition at line 638 of file fbrenderer.h.

FBPropertyManipulatorTransform ManipulatorTransform

Read Only Property: Manipulator responsible of moving objects

Definition at line 641 of file fbrenderer.h.

List: of manipulators.

Definition at line 642 of file fbrenderer.h.

FBPropertyScene Scene

Read Write Property: Scene that the renderer will use/draw

Definition at line 645 of file fbrenderer.h.

Read Write Property: Indicate if a call to RenderBegin will also cause a re-evaluation of the scene.

Definition at line 646 of file fbrenderer.h.

Read Write Property: The renderer.

Definition at line 647 of file fbrenderer.h.

Read Write Property: Show the stats about FPS, Evaluation rate ...

like when using Shift-F in main viewer.

Definition at line 648 of file fbrenderer.h.

Read Write Property: Turn on/off the early frustum culling optimization.

Definition at line 649 of file fbrenderer.h.

Read Write Property: Display model normals in main viewer.

Definition at line 650 of file fbrenderer.h.

Read write Property: Use ID (Color) Buffer for picking, instead of OpenGl selection buffer picking.

Definition at line 651 of file fbrenderer.h.

Read write Property: Those Semi-transparent (Alpha Blend) geometry(region) contribute less than this threshold, will be considered as invisible during ID picking.

Definition at line 652 of file fbrenderer.h.

Read write Property: Render Model's unique Color ID into color Buffer (used for picking)

Definition at line 653 of file fbrenderer.h.

Read write Property: Add transparent color override layer on selected models if true.

Definition at line 654 of file fbrenderer.h.

Read write Property: Selection override layer transparency.

Definition at line 655 of file fbrenderer.h.

Read write Property: Selection override layer color.

Definition at line 656 of file fbrenderer.h.

Read write Property: Force show all feature points (pivots and etc) on selected models if true, ignore individual model's settings.

Definition at line 657 of file fbrenderer.h.

Read Only Property: Current DisplaySet Update Id.

Add/Delete models, Show/Hide models will affect DisplaySet.

Definition at line 658 of file fbrenderer.h.

Read Only Property: Current Render Update Id.

DisplaySet update, material change, texture changes and shader change and other operations will trigger Renderer update.

Definition at line 659 of file fbrenderer.h.

Read Only Property: Displayable geometry count.

Definition at line 660 of file fbrenderer.h.

Read Only Property: Displayable light count.

Definition at line 661 of file fbrenderer.h.

List: Renderer Callbacks attached.

Definition at line 662 of file fbrenderer.h.

Read Only Property: Registered Renderer Callback Count.

Definition at line 663 of file fbrenderer.h.

Read Write Property: Current Pane's Renderer Callback Index.

Definition at line 664 of file fbrenderer.h.

Read Write Property: Current Pane's Renderer Callback Preference Index.

Definition at line 665 of file fbrenderer.h.

Read write Property: Turn on/off advanced material setting UI widgets.

Note:
MoBu default render won't utilize those advanced material properties, they're provided for pipeline interop and custom plugin development purpose.

Definition at line 670 of file fbrenderer.h.

Read write Property: Turn on/off advanced lighting setting UI widgets.

Include UI widgets for various advanced lighting setting, includes: Light: area light, spot light inner/outer angles, barndoors and etc.,; Model: PrimaryVisibility, CastsShadows and ReceiveShadows.

MoBu default render doesn't utilize those advanced lighting properties, they're provided for pipeline interop and custom plugin development purpose. This property must been set to be true before creating any scene light or model objects to allow UI widgets display properly.

it's equivalent to the config item "AdvancedLightingUISetting" at [Rendering] section"

Definition at line 683 of file fbrenderer.h.


The documentation for this class was generated from the following file:

FBRenderer FBRenderer FBRenderer FBRenderer FBRenderer FBRenderer FBRenderer FBRenderer FBRenderer FBRenderer
FBRenderer FBRenderer FBRenderer FBRenderer FBRenderer FBRenderer FBRenderer FBRenderer FBRenderer FBRenderer