Blender V4.3
invert.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
9ccl_device float invert(float color, float factor)
10{
11 return factor * (1.0f - color) + (1.0f - factor) * color;
12}
13
15 ccl_private float *stack,
16 uint in_fac,
17 uint in_color,
18 uint out_color)
19{
20 float factor = stack_load_float(stack, in_fac);
21 float3 color = stack_load_float3(stack, in_color);
22
23 color.x = invert(color.x, factor);
24 color.y = invert(color.y, factor);
25 color.z = invert(color.z, factor);
26
27 if (stack_valid(out_color)) {
28 stack_store_float3(stack, out_color, color);
29 }
30}
31
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
#define ccl_device
#define ccl_private
#define ccl_device_noinline
#define CCL_NAMESPACE_END
ccl_device_noinline void svm_node_invert(ccl_private ShaderData *sd, ccl_private float *stack, uint in_fac, uint in_color, uint out_color)
Definition invert.h:14
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
Definition invert.h:9
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_inline float stack_load_float(ccl_private float *stack, uint a)
ccl_device_inline bool stack_valid(uint a)
ShaderData