Blender  V2.93
kernel_path_common.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2015 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "util/util_hash.h"
18 
20 
22  KernelGlobals *kg, int sample, int x, int y, uint *rng_hash, ccl_addr_space Ray *ray)
23 {
24  float filter_u;
25  float filter_v;
26 
27  int num_samples = kernel_data.integrator.aa_samples;
28 
29  path_rng_init(kg, sample, num_samples, rng_hash, x, y, &filter_u, &filter_v);
30 
31  /* sample camera ray */
32 
33  float lens_u = 0.0f, lens_v = 0.0f;
34 
35  if (kernel_data.cam.aperturesize > 0.0f)
36  path_rng_2D(kg, *rng_hash, sample, num_samples, PRNG_LENS_U, &lens_u, &lens_v);
37 
38  float time = 0.0f;
39 
40 #ifdef __CAMERA_MOTION__
41  if (kernel_data.cam.shuttertime != -1.0f)
42  time = path_rng_1D(kg, *rng_hash, sample, num_samples, PRNG_TIME);
43 #endif
44 
45  camera_sample(kg, x, y, filter_u, filter_v, lens_u, lens_v, time, ray);
46 }
47 
unsigned int uint
Definition: BLI_sys_types.h:83
_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
double time
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)
#define kernel_data
#define ccl_addr_space
#define ccl_device_inline
#define CCL_NAMESPACE_END
CCL_NAMESPACE_BEGIN ccl_device_inline void kernel_path_trace_setup(KernelGlobals *kg, int sample, int x, int y, uint *rng_hash, ccl_addr_space Ray *ray)
ccl_device_forceinline void path_rng_2D(KernelGlobals *kg, uint rng_hash, int sample, int num_samples, int dimension, float *fx, float *fy)
Definition: kernel_random.h:91
ccl_device_inline void path_rng_init(KernelGlobals *kg, int sample, int num_samples, uint *rng_hash, int x, int y, float *fx, float *fy)
CCL_NAMESPACE_BEGIN ccl_device_forceinline float path_rng_1D(KernelGlobals *kg, uint rng_hash, int sample, int num_samples, int dimension)
Definition: kernel_random.h:53
@ PRNG_LENS_U
Definition: kernel_types.h:232
@ PRNG_TIME
Definition: kernel_types.h:234
static void sample(SocketReader *reader, int x, int y, float color[4])