Files
test2/intern/cycles/kernel/svm/blackbody.h
Lukas Stockner 11ae08157e Revert Cycles SVM state cleanup due to Mac ARM test timeout
Not sure what is happening here, needs to be checked by someone on Mac.
Let's revert for now, it's not like this is a critical change.

Pull Request: https://projects.blender.org/blender/blender/pulls/110443
2024-10-08 00:33:56 +02:00

32 lines
962 B
C

/* SPDX-FileCopyrightText: 2009-2010 Sony Pictures Imageworks Inc., et al. All Rights Reserved.
* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
*
* SPDX-License-Identifier: BSD-3-Clause
*
* Adapted code from Open Shading Language. */
#pragma once
#include "kernel/svm/math_util.h"
CCL_NAMESPACE_BEGIN
/* Blackbody Node */
ccl_device_noinline void svm_node_blackbody(KernelGlobals kg,
ccl_private ShaderData *sd,
ccl_private float *stack,
uint temperature_offset,
uint col_offset)
{
/* Input */
float temperature = stack_load_float(stack, temperature_offset);
float3 color_rgb = rec709_to_rgb(kg, svm_math_blackbody_color_rec709(temperature));
color_rgb = max(color_rgb, zero_float3());
stack_store_float3(stack, col_offset, color_rgb);
}
CCL_NAMESPACE_END