Blender
V5.0
intern
cycles
kernel
svm
blackbody.h
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2009-2010 Sony Pictures Imageworks Inc., et al. All Rights Reserved.
2
* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
3
*
4
* SPDX-License-Identifier: BSD-3-Clause
5
*
6
* Adapted code from Open Shading Language. */
7
8
#pragma once
9
10
#include "
kernel/globals.h
"
11
12
#include "
kernel/svm/math_util.h
"
13
#include "
kernel/svm/util.h
"
14
15
#include "
kernel/util/colorspace.h
"
16
17
CCL_NAMESPACE_BEGIN
18
19
/* Blackbody Node */
20
21
ccl_device_noinline
void
svm_node_blackbody
(
KernelGlobals
kg,
22
ccl_private
float
*stack,
23
const
uint
temperature_offset,
24
const
uint
col_offset)
25
{
26
/* Input */
27
const
float
temperature =
stack_load_float
(stack, temperature_offset);
28
29
float3
color_rgb =
rec709_to_rgb
(kg,
svm_math_blackbody_color_rec709
(temperature));
30
color_rgb =
max
(color_rgb,
zero_float3
());
31
32
stack_store_float3
(stack, col_offset, color_rgb);
33
}
34
35
CCL_NAMESPACE_END
uint
unsigned int uint
Definition
BLI_sys_types.h:64
svm_node_blackbody
CCL_NAMESPACE_BEGIN ccl_device_noinline void svm_node_blackbody(KernelGlobals kg, ccl_private float *stack, const uint temperature_offset, const uint col_offset)
Definition
blackbody.h:21
util.h
stack_load_float
ccl_device_inline float stack_load_float(const ccl_private float *stack, const uint a)
Definition
cycles/kernel/svm/util.h:37
stack_store_float3
ccl_device_inline void stack_store_float3(ccl_private float *stack, const uint a, const float3 f)
Definition
cycles/kernel/svm/util.h:31
ccl_private
#define ccl_private
KernelGlobals
const ThreadKernelGlobalsCPU * KernelGlobals
Definition
device/cpu/globals.h:92
ccl_device_noinline
#define ccl_device_noinline
CCL_NAMESPACE_END
#define CCL_NAMESPACE_END
Definition
device/cuda/compat.h:10
globals.h
colorspace.h
rec709_to_rgb
ccl_device float3 rec709_to_rgb(KernelGlobals kg, const float3 rec709)
Definition
kernel/util/colorspace.h:25
zero_float3
CCL_NAMESPACE_BEGIN ccl_device_inline float3 zero_float3()
Definition
math_float3.h:17
math_util.h
svm_math_blackbody_color_rec709
ccl_device float3 svm_math_blackbody_color_rec709(const float t)
Definition
math_util.h:207
CCL_NAMESPACE_BEGIN
Definition
python.cpp:37
float3
Definition
sky_math.h:135
max
max
Definition
text_draw.cc:251
Generated on
for Blender by
doxygen
1.16.1