* Replace license text in headers with SPDX identifiers. * Remove specific license info from outdated readme.txt, instead leave details to the source files. * Add list of SPDX license identifiers used, and corresponding license texts. * Update copyright dates while we're at it. Ref D14069, T95597
33 lines
1005 B
Plaintext
33 lines
1005 B
Plaintext
/* SPDX-License-Identifier: Apache-2.0
|
|
* Copyright 2011-2022 Blender Foundation */
|
|
|
|
#include "stdcycles.h"
|
|
|
|
shader node_voxel_texture(string filename = "",
|
|
string interpolation = "linear",
|
|
int use_mapping = 0,
|
|
matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
|
|
point Vector = P,
|
|
output float Density = 0,
|
|
output color Color = 0)
|
|
{
|
|
point p = Vector;
|
|
if (use_mapping) {
|
|
p = transform(mapping, p);
|
|
}
|
|
else {
|
|
p = transform("object", Vector);
|
|
matrix tfm;
|
|
if (getattribute("geom:generated_transform", tfm))
|
|
p = transform(tfm, p);
|
|
}
|
|
if (p[0] < 0.0 || p[1] < 0.0 || p[2] < 0.0 || p[0] > 1.0 || p[1] > 1.0 || p[2] > 1.0) {
|
|
Density = 0;
|
|
Color = color(0, 0, 0);
|
|
}
|
|
else {
|
|
Color = (color)texture3d(
|
|
filename, p, "wrap", "periodic", "interp", interpolation, "alpha", Density);
|
|
}
|
|
}
|