Blender V5.3
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
14#include "kernel/svm/util.h"
15
17
19
20/* Blackbody Node */
21
23 ccl_private float *ccl_restrict stack,
25{
26 /* Input */
27 const float temperature = stack_load(stack, node.temperature);
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, node.color_offset, color_rgb);
33}
34
CCL_NAMESPACE_BEGIN ccl_device_noinline void svm_node_blackbody(KernelGlobals kg, ccl_private float *ccl_restrict stack, const ccl_global SVMNodeBlackbody &ccl_restrict node)
Definition blackbody.h:22
btScalar max
ccl_device_inline void stack_store_float3(ccl_private float *stack, const uint a, const float3 f)
ccl_device_inline T stack_load(const ccl_private float *stack, const uint a)
#define ccl_restrict
#define ccl_private
#define ccl_global
#define ccl_device_noinline
#define CCL_NAMESPACE_END
ccl_device float3 rec709_to_rgb(KernelGlobals kg, const float3 rec709)
CCL_NAMESPACE_BEGIN ccl_device_inline float3 zero_float3()
Definition math_float3.h:17
ccl_device float3 svm_math_blackbody_color_rec709(const float t)
Definition math_util.h:211