Camera initialization and update, and custom camera node implementation.
More...
|
float | AtCameraInput::sx |
|
float | AtCameraInput::sy |
| screen-space coordinates will range between (screen_window_min.x, screen_window_min.y/frame_aspect_ratio) and (screen_window_max.x, screen_window_max.y/frame_aspect_ratio)
|
|
float | AtCameraInput::dsx |
|
float | AtCameraInput::dsy |
| derivatives of the screen-space coordinates with respect to pixel coordinates
|
|
float | AtCameraInput::lensx |
|
float | AtCameraInput::lensy |
| lens sampling coordinates in [0,1)^2
|
|
float | AtCameraInput::relative_time |
| time relative to this camera (in [0,1))
|
|
AtVector | AtCameraOutput::origin |
| ray origin in camera space (required)
|
|
AtVector | AtCameraOutput::dir |
| ray direction in camera space (required)
|
|
AtVector | AtCameraOutput::dOdx |
|
AtVector | AtCameraOutput::dOdy |
| derivative of the ray origin with respect to the pixel coordinates (optional - defaults to 0)
|
|
AtVector | AtCameraOutput::dDdx |
|
AtVector | AtCameraOutput::dDdy |
| derivative of the ray direction with respect to the pixel coordinates (optional - defaults to 0)
|
|
AtRGB | AtCameraOutput::weight |
| weight of this ray (used for vignetting) (optional - defaults to AI_RGB_WHITE)
|
|
void(* | AtCameraNodeMethods::CreateRay )(const AtNode *, const AtCameraInput &, AtCameraOutput &, uint16_t tid) |
|
bool(* | AtCameraNodeMethods::ReverseRay )(const AtNode *node, const AtVector &Po, float relative_time, AtVector2 &Ps) |
|
Camera initialization and update, and custom camera node implementation.
◆ AI_CAMERA_NODE_EXPORT_METHODS
#define AI_CAMERA_NODE_EXPORT_METHODS |
( |
|
tag | ) |
|
Value:
camera_reverse_ray; \
CameraCreateRay, \
CameraReverseRay \
}; \
&ai_common_mtds, \
&ai_cam_mtds \
}; \
#define camera_create_ray
Camera's camera_create_ray method declaration.
Definition: ai_cameras.h:96
Camera node methods structure.
Definition: ai_cameras.h:50
Node methods.
Definition: ai_node_entry.h:86
Camera node methods exporter.
◆ camera_create_ray
Camera's camera_create_ray method declaration.
This function is called for the camera to return a ray origin and direction given a point in 2d screen coordinates.
- Parameters
-
| node | pointer to the camera node itself |
| input | AtCameraInput data required to generate a new ray (screen position, derivatives, etc...) |
[out] | output | Camera ray origin, direction and weight. Derivatives are set to zero by default. Estimates will be computed if they are not set. |
| tid | thread ID that will cast this ray |
◆ camera_reverse_ray
#define camera_reverse_ray static bool CameraReverseRay(const AtNode* node, const AtVector &Po, float relative_time, AtVector2 &Ps) |
Camera's camera_reverse_ray method declaration.
This function is the reverse of camera_create_ray: given a point in camera space 3d coordinates return the corresponding 2d screen coordinates.
- Parameters
-
| node | pointer to the camera node itself |
| Po | Point in camera space |
| relative_time | Relative time to compute the projection in |
[out] | Ps | Output point in screen space |
- Returns
- True if a screen space projection exists and False otherwise. Points that fall outside the frame should return True and compute the corresponding screen coordinates, only points with no projection at all should return False. False can also be returned if there's no implementation available.
◆ AiCameraInitialize()
AI_API void AiCameraInitialize |
( |
AtNode * |
node | ) |
|
Initialize the camera's internal data.
This must be called once and only once during node_initialize
- Parameters
-
node | pointer to the camera node |
◆ AiCameraUpdate()
AI_API void AiCameraUpdate |
( |
AtNode * |
node, |
|
|
bool |
plane_distance |
|
) |
| |
Updates camera's internal data.
This must be called during node_update
- Parameters
-
node | pointer to the camera node |
plane_distance | will the Z-depth and near/far clip be computed from the camera plane, or from the camera point? |