Blender
V3.3
intern
cycles
blender
texture.cpp
Go to the documentation of this file.
1
/* SPDX-License-Identifier: Apache-2.0
2
* Copyright 2011-2022 Blender Foundation */
3
4
#include "
blender/texture.h
"
5
6
CCL_NAMESPACE_BEGIN
7
8
namespace
{
9
10
/* Point density helpers. */
11
12
void
density_texture_space_invert
(
float3
&loc,
float3
&
size
)
13
{
14
if
(
size
.x != 0.0f)
15
size
.x = 0.5f /
size
.x;
16
if
(
size
.y != 0.0f)
17
size
.y = 0.5f /
size
.y;
18
if
(
size
.z != 0.0f)
19
size
.z = 0.5f /
size
.z;
20
21
loc = loc *
size
-
make_float3
(0.5f, 0.5f, 0.5f);
22
}
23
24
}
/* namespace */
25
26
void
point_density_texture_space
(
BL::Depsgraph
&b_depsgraph,
27
BL::ShaderNodeTexPointDensity &b_point_density_node,
28
float3
&loc,
29
float3
&
size
)
30
{
31
BL::Object
b_ob(b_point_density_node.object());
32
if
(!b_ob) {
33
loc =
zero_float3
();
34
size
=
zero_float3
();
35
return
;
36
}
37
float3
min
,
max
;
38
b_point_density_node.calc_point_density_minmax(b_depsgraph, &
min
[0], &
max
[0]);
39
loc = (
min
+
max
) * 0.5f;
40
size
= (
max
-
min
) * 0.5f;
41
density_texture_space_invert
(loc,
size
);
42
}
43
44
CCL_NAMESPACE_END
Depsgraph
struct Depsgraph Depsgraph
Definition:
DEG_depsgraph.h:35
Object
struct Object Object
texture.h
size
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition:
btDbvt.cpp:52
CCL_NAMESPACE_END
#define CCL_NAMESPACE_END
Definition:
cuda/compat.h:9
zero_float3
ccl_device_inline float3 zero_float3()
Definition:
math_float3.h:80
make_float3
#define make_float3(x, y, z)
Definition:
metal/compat.h:204
CCL_NAMESPACE_BEGIN
Definition:
python.cpp:37
CCL_NAMESPACE_BEGIN::density_texture_space_invert
void density_texture_space_invert(float3 &loc, float3 &size)
Definition:
texture.cpp:12
min
#define min(a, b)
Definition:
sort.c:35
float3
Definition:
oneapi/compat.h:158
point_density_texture_space
void point_density_texture_space(BL::Depsgraph &b_depsgraph, BL::ShaderNodeTexPointDensity &b_point_density_node, float3 &loc, float3 &size)
Definition:
texture.cpp:26
max
float max
Definition:
transform_gizmo_3d.c:96
Generated on Tue Oct 22 2024 13:18:25 for Blender by
doxygen
1.9.1