Blender
V5.3
source
blender
draw
engines
eevee
eevee_sampling_shared.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11
#pragma once
12
13
#include "
GPU_shader_shared_utils.hh
"
14
15
#ifndef GPU_SHADER
16
namespace
blender::eevee
{
17
#endif
18
19
enum
[[
host_shared
]]
eSamplingDimension
:
uint32_t
{
20
SAMPLING_FILTER_U
= 0u,
21
SAMPLING_FILTER_V
= 1u,
22
SAMPLING_LENS_U
= 2u,
23
SAMPLING_LENS_V
= 3u,
24
SAMPLING_TIME
= 4u,
25
SAMPLING_SHADOW_U
= 5u,
26
SAMPLING_SHADOW_V
= 6u,
27
SAMPLING_SHADOW_W
= 7u,
28
SAMPLING_SHADOW_X
= 8u,
29
SAMPLING_SHADOW_Y
= 9u,
30
SAMPLING_CLOSURE
= 10u,
31
SAMPLING_LIGHTPROBE
= 11u,
32
SAMPLING_TRANSPARENCY
= 12u,
33
SAMPLING_SSS_U
= 13u,
34
SAMPLING_SSS_V
= 14u,
35
SAMPLING_RAYTRACE_U
= 15u,
36
SAMPLING_RAYTRACE_V
= 16u,
37
SAMPLING_RAYTRACE_W
= 17u,
38
SAMPLING_RAYTRACE_X
= 18u,
39
SAMPLING_AO_U
= 19u,
40
SAMPLING_AO_V
= 20u,
41
SAMPLING_AO_W
= 21u,
42
SAMPLING_CURVES_U
= 22u,
43
SAMPLING_VOLUME_U
= 23u,
44
SAMPLING_VOLUME_V
= 24u,
45
SAMPLING_VOLUME_W
= 25u,
46
SAMPLING_SHADOW_I
= 26u,
47
SAMPLING_SHADOW_J
= 27u,
48
SAMPLING_SHADOW_K
= 28u,
49
SAMPLING_GBUFFER_U
= 29u,
50
SAMPLING_GBUFFER_V
= 30u,
51
SAMPLING_GBUFFER_W
= 31u,
52
SAMPLING_FILM_U
= 32u,
53
SAMPLING_PANORAMIC_U
= 33u,
54
SAMPLING_PANORAMIC_V
= 34u,
55
};
56
61
static
constexpr
int
SAMPLING_DIMENSION_COUNT
= 36;
62
63
/* NOTE(@fclem): Needs to be used in #StorageBuffer because of arrays of scalar. */
64
struct
[[
host_shared
]]
SamplingData
{
66
float
dimensions
[
SAMPLING_DIMENSION_COUNT
];
67
};
68
69
/* Returns total sample count in a web pattern of the given size. */
70
static
inline
int
sampling_web_sample_count_get
(
int
web_density,
int
in_ring_count)
71
{
72
return
((in_ring_count * in_ring_count + in_ring_count) / 2) * web_density + 1;
73
}
74
75
/* Returns lowest possible ring count that contains at least sample_count samples. */
76
static
inline
int
sampling_web_ring_count_get
(
int
web_density,
int
sample_count)
77
{
78
/* Inversion of web_sample_count_get(). */
79
float
x
= 2.0f * (
float
(sample_count) - 1.0f) /
float
(web_density);
80
/* Solving polynomial. We only search positive solution. */
81
float
discriminant = 1.0f + 4.0f *
x
;
82
return
int(
ceilf
(0.5f * (
sqrtf
(discriminant) - 1.0f)));
83
}
84
85
#ifndef GPU_SHADER
86
}
// namespace blender::eevee
87
#endif
GPU_shader_shared_utils.hh
host_shared
#define host_shared
Definition
GPU_shader_shared_utils.hh:144
blender::eevee
Definition
eevee_ambient_occlusion.cc:29
blender::eevee::eSamplingDimension
eSamplingDimension
Definition
eevee_sampling_shared.hh:19
blender::eevee::SAMPLING_SSS_U
@ SAMPLING_SSS_U
Definition
eevee_sampling_shared.hh:33
blender::eevee::SAMPLING_VOLUME_V
@ SAMPLING_VOLUME_V
Definition
eevee_sampling_shared.hh:44
blender::eevee::SAMPLING_AO_W
@ SAMPLING_AO_W
Definition
eevee_sampling_shared.hh:41
blender::eevee::SAMPLING_FILTER_V
@ SAMPLING_FILTER_V
Definition
eevee_sampling_shared.hh:21
blender::eevee::SAMPLING_GBUFFER_V
@ SAMPLING_GBUFFER_V
Definition
eevee_sampling_shared.hh:50
blender::eevee::SAMPLING_VOLUME_W
@ SAMPLING_VOLUME_W
Definition
eevee_sampling_shared.hh:45
blender::eevee::SAMPLING_SHADOW_J
@ SAMPLING_SHADOW_J
Definition
eevee_sampling_shared.hh:47
blender::eevee::SAMPLING_TIME
@ SAMPLING_TIME
Definition
eevee_sampling_shared.hh:24
blender::eevee::SAMPLING_LENS_U
@ SAMPLING_LENS_U
Definition
eevee_sampling_shared.hh:22
blender::eevee::SAMPLING_RAYTRACE_W
@ SAMPLING_RAYTRACE_W
Definition
eevee_sampling_shared.hh:37
blender::eevee::SAMPLING_SHADOW_W
@ SAMPLING_SHADOW_W
Definition
eevee_sampling_shared.hh:27
blender::eevee::SAMPLING_FILTER_U
@ SAMPLING_FILTER_U
Definition
eevee_sampling_shared.hh:20
blender::eevee::SAMPLING_CURVES_U
@ SAMPLING_CURVES_U
Definition
eevee_sampling_shared.hh:42
blender::eevee::SAMPLING_SSS_V
@ SAMPLING_SSS_V
Definition
eevee_sampling_shared.hh:34
blender::eevee::SAMPLING_SHADOW_Y
@ SAMPLING_SHADOW_Y
Definition
eevee_sampling_shared.hh:29
blender::eevee::SAMPLING_RAYTRACE_U
@ SAMPLING_RAYTRACE_U
Definition
eevee_sampling_shared.hh:35
blender::eevee::SAMPLING_SHADOW_I
@ SAMPLING_SHADOW_I
Definition
eevee_sampling_shared.hh:46
blender::eevee::SAMPLING_SHADOW_V
@ SAMPLING_SHADOW_V
Definition
eevee_sampling_shared.hh:26
blender::eevee::SAMPLING_RAYTRACE_X
@ SAMPLING_RAYTRACE_X
Definition
eevee_sampling_shared.hh:38
blender::eevee::SAMPLING_GBUFFER_W
@ SAMPLING_GBUFFER_W
Definition
eevee_sampling_shared.hh:51
blender::eevee::SAMPLING_SHADOW_X
@ SAMPLING_SHADOW_X
Definition
eevee_sampling_shared.hh:28
blender::eevee::SAMPLING_RAYTRACE_V
@ SAMPLING_RAYTRACE_V
Definition
eevee_sampling_shared.hh:36
blender::eevee::SAMPLING_GBUFFER_U
@ SAMPLING_GBUFFER_U
Definition
eevee_sampling_shared.hh:49
blender::eevee::SAMPLING_PANORAMIC_V
@ SAMPLING_PANORAMIC_V
Definition
eevee_sampling_shared.hh:54
blender::eevee::SAMPLING_SHADOW_K
@ SAMPLING_SHADOW_K
Definition
eevee_sampling_shared.hh:48
blender::eevee::SAMPLING_AO_V
@ SAMPLING_AO_V
Definition
eevee_sampling_shared.hh:40
blender::eevee::SAMPLING_FILM_U
@ SAMPLING_FILM_U
Definition
eevee_sampling_shared.hh:52
blender::eevee::SAMPLING_PANORAMIC_U
@ SAMPLING_PANORAMIC_U
Definition
eevee_sampling_shared.hh:53
blender::eevee::SAMPLING_LIGHTPROBE
@ SAMPLING_LIGHTPROBE
Definition
eevee_sampling_shared.hh:31
blender::eevee::SAMPLING_AO_U
@ SAMPLING_AO_U
Definition
eevee_sampling_shared.hh:39
blender::eevee::SAMPLING_CLOSURE
@ SAMPLING_CLOSURE
Definition
eevee_sampling_shared.hh:30
blender::eevee::SAMPLING_TRANSPARENCY
@ SAMPLING_TRANSPARENCY
Definition
eevee_sampling_shared.hh:32
blender::eevee::SAMPLING_VOLUME_U
@ SAMPLING_VOLUME_U
Definition
eevee_sampling_shared.hh:43
blender::eevee::SAMPLING_SHADOW_U
@ SAMPLING_SHADOW_U
Definition
eevee_sampling_shared.hh:25
blender::eevee::SAMPLING_LENS_V
@ SAMPLING_LENS_V
Definition
eevee_sampling_shared.hh:23
blender::eevee::sampling_web_ring_count_get
static int sampling_web_ring_count_get(int web_density, int sample_count)
Definition
eevee_sampling_shared.hh:76
blender::eevee::SAMPLING_DIMENSION_COUNT
static constexpr int SAMPLING_DIMENSION_COUNT
Definition
eevee_sampling_shared.hh:61
blender::eevee::sampling_web_sample_count_get
static int sampling_web_sample_count_get(int web_density, int in_ring_count)
Definition
eevee_sampling_shared.hh:70
blender::uint32_t
unsigned int uint32_t
Definition
BKE_text.h:81
blender::x
x
Definition
BLI_expr_pylike_eval_test.cc:347
sqrtf
#define sqrtf
Definition
radial_tiling_shared.hh:85
ceilf
#define ceilf
Definition
radial_tiling_shared.hh:76
float
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
Definition
shadow_state_template.h:80
blender::eevee::SamplingData
Definition
eevee_sampling_shared.hh:64
blender::eevee::SamplingData::dimensions
float dimensions[SAMPLING_DIMENSION_COUNT]
Definition
eevee_sampling_shared.hh:66
Generated on
for Blender by
doxygen
1.18.0