diff options
Diffstat (limited to 'intern/cycles/render/camera.h')
-rw-r--r-- | intern/cycles/render/camera.h | 103 |
1 files changed, 60 insertions, 43 deletions
diff --git a/intern/cycles/render/camera.h b/intern/cycles/render/camera.h index 21dad5eea3b..7970381f338 100644 --- a/intern/cycles/render/camera.h +++ b/intern/cycles/render/camera.h @@ -73,78 +73,92 @@ class Camera : public Node { }; /* motion blur */ - float shuttertime; - MotionPosition motion_position; - array<float> shutter_curve; + NODE_SOCKET_API(float, shuttertime) + NODE_SOCKET_API(MotionPosition, motion_position) + NODE_SOCKET_API_ARRAY(array<float>, shutter_curve) size_t shutter_table_offset; /* ** Rolling shutter effect. ** */ /* Defines rolling shutter effect type. */ - RollingShutterType rolling_shutter_type; + NODE_SOCKET_API(RollingShutterType, rolling_shutter_type) /* Specifies exposure time of scanlines when using * rolling shutter effect. */ - float rolling_shutter_duration; + NODE_SOCKET_API(float, rolling_shutter_duration) /* depth of field */ - float focaldistance; - float aperturesize; - uint blades; - float bladesrotation; + NODE_SOCKET_API(float, focaldistance) + NODE_SOCKET_API(float, aperturesize) + NODE_SOCKET_API(uint, blades) + NODE_SOCKET_API(float, bladesrotation) /* type */ - CameraType type; - float fov; + NODE_SOCKET_API(CameraType, camera_type) + NODE_SOCKET_API(float, fov) /* panorama */ - PanoramaType panorama_type; - float fisheye_fov; - float fisheye_lens; - float latitude_min; - float latitude_max; - float longitude_min; - float longitude_max; + NODE_SOCKET_API(PanoramaType, panorama_type) + NODE_SOCKET_API(float, fisheye_fov) + NODE_SOCKET_API(float, fisheye_lens) + NODE_SOCKET_API(float, latitude_min) + NODE_SOCKET_API(float, latitude_max) + NODE_SOCKET_API(float, longitude_min) + NODE_SOCKET_API(float, longitude_max) /* panorama stereo */ - StereoEye stereo_eye; - bool use_spherical_stereo; - float interocular_distance; - float convergence_distance; - bool use_pole_merge; - float pole_merge_angle_from; - float pole_merge_angle_to; + NODE_SOCKET_API(StereoEye, stereo_eye) + NODE_SOCKET_API(bool, use_spherical_stereo) + NODE_SOCKET_API(float, interocular_distance) + NODE_SOCKET_API(float, convergence_distance) + NODE_SOCKET_API(bool, use_pole_merge) + NODE_SOCKET_API(float, pole_merge_angle_from) + NODE_SOCKET_API(float, pole_merge_angle_to) /* anamorphic lens bokeh */ - float aperture_ratio; + NODE_SOCKET_API(float, aperture_ratio) /* sensor */ - float sensorwidth; - float sensorheight; + NODE_SOCKET_API(float, sensorwidth) + NODE_SOCKET_API(float, sensorheight) /* clipping */ - float nearclip; - float farclip; + NODE_SOCKET_API(float, nearclip) + NODE_SOCKET_API(float, farclip) /* screen */ - int width, height; - int resolution; BoundBox2D viewplane; + NODE_SOCKET_API_STRUCT_MEMBER(float, viewplane, left) + NODE_SOCKET_API_STRUCT_MEMBER(float, viewplane, right) + NODE_SOCKET_API_STRUCT_MEMBER(float, viewplane, bottom) + NODE_SOCKET_API_STRUCT_MEMBER(float, viewplane, top) + /* width and height change during preview, so we need these for calculating dice rates. */ - int full_width, full_height; + NODE_SOCKET_API(int, full_width) + NODE_SOCKET_API(int, full_height) /* controls how fast the dicing rate falls off for geometry out side of view */ - float offscreen_dicing_scale; + NODE_SOCKET_API(float, offscreen_dicing_scale) /* border */ BoundBox2D border; + NODE_SOCKET_API_STRUCT_MEMBER(float, border, left) + NODE_SOCKET_API_STRUCT_MEMBER(float, border, right) + NODE_SOCKET_API_STRUCT_MEMBER(float, border, bottom) + NODE_SOCKET_API_STRUCT_MEMBER(float, border, top) + BoundBox2D viewport_camera_border; + NODE_SOCKET_API_STRUCT_MEMBER(float, viewport_camera_border, left) + NODE_SOCKET_API_STRUCT_MEMBER(float, viewport_camera_border, right) + NODE_SOCKET_API_STRUCT_MEMBER(float, viewport_camera_border, bottom) + NODE_SOCKET_API_STRUCT_MEMBER(float, viewport_camera_border, top) /* transformation */ - Transform matrix; + NODE_SOCKET_API(Transform, matrix) /* motion */ - array<Transform> motion; - bool use_perspective_motion; - float fov_pre, fov_post; + NODE_SOCKET_API_ARRAY(array<Transform>, motion) + NODE_SOCKET_API(bool, use_perspective_motion) + NODE_SOCKET_API(float, fov_pre) + NODE_SOCKET_API(float, fov_post) /* computed camera parameters */ ProjectionTransform screentoworld; @@ -174,7 +188,6 @@ class Camera : public Node { float3 frustum_bottom_normal; /* update */ - bool need_update; bool need_device_update; bool need_flags_update; int previous_need_motion; @@ -183,6 +196,12 @@ class Camera : public Node { KernelCamera kernel_camera; array<DecomposedTransform> kernel_camera_motion; + private: + int width; + int height; + int resolution; + + public: /* functions */ Camera(); ~Camera(); @@ -195,10 +214,6 @@ class Camera : public Node { void device_update_volume(Device *device, DeviceScene *dscene, Scene *scene); void device_free(Device *device, DeviceScene *dscene, Scene *scene); - bool modified(const Camera &cam); - bool motion_modified(const Camera &cam); - void tag_update(); - /* Public utility functions. */ BoundBox viewplane_bounds_get(); @@ -210,6 +225,8 @@ class Camera : public Node { int motion_step(float time) const; bool use_motion() const; + void set_screen_size_and_resolution(int width_, int height_, int resolution_); + private: /* Private utility functions. */ float3 transform_raster_to_world(float raster_x, float raster_y); |