Blender V4.3
white_noise.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
8
11 ccl_private float *stack,
12 uint dimensions,
13 uint inputs_stack_offsets,
14 uint outputs_stack_offsets)
15{
16 uint vector_stack_offset, w_stack_offset, value_stack_offset, color_stack_offset;
17 svm_unpack_node_uchar2(inputs_stack_offsets, &vector_stack_offset, &w_stack_offset);
18 svm_unpack_node_uchar2(outputs_stack_offsets, &value_stack_offset, &color_stack_offset);
19
20 float3 vector = stack_load_float3(stack, vector_stack_offset);
21 float w = stack_load_float(stack, w_stack_offset);
22
23 if (stack_valid(color_stack_offset)) {
25 switch (dimensions) {
26 case 1:
27 color = hash_float_to_float3(w);
28 break;
29 case 2:
31 break;
32 case 3:
34 break;
35 case 4:
37 break;
38 default:
39 color = make_float3(1.0f, 0.0f, 1.0f);
41 break;
42 }
43 stack_store_float3(stack, color_stack_offset, color);
44 }
45
46 if (stack_valid(value_stack_offset)) {
47 float value;
48 switch (dimensions) {
49 case 1:
50 value = hash_float_to_float(w);
51 break;
52 case 2:
54 break;
55 case 3:
57 break;
58 case 4:
60 break;
61 default:
62 value = 0.0f;
64 break;
65 }
66 stack_store_float(stack, value_stack_offset, value);
67 }
68}
69
unsigned int uint
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a color
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
#define kernel_assert(cond)
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define ccl_private
#define ccl_device_noinline
#define CCL_NAMESPACE_END
ccl_device_forceinline float4 make_float4(const float x, const float y, const float z, const float w)
ccl_device_forceinline float3 make_float3(const float x, const float y, const float z)
ccl_device_forceinline float2 make_float2(const float x, const float y)
ccl_device_inline float3 hash_float_to_float3(float k)
Definition hash.h:203
ccl_device_inline float3 hash_float4_to_float3(float4 k)
Definition hash.h:217
ccl_device_inline float3 hash_float2_to_float3(float2 k)
Definition hash.h:210
ccl_device_inline float hash_float2_to_float(float2 k)
Definition hash.h:163
ccl_device_inline float hash_float4_to_float(float4 k)
Definition hash.h:173
ccl_device_inline float hash_float3_to_float(float3 k)
Definition hash.h:168
ccl_device_inline float3 hash_float3_to_float3(float3 k)
Definition hash.h:186
ccl_device_inline void stack_store_float3(ccl_private float *stack, uint a, float3 f)
CCL_NAMESPACE_BEGIN ccl_device_inline float3 stack_load_float3(ccl_private float *stack, uint a)
ccl_device_forceinline void svm_unpack_node_uchar2(uint i, ccl_private uint *x, ccl_private uint *y)
ccl_device_inline void stack_store_float(ccl_private float *stack, uint a, float f)
ccl_device_inline float stack_load_float(ccl_private float *stack, uint a)
ccl_device_inline bool stack_valid(uint a)
ShaderData
float hash_float_to_float(float k)
Definition node_hash.h:13
CCL_NAMESPACE_BEGIN ccl_device_noinline void svm_node_tex_white_noise(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, uint dimensions, uint inputs_stack_offsets, uint outputs_stack_offsets)
Definition white_noise.h:9