ai_cameras.h
Go to the documentation of this file.
1// Copyright 2021 Autodesk, Inc. All rights reserved.
2//
3// Use of this software is subject to the terms of the Autodesk license
4// agreement provided at the time of installation or download, or which
5// otherwise accompanies this software in either electronic or hard copy form.
6
12#pragma once
13#include "ai_nodes.h"
14#include "ai_vector.h"
15
25 float sx, sy;
28 float dsx, dsy;
29 float lensx, lensy;
31};
32
44 AtVector dOdx, dOdy;
45 AtVector dDdx, dDdy;
47};
48
51 void (*CreateRay)(const AtNode*, const AtCameraInput&, AtCameraOutput&, uint16_t tid);
52 bool (*ReverseRay)(const AtNode* node, const AtVector &Po, float relative_time, AtVector2 &Ps);
53};
54
56#define AI_CAMERA_NODE_EXPORT_METHODS(tag) \
57AI_INSTANCE_COMMON_METHODS \
58camera_create_ray; \
59camera_reverse_ray; \
60static AtCameraNodeMethods ai_cam_mtds = { \
61 CameraCreateRay, \
62 CameraReverseRay \
63}; \
64static AtNodeMethods ai_node_mtds = { \
65 &ai_common_mtds, \
66 &ai_cam_mtds \
67}; \
68const AtNodeMethods* tag = &ai_node_mtds;
69
70
75AI_API void AiCameraInitialize(AtNode* node);
76AI_API void AiCameraUpdate(AtNode* node, bool plane_distance);
77/*\}*/
78
96#define camera_create_ray \
97static void CameraCreateRay(const AtNode* node, const AtCameraInput& input, AtCameraOutput& output, uint16_t tid)
98
114#define camera_reverse_ray \
115static bool CameraReverseRay(const AtNode* node, const AtVector &Po, float relative_time, AtVector2 &Ps)
116
117/* \}*/
118
119/*\}*/
AtNode struct and methods.
Vector math types, operators and utilities.
AtVector origin
ray origin in camera space (required)
Definition: ai_cameras.h:42
float relative_time
time relative to this camera (in [0,1))
Definition: ai_cameras.h:30
AtRGB weight
weight of this ray (used for vignetting) (optional - defaults to AI_RGB_WHITE)
Definition: ai_cameras.h:46
AtVector dOdy
derivative of the ray origin with respect to the pixel coordinates (optional - defaults to 0)
Definition: ai_cameras.h:44
float sy
screen-space coordinates will range between (screen_window_min.x, screen_window_min....
Definition: ai_cameras.h:25
AI_API void AiCameraUpdate(AtNode *node, bool plane_distance)
Updates camera's internal data.
Definition: ai_camera.cpp:347
AtVector dir
ray direction in camera space (required)
Definition: ai_cameras.h:43
AI_API void AiCameraInitialize(AtNode *node)
Initialize the camera's internal data.
Definition: ai_camera.cpp:314
float dsy
derivatives of the screen-space coordinates with respect to pixel coordinates
Definition: ai_cameras.h:28
AtVector dDdy
derivative of the ray direction with respect to the pixel coordinates (optional - defaults to 0)
Definition: ai_cameras.h:45
float lensy
lens sampling coordinates in [0,1)^2
Definition: ai_cameras.h:29
Camera ray creation inputs.
Definition: ai_cameras.h:24
Camera node methods structure.
Definition: ai_cameras.h:50
Camera ray creation outputs.
Definition: ai_cameras.h:41
This represents a node in Arnold.
RGB color.
Definition: ai_color.h:32
2D point
Definition: ai_vector.h:255
3D point (single precision)
Definition: ai_vector.h:30

© 2022 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com