Blender V4.5
eevee_lightprobe_sphere_info.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
5#ifdef GPU_SHADER
6# pragma once
7# include "gpu_glsl_cpp_stubs.hh"
8
10# include "draw_view_info.hh"
11# include "eevee_common_info.hh"
13# include "eevee_shader_shared.hh"
14
15# define SPHERE_PROBE
16#endif
17
18#include "eevee_defines.hh"
20
21/* Sample cubemap and remap into an octahedral texture. */
22GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_remap)
24SPECIALIZATION_CONSTANT(bool, extract_sh, true)
25SPECIALIZATION_CONSTANT(bool, extract_sun, true)
26PUSH_CONSTANT(int4, probe_coord_packed)
27PUSH_CONSTANT(int4, write_coord_packed)
28PUSH_CONSTANT(int4, world_coord_packed)
29SAMPLER(0, samplerCube, cubemap_tx)
30SAMPLER(1, sampler2DArray, atlas_tx)
31STORAGE_BUF(0, write, SphereProbeHarmonic, out_sh[])
32STORAGE_BUF(1, write, SphereProbeSunLight, out_sun[])
33IMAGE(0, GPU_RGBA16F, write, image2DArray, atlas_img)
34COMPUTE_SOURCE("eevee_lightprobe_sphere_remap_comp.glsl")
35ADDITIONAL_INFO(eevee_shared)
36ADDITIONAL_INFO(eevee_global_ubo)
39
40GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_irradiance)
42PUSH_CONSTANT(int3, probe_remap_dispatch_size)
43STORAGE_BUF(0, read, SphereProbeHarmonic, in_sh[])
44STORAGE_BUF(1, write, SphereProbeHarmonic, out_sh)
45ADDITIONAL_INFO(eevee_shared)
47COMPUTE_SOURCE("eevee_lightprobe_sphere_irradiance_comp.glsl")
49
50GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_sunlight)
52PUSH_CONSTANT(int3, probe_remap_dispatch_size)
53STORAGE_BUF(0, read, SphereProbeSunLight, in_sun[])
54STORAGE_BUF(1, write, LightData, sunlight_buf)
55ADDITIONAL_INFO(eevee_shared)
57COMPUTE_SOURCE("eevee_lightprobe_sphere_sunlight_comp.glsl")
59
60GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_select)
62STORAGE_BUF(0, read_write, SphereProbeData, lightprobe_sphere_buf[SPHERE_PROBE_MAX])
63PUSH_CONSTANT(int, lightprobe_sphere_count)
64ADDITIONAL_INFO(eevee_shared)
65ADDITIONAL_INFO(eevee_sampling_data)
66ADDITIONAL_INFO(eevee_global_ubo)
67ADDITIONAL_INFO(eevee_volume_probe_data)
68COMPUTE_SOURCE("eevee_lightprobe_sphere_select_comp.glsl")
71
72GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_convolve)
74ADDITIONAL_INFO(eevee_shared)
75PUSH_CONSTANT(int4, probe_coord_packed)
76PUSH_CONSTANT(int4, write_coord_packed)
77PUSH_CONSTANT(int4, read_coord_packed)
78PUSH_CONSTANT(int, read_lod)
79SAMPLER(0, samplerCube, cubemap_tx)
80SAMPLER(1, sampler2DArray, in_atlas_mip_tx)
81IMAGE(1, GPU_RGBA16F, write, image2DArray, out_atlas_mip_img)
82COMPUTE_SOURCE("eevee_lightprobe_sphere_convolve_comp.glsl")
85
86GPU_SHADER_INTERFACE_INFO(eevee_display_lightprobe_sphere_iface)
88SMOOTH(float2, lP)
89FLAT(int, probe_index)
91
92GPU_SHADER_CREATE_INFO(eevee_display_lightprobe_sphere)
93ADDITIONAL_INFO(eevee_shared)
94ADDITIONAL_INFO(draw_view)
95ADDITIONAL_INFO(eevee_lightprobe_sphere_data)
96STORAGE_BUF(0, read, SphereProbeDisplayData, display_data_buf[])
97VERTEX_SOURCE("eevee_display_lightprobe_sphere_vert.glsl")
98VERTEX_OUT(eevee_display_lightprobe_sphere_iface)
99FRAGMENT_SOURCE("eevee_display_lightprobe_sphere_frag.glsl")
100FRAGMENT_OUT(0, float4, out_color)
101BUILTINS(BuiltinBits::CLIP_CONTROL)
104
105GPU_SHADER_INTERFACE_INFO(eevee_display_lightprobe_planar_iface)
106FLAT(float3, probe_normal)
107FLAT(int, probe_index)
109
110GPU_SHADER_CREATE_INFO(eevee_display_lightprobe_planar)
111PUSH_CONSTANT(int4, world_coord_packed)
112ADDITIONAL_INFO(eevee_shared)
113ADDITIONAL_INFO(draw_view)
114ADDITIONAL_INFO(eevee_lightprobe_planar_data)
115ADDITIONAL_INFO(eevee_lightprobe_sphere_data)
116STORAGE_BUF(0, read, PlanarProbeDisplayData, display_data_buf[])
117VERTEX_SOURCE("eevee_display_lightprobe_planar_vert.glsl")
118VERTEX_OUT(eevee_display_lightprobe_planar_iface)
119FRAGMENT_SOURCE("eevee_display_lightprobe_planar_frag.glsl")
120FRAGMENT_OUT(0, float4, out_color)
121BUILTINS(BuiltinBits::CLIP_CONTROL)
124
@ GPU_RGBA16F
return true
#define SPHERE_PROBE_REMAP_GROUP_SIZE
#define SPHERE_PROBE_SH_GROUP_SIZE
#define SPHERE_PROBE_SELECT_GROUP_SIZE
#define SPHERE_PROBE_MAX
#define SPHERE_PROBE_GROUP_SIZE
ImageBase< float, 2, true > image2DArray
VecBase< float, 4 > float4
SamplerBase< float, 2, false, true > sampler2DArray
SamplerBase< float, 2, true > samplerCube
#define VERTEX_OUT(stage_interface)
#define SMOOTH(type, name)
#define SAMPLER(slot, type, name)
#define GPU_SHADER_INTERFACE_END()
#define FRAGMENT_SOURCE(filename)
#define SPECIALIZATION_CONSTANT(type, name, default_value)
#define ADDITIONAL_INFO(info_name)
#define PUSH_CONSTANT(type, name)
#define FLAT(type, name)
#define FRAGMENT_OUT(slot, type, name)
#define BUILTINS(builtin)
#define GPU_SHADER_INTERFACE_INFO(_interface)
#define STORAGE_BUF(slot, qualifiers, type_name, name)
#define GPU_SHADER_CREATE_INFO(_info)
#define VERTEX_SOURCE(filename)
#define LOCAL_GROUP_SIZE(...)
#define IMAGE(slot, format, qualifiers, type, name)
#define GPU_SHADER_CREATE_END()
#define COMPUTE_SOURCE(filename)
#define DO_STATIC_COMPILATION()
read