17 n = (n + 1013) & 0x7fffffff;
19 nn = (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff;
20 return 0.5f * ((
float)nn / 1073741824.0f);
24 const float mortar_size,
25 const float mortar_smooth,
28 const float row_height,
29 const float offset_amount,
30 const int offset_frequency,
31 const float squash_amount,
32 const int squash_frequency)
42 if (offset_frequency && squash_frequency) {
43 brick_width *= (rownum % squash_frequency) ? 1.0f : squash_amount;
44 offset = (rownum % offset_frequency) ? 0.0f : (brick_width * offset_amount);
49 x = (p.
x + offset) - brick_width * bricknum;
50 y = p.
y - row_height * rownum;
53 float min_dist =
min(
min(
x,
y),
min(brick_width -
x, row_height -
y));
56 if (min_dist >= mortar_size) {
59 else if (mortar_smooth == 0.0f) {
63 min_dist = 1.0f - min_dist / mortar_size;
93 node.offset_frequency,
95 node.squash_frequency);
97 const float tint = f2.
x;
101 const float facm = 1.0f - tint;
102 color1 = facm * color1 + tint * color2;
ccl_device_noinline void svm_node_tex_brick(ccl_private float *ccl_restrict stack, const ccl_global SVMNodeTexBrick &ccl_restrict node)
ccl_device_noinline_cpu float2 svm_brick(const float3 p, const float mortar_size, const float mortar_smooth, const float bias, float brick_width, const float row_height, const float offset_amount, const int offset_frequency, const float squash_amount, const int squash_frequency)
CCL_NAMESPACE_BEGIN ccl_device_inline float brick_noise(uint n)
ccl_device_inline void stack_store_float(ccl_private float *stack, const uint a, const float f)
ccl_device_inline float3 stack_load_float3(const ccl_private float *stack, const uint a)
ccl_device_inline void stack_store_float3(ccl_private float *stack, const uint a, const float3 f)
ccl_device_inline bool stack_valid(const uint a)
ccl_device_inline T stack_load(const ccl_private float *stack, const uint a)
#define ccl_device_noinline_cpu
#define ccl_device_inline
#define ccl_device_noinline
#define CCL_NAMESPACE_END
float3x3 scale(float3x3 mat, float2 scale)
ccl_device_inline float smoothstepf(const float f)
ccl_device_inline int floor_to_int(const float f)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float