mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
This PR adds a Scene Time node to the shader editor. The goal is for parity with the Compositor and Geometry Nodes. As recommended by Bretch, this also adds a SceneAttributes class owned by Scene since there wasn't a good data structure to store scene data in. Co-authored-by: Brecht Van Lommel <brecht@blender.org> Co-authored-by: Clément Foucault <foucault.clem@gmail.com> Pull Request: https://projects.blender.org/blender/blender/pulls/156850
26 lines
732 B
C
26 lines
732 B
C
/* SPDX-FileCopyrightText: 2026 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
|
|
|
#pragma once
|
|
|
|
#include "kernel/globals.h"
|
|
|
|
#include "kernel/svm/node_types.h"
|
|
#include "kernel/svm/util.h"
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
ccl_device_noinline void svm_node_scene_time(KernelGlobals kg,
|
|
ccl_private float *ccl_restrict stack,
|
|
const ccl_global SVMNodeSceneTime &ccl_restrict node)
|
|
{
|
|
if (stack_valid(node.seconds_out)) {
|
|
stack_store_float(stack, node.seconds_out, kernel_data.scene_time.time);
|
|
}
|
|
if (stack_valid(node.frame_out)) {
|
|
stack_store_float(stack, node.frame_out, kernel_data.scene_time.frame);
|
|
}
|
|
}
|
|
|
|
CCL_NAMESPACE_END
|