24 return x *
x *
x * (
x * (
x * 6.0f - 15.0f) + 10.0f);
30 uint value_stack_offset,
31 uint parameters_stack_offsets,
32 uint results_stack_offsets,
35 uint from_min_stack_offset, from_max_stack_offset, to_min_stack_offset, to_max_stack_offset;
36 uint type_stack_offset, steps_stack_offset, result_stack_offset;
38 &from_min_stack_offset,
39 &from_max_stack_offset,
41 &to_max_stack_offset);
43 results_stack_offsets, &type_stack_offset, &steps_stack_offset, &result_stack_offset);
57 if (from_max != from_min) {
59 switch (type_stack_offset) {
62 factor = (value - from_min) / (from_max - from_min);
65 factor = (value - from_min) / (from_max - from_min);
70 factor = (from_min > from_max) ? 1.0f -
smoothstep(from_max, from_min, factor) :
75 factor = (from_min > from_max) ? 1.0f -
smootherstep(from_max, from_min, factor) :
80 result = to_min + factor * (to_max - to_min);
MINLINE float safe_divide(float a, float b)
@ NODE_MAP_RANGE_SMOOTHERSTEP
@ NODE_MAP_RANGE_SMOOTHSTEP
ccl_device_inline uint4 read_node(KernelGlobals *kg, int *offset)
ccl_device_inline float stack_load_float_default(float *stack, uint a, uint value)
ccl_device_inline float stack_load_float(float *stack, uint a)
ccl_device_forceinline void svm_unpack_node_uchar3(uint i, uint *x, uint *y, uint *z)
ccl_device_forceinline void svm_unpack_node_uchar4(uint i, uint *x, uint *y, uint *z, uint *w)
ccl_device_inline void stack_store_float(float *stack, uint a, float f)
#define ccl_device_inline
#define CCL_NAMESPACE_END
CCL_NAMESPACE_BEGIN ccl_device_inline float smootherstep(float edge0, float edge1, float x)
ccl_device void svm_node_map_range(KernelGlobals *kg, ShaderData *sd, float *stack, uint value_stack_offset, uint parameters_stack_offsets, uint results_stack_offsets, int *offset)
ccl_device_inline float smoothstep(float edge0, float edge1, float x)
ccl_device_inline int clamp(int a, int mn, int mx)