This reference page is linked to from the following overview topics: Plug-in Base Classes.
The multipass camera effect allows modification of viewpoints and view directions or time for each pass of a multipass rendering.
Algorithms such as Depth of Field, Scene motion blur can be implemented using multipass techniques. A multipass camera effect is a plug-in to camera objects. It allows the renderer to query the camera for the view params for each pass of the rendering, and provides a dithered combining function to combine the bitmaps produced by each pass into the final bitmap. It also allows time to be manipulated for each rendering pass, providing effects such as motion blur.
#include <object.h>
Public Member Functions |
|
virtual bool | IsCompatible (CameraObject *pCameraObject)=0 |
Some cameras are not compatible with some
render effects, this method allows cameras to list compatible
effects in the UI and as such allows the effect to declare its
compatibility with the current camera object. |
|
virtual bool | DisplayPasses (TimeValue renderTime)=0 |
There is a UI option on multipass effects
that indicates whether the renderer should display each pass as it
is rendered. |
|
virtual int | TotalPasses (TimeValue renderTime)=0 |
The multipass effect also has a variable
number of passes. |
|
virtual ViewParams * | Apply (INode *pCameraNode, CameraObject *pCameraObject, int passNum, TimeValue &overrideRenderTime)=0 |
This method will modify the camera, camera
node, or time value to affect each pass. |
|
virtual void | AccumulateBitmap (Bitmap *pDest, Bitmap *pSrc, int passNum, TimeValue renderTime)=0 |
This method will blend each pass (src) into
the final accumulator (dest). |
|
virtual void | PostRenderFrame ()=0 |
This method is called after all passes have
been rendered. |
|
virtual RefResult | NotifyRefChanged (Interval changeInt, RefTargetHandle hTarget, PartID &partID, RefMessage message) |
This method is implemented to receive and
respond to messages broadcast by all the dependants in the entire
system. |
|
virtual SClass_ID | SuperClassID () |
This method returns the super class ID of
the creator of the clip object. |
|
virtual void | BeginEditParams (IObjParam *ip, ULONG flags, Animatable *prev=NULL) |
virtual void | EndEditParams (IObjParam *ip, ULONG flags, Animatable *next=NULL) |
virtual bool IsCompatible | ( | CameraObject * | pCameraObject | ) | [pure virtual] |
Some cameras are not compatible with some render effects, this method allows cameras to list compatible effects in the UI and as such allows the effect to declare its compatibility with the current camera object.
pCameraObject | A pointer to a camera object. |
virtual bool DisplayPasses | ( | TimeValue | renderTime | ) | [pure virtual] |
There is a UI option on multipass effects that indicates whether the renderer should display each pass as it is rendered.
Note this is not used by viewport renderer, because of the hardware involvement. This method returns whether to display individual passes as they are computed.
renderTime | The rendertime at which to check the display passes. |
virtual int TotalPasses | ( | TimeValue | renderTime | ) | [pure virtual] |
The multipass effect also has a variable number of passes.
This method tells the renderer how many passes to render per final output frame and as such returns the total number of passes to be rendered
renderTime | The rendertime at which to check the display passes. |
virtual ViewParams* Apply | ( | INode * | pCameraNode, |
CameraObject * | pCameraObject, | ||
int | passNum, | ||
TimeValue & | overrideRenderTime | ||
) | [pure virtual] |
This method will modify the camera, camera node, or time value to affect each pass.
This is the modify function called for each pass of the frame. The effect can alter the camera node, camera object, or override the render time in the course of this call. 3ds Max renderers take an optional parameter viewParams* that when not NULL overrides the normal rendering camera. When this is called the override render time will be set to the current frame time. If the value is changed, this will be the time value used for the pass. Note that at the time that apply is called, the renderer has not yet been called, hence it is possible, with care, to alter the scene in a general way, not just the camera & time parameters. Apply should return NULL if the normal unmodified camera is to be used.
pCameraNode | A pointer to the node of the camera. |
pCameraObject | A pointer to the camera object. |
passNum | The number of the pass. |
overrideRenderTime | The time if you wish to override the render time. |
virtual void AccumulateBitmap | ( | Bitmap * | pDest, |
Bitmap * | pSrc, | ||
int | passNum, | ||
TimeValue | renderTime | ||
) | [pure virtual] |
This method will blend each pass (src) into the final accumulator (dest).
After each pass is rendered, it needs to be combined into the final output bitmap. The current multipass effects use a dithered combiner, so that hard edges from the passes are more smoothly blended. There are many ways to do this, with varying quality, so this method allows different future implementations. Note that this is not used by the viewport renderer, as there's no way to tell the hardware to do this. Hardware is for fast & edgy, software is for slow and smooth.
pDest | The destination bitmap. |
pSrc | The source bitmap. |
passNum | The number of the pass. |
renderTime | The render time. |
virtual void PostRenderFrame | ( | ) | [pure virtual] |
This method is called after all passes have been rendered.
After all passes have been rendered & accumulated, this method will be called so that the effect can do any final cleanup. Currently unused, it can be ignored by multipass effects if they wish.
virtual RefResult NotifyRefChanged | ( | Interval | changeInt, |
RefTargetHandle | hTarget, | ||
PartID & | partID, | ||
RefMessage | message | ||
) | [inline, virtual] |
This method is implemented to receive and respond to messages broadcast by all the dependants in the entire system.
changeInt | This is the interval of time over which the message is active. |
hTarget | This is the handle of the reference target the message was sent by. The reference maker uses this handle to know specifically which reference target sent the message. |
partID | This contains information specific to the message passed in. Some messages don't use the partID at all. See Reference Messages for more information about the meaning of the partID for some common messages. |
message | The msg parameters passed into this method is the specific message which needs to be handled. See Reference Messages. |
Implements ReferenceMaker.
{ return REF_SUCCEED; }
virtual SClass_ID SuperClassID | ( | ) | [inline, virtual] |
This method returns the super class ID of the creator of the clip object.
Reimplemented from ReferenceTarget.
{ return MPASS_CAM_EFFECT_CLASS_ID; }
virtual void BeginEditParams | ( | IObjParam * | ip, |
ULONG | flags, | ||
Animatable * | prev = NULL |
||
) | [inline, virtual] |
ip | Interface pointer. The developer can use it to call methods such as AddRollupPage(). Note that this pointer is only valid between BeginEditParams() and EndEditParams(). It should not be used outside this interval. |
flags | Describe which branch of the command panel or dialog the item
is being edited in. The following are possible values: BEGIN_EDIT_CREATE Indicates an item is being edited in the create branch. BEGIN_EDIT_MOTION Indicates a controller is being edited in the motion branch. BEGIN_EDIT_HIERARCHY Indicates a controller is being edited in the Pivot subtask of the hierarchy branch. BEGIN_EDIT_IK Indicates a controller is being edited in the IK subtask of the hierarchy branch. BEGIN_EDIT_LINKINFO Indicates a controller is being edited in the Link Info subtask of the hierarchy branch. |
prev | Pointer to an Animatable object. This parameter may be used in the motion and hierarchy branches of the command panel. This pointer allows a plug-in to look at the ClassID of the previous item that was being edited, and if it is the same as this item, to not replace the entire UI in the command panel, but simply update the values displayed in the UI fields. This prevents the UI from 'flickering' when the current item begins its edit. For example, if you are in the motion branch and are looking at an item's PRS controller values, and then select another item that is displayed with a PRS controller, the UI will not change - only the values displayed in the fields will change. If however you selected a target camera that has a lookat controller (not a PRS controller) the UI will change because a different set of parameters need to be displayed. Note that for items that are edited in the modifier branch this field can be ignored. |
Reimplemented from Animatable.
{}
virtual void EndEditParams | ( | IObjParam * | ip, |
ULONG | flags, | ||
Animatable * | next = NULL |
||
) | [inline, virtual] |
ip | An interface pointer. The developer may use the interface
pointer to call methods such as DeleteRollupPage(). |
flags | The following flag may be set: END_EDIT_REMOVEUI If TRUE, the item's user interface should be removed. |
next | Animatable pointer. Can be used in the motion and hierarchy branches of the command panel. It allows a plug-in to look at the ClassID of the next item that was being edited, and if it is the same as this item, to not replace the entire UI in the command panel. Note that for items that are edited in the modifier branch this field can be ignored. |
Reimplemented from Animatable.
{}