Blender V4.3
compositor_glare_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
6
7/* -------
8 * Common.
9 * ------- */
10
11GPU_SHADER_CREATE_INFO(compositor_glare_highlights)
12 .local_group_size(16, 16)
13 .push_constant(Type::FLOAT, "threshold")
14 .sampler(0, ImageType::FLOAT_2D, "input_tx")
15 .image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
16 .compute_source("compositor_glare_highlights.glsl")
17 .do_static_compilation(true);
18
19GPU_SHADER_CREATE_INFO(compositor_glare_mix)
20 .local_group_size(16, 16)
21 .push_constant(Type::FLOAT, "mix_factor")
22 .sampler(0, ImageType::FLOAT_2D, "input_tx")
23 .sampler(1, ImageType::FLOAT_2D, "glare_tx")
24 .image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
25 .compute_source("compositor_glare_mix.glsl")
26 .do_static_compilation(true);
27
28/* ------------
29 * Ghost Glare.
30 * ------------ */
31
32GPU_SHADER_CREATE_INFO(compositor_glare_ghost_base)
33 .local_group_size(16, 16)
34 .sampler(0, ImageType::FLOAT_2D, "small_ghost_tx")
35 .sampler(1, ImageType::FLOAT_2D, "big_ghost_tx")
36 .image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "combined_ghost_img")
37 .compute_source("compositor_glare_ghost_base.glsl")
38 .do_static_compilation(true);
39
40GPU_SHADER_CREATE_INFO(compositor_glare_ghost_accumulate)
41 .local_group_size(16, 16)
42 .push_constant(Type::VEC4, "scales")
43 .push_constant(Type::VEC4, "color_modulators", 4)
44 .sampler(0, ImageType::FLOAT_2D, "input_ghost_tx")
45 .image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "accumulated_ghost_img")
46 .compute_source("compositor_glare_ghost_accumulate.glsl")
47 .do_static_compilation(true);
48
49/* -----------
50 * Simple Star
51 * ----------- */
52
53GPU_SHADER_CREATE_INFO(compositor_glare_simple_star_horizontal_pass)
54 .local_group_size(16)
55 .push_constant(Type::INT, "iterations")
56 .push_constant(Type::FLOAT, "fade_factor")
57 .image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "horizontal_img")
58 .compute_source("compositor_glare_simple_star_horizontal_pass.glsl")
59 .do_static_compilation(true);
60
61GPU_SHADER_CREATE_INFO(compositor_glare_simple_star_vertical_pass)
62 .local_group_size(16)
63 .push_constant(Type::INT, "iterations")
64 .push_constant(Type::FLOAT, "fade_factor")
65 .sampler(0, ImageType::FLOAT_2D, "horizontal_tx")
66 .image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "vertical_img")
67 .compute_source("compositor_glare_simple_star_vertical_pass.glsl")
68 .do_static_compilation(true);
69
70GPU_SHADER_CREATE_INFO(compositor_glare_simple_star_diagonal_pass)
71 .local_group_size(16)
72 .push_constant(Type::INT, "iterations")
73 .push_constant(Type::FLOAT, "fade_factor")
74 .image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "diagonal_img")
75 .compute_source("compositor_glare_simple_star_diagonal_pass.glsl")
76 .do_static_compilation(true);
77
78GPU_SHADER_CREATE_INFO(compositor_glare_simple_star_anti_diagonal_pass)
79 .local_group_size(16)
80 .push_constant(Type::INT, "iterations")
81 .push_constant(Type::FLOAT, "fade_factor")
82 .sampler(0, ImageType::FLOAT_2D, "diagonal_tx")
83 .image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "anti_diagonal_img")
84 .compute_source("compositor_glare_simple_star_anti_diagonal_pass.glsl")
85 .do_static_compilation(true);
86
87/* -------
88 * Streaks
89 * ------- */
90
91GPU_SHADER_CREATE_INFO(compositor_glare_streaks_filter)
92 .local_group_size(16, 16)
93 .push_constant(Type::FLOAT, "color_modulator")
94 .push_constant(Type::VEC3, "fade_factors")
95 .push_constant(Type::VEC2, "streak_vector")
96 .sampler(0, ImageType::FLOAT_2D, "input_streak_tx")
97 .image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_streak_img")
98 .compute_source("compositor_glare_streaks_filter.glsl")
99 .do_static_compilation(true);
100
101GPU_SHADER_CREATE_INFO(compositor_glare_streaks_accumulate)
102 .local_group_size(16, 16)
103 .push_constant(Type::FLOAT, "attenuation_factor")
104 .sampler(0, ImageType::FLOAT_2D, "streak_tx")
105 .image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "accumulated_streaks_img")
106 .compute_source("compositor_glare_streaks_accumulate.glsl")
107 .do_static_compilation(true);
108
109/* -----
110 * Bloom
111 * ----- */
112
113GPU_SHADER_CREATE_INFO(compositor_glare_bloom_downsample_shared)
114 .local_group_size(16, 16)
115 .sampler(0, ImageType::FLOAT_2D, "input_tx")
116 .image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "output_img")
117 .compute_source("compositor_glare_bloom_downsample.glsl");
118
119GPU_SHADER_CREATE_INFO(compositor_glare_bloom_downsample_simple_average)
120 .define("SIMPLE_AVERAGE")
121 .additional_info("compositor_glare_bloom_downsample_shared")
122 .do_static_compilation(true);
123
124GPU_SHADER_CREATE_INFO(compositor_glare_bloom_downsample_karis_average)
125 .define("KARIS_AVERAGE")
126 .additional_info("compositor_glare_bloom_downsample_shared")
127 .do_static_compilation(true);
128
129GPU_SHADER_CREATE_INFO(compositor_glare_bloom_upsample)
130 .local_group_size(16, 16)
131 .sampler(0, ImageType::FLOAT_2D, "input_tx")
132 .image(0, GPU_RGBA16F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "output_img")
133 .compute_source("compositor_glare_bloom_upsample.glsl")
134 .do_static_compilation(true);
local_group_size(16, 16) .push_constant(Type local_group_size(16, 16) .push_constant(Type small_ghost_tx GPU_RGBA16F
#define GPU_SHADER_CREATE_INFO(_info)