17 float blades = cam->blades;
26 float rotation = cam->bladesrotation;
31 bokeh.
x *= cam->inv_aperture_ratio;
48 #ifdef __CAMERA_MOTION__
55 if (ray->time < 0.5f) {
58 Pcamera =
interp(Pcamera_pre, Pcamera, ray->time * 2.0f);
63 Pcamera =
interp(Pcamera, Pcamera_post, (ray->time - 0.5f) * 2.0f);
74 if (aperturesize > 0.0f) {
90 #ifdef __CAMERA_MOTION__
102 bool use_stereo =
kernel_data.cam.interocular_offset != 0.0f;
108 #ifdef __RAY_DIFFERENTIALS__
126 #ifdef __RAY_DIFFERENTIALS__
133 float3 Pcenter = Pnostereo;
146 dP.
dx = Px - Pcenter;
147 dD.
dx = Dx - Dcenter;
155 dP.
dy = Py - Pcenter;
156 dD.
dy = Dy - Dcenter;
162 #ifdef __CAMERA_CLIPPING__
164 float z_inv = 1.0f /
normalize(Pcamera).z;
166 ray->P += nearclip * ray->D;
167 ray->dP += nearclip * ray->dD;
194 if (aperturesize > 0.0f) {
203 P = Pcamera + lensuvw;
212 #ifdef __CAMERA_MOTION__
224 #ifdef __RAY_DIFFERENTIALS__
234 #ifdef __CAMERA_CLIPPING__
270 float aperturesize = cam->aperturesize;
272 if (aperturesize > 0.0f) {
278 float3 Pfocus = Dfocus * cam->focaldistance;
286 P =
U * lensuv.
x +
V * lensuv.
y;
291 Transform cameratoworld = cam->cameratoworld;
293 #ifdef __CAMERA_MOTION__
294 if (cam->num_motion_steps) {
296 &cameratoworld, cam_motion, cam->num_motion_steps, ray->time);
301 bool use_stereo = cam->interocular_offset != 0.0f;
312 #ifdef __RAY_DIFFERENTIALS__
334 dP.
dx = Px - Pcenter;
335 dD.
dx = Dx - Dcenter;
345 dP.
dy = Py - Pcenter;
346 dD.
dy = Dy - Dcenter;
351 #ifdef __CAMERA_CLIPPING__
353 float nearclip = cam->nearclip;
354 ray->P += nearclip * ray->D;
355 ray->dP += nearclip * ray->dD;
357 ray->tmax = cam->cliplength;
377 int filter_table_offset =
kernel_data.tables.filter_table_offset;
381 #ifdef __CAMERA_MOTION__
390 const int shutter_table_offset =
kernel_data.cam.shutter_table_offset;
404 const float duration =
kernel_data.cam.rolling_shutter_duration;
405 if (duration != 0.0f) {
411 ray->time = (ray->time - 0.5f) * duration;
412 ray->time += (
time - 0.5f) * (1.0f - duration) + 0.5f;
429 #ifdef __CAMERA_MOTION__
443 return make_float3(cameratoworld.
x.w, cameratoworld.
y.w, cameratoworld.
z.w);
456 return len(
P - camP);
469 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
#define ccl_device_inline
#define CCL_NAMESPACE_END
ccl_device_inline float3 panorama_to_direction(ccl_constant KernelCamera *cam, float u, float v)
ccl_device_inline void spherical_stereo_transform(ccl_constant KernelCamera *cam, ccl_private float3 *P, ccl_private float3 *D)
ccl_device_inline float2 direction_to_panorama(ccl_constant KernelCamera *cam, float3 dir)
ccl_device_inline float3 transform_perspective(ccl_private const ProjectionTransform *t, const float3 a)
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define kernel_data_array(name)
ccl_device_forceinline float differential_make_compact(const differential3 D)
ccl_device_forceinline float differential_zero_compact()
CCL_NAMESPACE_BEGIN ccl_device float2 camera_sample_aperture(ccl_constant KernelCamera *cam, float u, float v)
ccl_device void camera_sample_perspective(KernelGlobals kg, float raster_x, float raster_y, float lens_u, float lens_v, ccl_private Ray *ray)
ccl_device_inline float3 camera_position(KernelGlobals kg)
ccl_device_inline float camera_distance(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_private Ray *ray)
ccl_device_inline float3 camera_world_to_ndc(KernelGlobals kg, ccl_private ShaderData *sd, float3 P)
ccl_device_inline float3 camera_direction_from_point(KernelGlobals kg, float3 P)
ccl_device_inline void camera_sample_panorama(ccl_constant KernelCamera *cam, float raster_x, float raster_y, float lens_u, float lens_v, ccl_private Ray *ray)
ccl_device void camera_sample_orthographic(KernelGlobals kg, float raster_x, float raster_y, float lens_u, float lens_v, ccl_private Ray *ray)
ccl_device_inline float camera_z_depth(KernelGlobals kg, float3 P)
#define __CAMERA_MOTION__
#define FILTER_TABLE_SIZE
#define SHUTTER_TABLE_SIZE
CCL_NAMESPACE_BEGIN ccl_device float lookup_table_read(KernelGlobals kg, float x, int offset, int size)
ccl_device_inline float2 interp(const float2 &a, const float2 &b, float t)
ccl_device_inline float3 zero_float3()
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
vec_base< T, 3 > cross(const vec_base< T, 3 > &a, const vec_base< T, 3 > &b)
vec_base< T, Size > normalize(const vec_base< T, Size > &v)
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 float3 float4_to_float3(const float4 a)
BLI_INLINE float D(const float *data, const int res[3], int x, int y, int z)
CCL_NAMESPACE_BEGIN struct Window V