24 float vecx, vecy, dvecx, dvecy,
x,
y,
len;
26 for (i =
num - 1; i >= 0; i--) {
30 for (j =
num - 1; j >= 0; j--) {
32 vecx = jit1[j][0] -
x - 1.0f;
33 vecy = jit1[j][1] -
y - 1.0f;
34 for (k = 3; k > 0; k--) {
35 if (
fabsf(vecx) < radius1 &&
fabsf(vecy) < radius1) {
36 len =
sqrtf(vecx * vecx + vecy * vecy);
37 if (
len > 0 &&
len < radius1) {
45 if (
fabsf(vecx) < radius1 &&
fabsf(vecy) < radius1) {
46 len =
sqrtf(vecx * vecx + vecy * vecy);
47 if (
len > 0 &&
len < radius1) {
55 if (
fabsf(vecx) < radius1 &&
fabsf(vecy) < radius1) {
56 len =
sqrtf(vecx * vecx + vecy * vecy);
57 if (
len > 0 &&
len < radius1) {
76 memcpy(jit1, jit2, 2 *
uint(
num) *
sizeof(
float));
82 float vecx, vecy, dvecx, dvecy,
x,
y;
84 for (i =
num - 1; i >= 0; i--) {
88 for (j =
num - 1; j >= 0; j--) {
90 vecx = jit1[j][0] -
x - 1.0f;
91 vecy = jit1[j][1] -
y - 1.0f;
93 if (
fabsf(vecx) < radius2) {
94 dvecx += vecx * radius2;
97 if (
fabsf(vecx) < radius2) {
98 dvecx += vecx * radius2;
101 if (
fabsf(vecx) < radius2) {
102 dvecx += vecx * radius2;
105 if (
fabsf(vecy) < radius2) {
106 dvecy += vecy * radius2;
109 if (
fabsf(vecy) < radius2) {
110 dvecy += vecy * radius2;
113 if (
fabsf(vecy) < radius2) {
114 dvecy += vecy * radius2;
126 memcpy(jit1, jit2,
uint(
num) *
sizeof(
float[2]));
132 float number_fl, number_fl_sqrt;
133 float x, rad1, rad2, rad3;
142 number_fl_sqrt =
sqrtf(number_fl);
145 rad1 = 1.0f / number_fl_sqrt;
146 rad2 = 1.0f / number_fl;
147 rad3 = number_fl_sqrt / number_fl;
152 for (i = 0; i <
num; i++) {
161 for (i = 0; i < 24; i++) {
170 for (i = 0; i <
num; i++) {
171 jitarr[i][0] -= 0.5f;
172 jitarr[i][1] -= 0.5f;
Read Blender memory allocation and freeing.
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
double BLI_rng_get_double(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_jitterate2(float(*jit1)[2], float(*jit2)[2], int num, float radius2)
struct RNG * BLI_rng_new(unsigned int seed)
void BLI_jitterate1(float(*jit1)[2], float(*jit2)[2], int num, float radius1)
void BLI_jitter_init(float(*jitarr)[2], int num)
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
ATTR_WARN_UNUSED_RESULT const size_t num
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float