Blender V4.3
brightness.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
10
12 ccl_private ShaderData *sd, ccl_private float *stack, uint in_color, uint out_color, uint node)
13{
14 uint bright_offset, contrast_offset;
15 float3 color = stack_load_float3(stack, in_color);
16
17 svm_unpack_node_uchar2(node, &bright_offset, &contrast_offset);
18 float brightness = stack_load_float(stack, bright_offset);
19 float contrast = stack_load_float(stack, contrast_offset);
20
21 color = svm_brightness_contrast(color, brightness, contrast);
22
23 if (stack_valid(out_color))
24 stack_store_float3(stack, out_color, color);
25}
26
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
CCL_NAMESPACE_BEGIN ccl_device_noinline void svm_node_brightness(ccl_private ShaderData *sd, ccl_private float *stack, uint in_color, uint out_color, uint node)
Definition brightness.h:11
ccl_device_inline float3 svm_brightness_contrast(float3 color, float brightness, float contrast)
Definition color_util.h:310
#define ccl_private
#define ccl_device_noinline
#define CCL_NAMESPACE_END
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 float stack_load_float(ccl_private float *stack, uint a)
ccl_device_inline bool stack_valid(uint a)
ShaderData