23 float blades = cam->blades;
32 float rotation = cam->bladesrotation;
37 bokeh.
x *= cam->inv_aperture_ratio;
54 #ifdef __CAMERA_MOTION__
61 if (ray->time < 0.5f) {
64 Pcamera =
interp(Pcamera_pre, Pcamera, ray->time * 2.0f);
69 Pcamera =
interp(Pcamera, Pcamera_post, (ray->time - 0.5f) * 2.0f);
80 if (aperturesize > 0.0f) {
96 #ifdef __CAMERA_MOTION__
108 bool use_stereo =
kernel_data.cam.interocular_offset != 0.0f;
114 #ifdef __RAY_DIFFERENTIALS__
128 #ifdef __RAY_DIFFERENTIALS__
135 float3 Pcenter = Pnostereo;
146 ray->dP.dx = Px - Pcenter;
147 ray->dD.dx = Dx - Dcenter;
155 ray->dP.dy = Py - Pcenter;
156 ray->dD.dy = Dy - Dcenter;
160 #ifdef __CAMERA_CLIPPING__
162 float z_inv = 1.0f /
normalize(Pcamera).z;
164 ray->P += nearclip * ray->D;
165 ray->dP.dx += nearclip * ray->dD.dx;
166 ray->dP.dy += nearclip * ray->dD.dy;
191 if (aperturesize > 0.0f) {
200 P = Pcamera + lensuvw;
209 #ifdef __CAMERA_MOTION__
221 #ifdef __RAY_DIFFERENTIALS__
229 #ifdef __CAMERA_CLIPPING__
263 float aperturesize = cam->aperturesize;
265 if (aperturesize > 0.0f) {
271 float3 Pfocus = Dfocus * cam->focaldistance;
279 P =
U * lensuv.
x +
V * lensuv.
y;
284 Transform cameratoworld = cam->cameratoworld;
286 #ifdef __CAMERA_MOTION__
287 if (cam->num_motion_steps) {
289 &cameratoworld, cam_motion, cam->num_motion_steps, ray->time);
297 bool use_stereo = cam->interocular_offset != 0.0f;
305 #ifdef __RAY_DIFFERENTIALS__
326 ray->dP.dx = Px - Pcenter;
327 ray->dD.dx = Dx - Dcenter;
337 ray->dP.dy = Py - Pcenter;
338 ray->dD.dy = Dy - Dcenter;
341 #ifdef __CAMERA_CLIPPING__
343 float nearclip = cam->nearclip;
344 ray->P += nearclip * ray->D;
345 ray->dP.dx += nearclip * ray->dD.dx;
346 ray->dP.dy += nearclip * ray->dD.dy;
347 ray->t = cam->cliplength;
366 int filter_table_offset =
kernel_data.film.filter_table_offset;
370 #ifdef __CAMERA_MOTION__
379 const int shutter_table_offset =
kernel_data.cam.shutter_table_offset;
393 const float duration =
kernel_data.cam.rolling_shutter_duration;
394 if (duration != 0.0f) {
400 ray->time = (ray->time - 0.5f) * duration;
401 ray->time += (
time - 0.5f) * (1.0f - duration) + 0.5f;
418 #ifdef __CAMERA_MOTION__
432 return make_float3(cameratoworld.
x.w, cameratoworld.
y.w, cameratoworld.
z.w);
445 return len(
P - camP);
458 return len(
P - camP);
typedef float(TangentPoint)[2]
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
ATTR_WARN_UNUSED_RESULT const BMVert * v
ccl_device_inline void camera_sample_panorama(ccl_constant KernelCamera *cam, float raster_x, float raster_y, float lens_u, float lens_v, ccl_addr_space Ray *ray)
CCL_NAMESPACE_BEGIN ccl_device float2 camera_sample_aperture(ccl_constant KernelCamera *cam, float u, float v)
ccl_device void camera_sample_orthographic(KernelGlobals *kg, float raster_x, float raster_y, float lens_u, float lens_v, ccl_addr_space Ray *ray)
ccl_device_inline float camera_distance(KernelGlobals *kg, float3 P)
ccl_device_inline float3 camera_world_to_ndc(KernelGlobals *kg, ShaderData *sd, float3 P)
ccl_device_inline float camera_z_depth(KernelGlobals *kg, float3 P)
ccl_device_inline void camera_sample(KernelGlobals *kg, int x, int y, float filter_u, float filter_v, float lens_u, float lens_v, float time, ccl_addr_space Ray *ray)
ccl_device_inline float3 camera_direction_from_point(KernelGlobals *kg, float3 P)
ccl_device void camera_sample_perspective(KernelGlobals *kg, float raster_x, float raster_y, float lens_u, float lens_v, ccl_addr_space Ray *ray)
ccl_device_inline float3 camera_position(KernelGlobals *kg)
#define kernel_tex_array(tex)
#define ccl_device_inline
#define CCL_NAMESPACE_END
#define make_float3(x, y, z)
ccl_device differential3 differential3_zero()
CCL_NAMESPACE_BEGIN ccl_device float lookup_table_read(KernelGlobals *kg, float x, int offset, int size)
ccl_device float2 regular_polygon_sample(float corners, float rotation, float u, float v)
ccl_device float2 concentric_sample_disk(float u1, float u2)
ccl_device_inline void spherical_stereo_transform(ccl_constant KernelCamera *cam, float3 *P, float3 *D)
ccl_device_inline float3 panorama_to_direction(ccl_constant KernelCamera *cam, float u, float v)
ccl_device_inline float2 direction_to_panorama(ccl_constant KernelCamera *cam, float3 dir)
#define __CAMERA_MOTION__
#define FILTER_TABLE_SIZE
#define SHUTTER_TABLE_SIZE
__forceinline avxf cross(const avxf &a, const avxf &b)
ccl_device_inline float3 float4_to_float3(const float4 a)
ccl_device_inline float2 normalize(const float2 &a)
ccl_device_inline float dot(const float2 &a, const float2 &b)
ccl_device_inline float2 interp(const float2 &a, const float2 &b, float t)
ccl_device_inline bool is_zero(const float2 &a)
ccl_device_inline float3 zero_float3()
ccl_device_inline float3 transform_perspective(const ProjectionTransform *t, const float3 a)
CCL_NAMESPACE_BEGIN struct View V
BLI_INLINE float D(const float *data, const int res[3], int x, int y, int z)