This is an intermediate steps towards making lights actual geometry. Light is now a subclass of Geometry, which simplifies some code. The geometry is not added to the BVH yet, which would be the next step and improve light intersection performance with many lights. This makes object attributes work on lights. Co-authored-by: Lukas Stockner <lukas@lukasstockner.de> Pull Request: https://projects.blender.org/blender/blender/pulls/134846
21 lines
740 B
Plaintext
21 lines
740 B
Plaintext
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
|
|
|
#include "stdcycles.h"
|
|
|
|
shader node_object_info(output point Location = point(0.0, 0.0, 0.0),
|
|
output color Color = color(1.0, 1.0, 1.0),
|
|
output float Alpha = 1.0,
|
|
output float ObjectIndex = 0.0,
|
|
output float MaterialIndex = 0.0,
|
|
output float Random = 0.0)
|
|
{
|
|
getattribute("object:location", Location);
|
|
getattribute("object:color", Color);
|
|
getattribute("object:alpha", Alpha);
|
|
getattribute("object:index", ObjectIndex);
|
|
getattribute("material:index", MaterialIndex);
|
|
getattribute("object:random", Random);
|
|
}
|