Blender V4.5
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)
12LOCAL_GROUP_SIZE(16, 16)
13PUSH_CONSTANT(float, threshold)
14PUSH_CONSTANT(float, highlights_smoothness)
15PUSH_CONSTANT(float, max_brightness)
16SAMPLER(0, sampler2D, input_tx)
17IMAGE(0, GPU_RGBA16F, write, image2D, output_img)
18COMPUTE_SOURCE("compositor_glare_highlights.glsl")
21
22GPU_SHADER_CREATE_INFO(compositor_glare_mix)
23LOCAL_GROUP_SIZE(16, 16)
24PUSH_CONSTANT(float, saturation)
26SAMPLER(0, sampler2D, input_tx)
27SAMPLER(1, sampler2D, glare_tx)
28IMAGE(0, GPU_RGBA16F, write, image2D, output_img)
29COMPUTE_SOURCE("compositor_glare_mix.glsl")
32
33GPU_SHADER_CREATE_INFO(compositor_glare_write_glare_output)
34LOCAL_GROUP_SIZE(16, 16)
35PUSH_CONSTANT(float, saturation)
37SAMPLER(0, sampler2D, input_tx)
38IMAGE(0, GPU_RGBA16F, write, image2D, output_img)
39COMPUTE_SOURCE("compositor_glare_write_glare_output.glsl")
42
43GPU_SHADER_CREATE_INFO(compositor_glare_write_highlights_output)
44LOCAL_GROUP_SIZE(16, 16)
45SAMPLER(0, sampler2D, input_tx)
46IMAGE(0, GPU_RGBA16F, write, image2D, output_img)
47COMPUTE_SOURCE("compositor_glare_write_highlights_output.glsl")
50
51/* ------------
52 * Ghost Glare.
53 * ------------ */
54
55GPU_SHADER_CREATE_INFO(compositor_glare_ghost_base)
56LOCAL_GROUP_SIZE(16, 16)
57SAMPLER(0, sampler2D, small_ghost_tx)
58SAMPLER(1, sampler2D, big_ghost_tx)
59IMAGE(0, GPU_RGBA16F, write, image2D, combined_ghost_img)
60COMPUTE_SOURCE("compositor_glare_ghost_base.glsl")
63
64GPU_SHADER_CREATE_INFO(compositor_glare_ghost_accumulate)
65LOCAL_GROUP_SIZE(16, 16)
66PUSH_CONSTANT(float4, scales)
67PUSH_CONSTANT_ARRAY(float4, color_modulators, 4)
68SAMPLER(0, sampler2D, input_ghost_tx)
69IMAGE(0, GPU_RGBA16F, read_write, image2D, accumulated_ghost_img)
70COMPUTE_SOURCE("compositor_glare_ghost_accumulate.glsl")
73
74/* -----------
75 * Simple Star
76 * ----------- */
77
78GPU_SHADER_CREATE_INFO(compositor_glare_simple_star_horizontal_pass)
80PUSH_CONSTANT(int, iterations)
81PUSH_CONSTANT(float, fade_factor)
82IMAGE(0, GPU_RGBA16F, read_write, image2D, horizontal_img)
83COMPUTE_SOURCE("compositor_glare_simple_star_horizontal_pass.glsl")
86
87GPU_SHADER_CREATE_INFO(compositor_glare_simple_star_vertical_pass)
89PUSH_CONSTANT(int, iterations)
90PUSH_CONSTANT(float, fade_factor)
91SAMPLER(0, sampler2D, horizontal_tx)
92IMAGE(0, GPU_RGBA16F, read_write, image2D, vertical_img)
93COMPUTE_SOURCE("compositor_glare_simple_star_vertical_pass.glsl")
96
97GPU_SHADER_CREATE_INFO(compositor_glare_simple_star_diagonal_pass)
99PUSH_CONSTANT(int, iterations)
100PUSH_CONSTANT(float, fade_factor)
101IMAGE(0, GPU_RGBA16F, read_write, image2D, diagonal_img)
102COMPUTE_SOURCE("compositor_glare_simple_star_diagonal_pass.glsl")
105
106GPU_SHADER_CREATE_INFO(compositor_glare_simple_star_anti_diagonal_pass)
108PUSH_CONSTANT(int, iterations)
109PUSH_CONSTANT(float, fade_factor)
110SAMPLER(0, sampler2D, diagonal_tx)
111IMAGE(0, GPU_RGBA16F, read_write, image2D, anti_diagonal_img)
112COMPUTE_SOURCE("compositor_glare_simple_star_anti_diagonal_pass.glsl")
115
116/* -------
117 * Streaks
118 * ------- */
119
120GPU_SHADER_CREATE_INFO(compositor_glare_streaks_filter)
121LOCAL_GROUP_SIZE(16, 16)
122PUSH_CONSTANT(float, color_modulator)
123PUSH_CONSTANT(float3, fade_factors)
124PUSH_CONSTANT(float2, streak_vector)
125SAMPLER(0, sampler2D, input_streak_tx)
126IMAGE(0, GPU_RGBA16F, write, image2D, output_streak_img)
127COMPUTE_SOURCE("compositor_glare_streaks_filter.glsl")
130
131GPU_SHADER_CREATE_INFO(compositor_glare_streaks_accumulate)
132LOCAL_GROUP_SIZE(16, 16)
133PUSH_CONSTANT(float, attenuation_factor)
134SAMPLER(0, sampler2D, streak_tx)
135IMAGE(0, GPU_RGBA16F, read_write, image2D, accumulated_streaks_img)
136COMPUTE_SOURCE("compositor_glare_streaks_accumulate.glsl")
139
140/* -----
141 * Bloom
142 * ----- */
143
144GPU_SHADER_CREATE_INFO(compositor_glare_bloom_downsample_shared)
145LOCAL_GROUP_SIZE(16, 16)
146SAMPLER(0, sampler2D, input_tx)
147IMAGE(0, GPU_RGBA16F, write, image2D, output_img)
148COMPUTE_SOURCE("compositor_glare_bloom_downsample.glsl")
150
151GPU_SHADER_CREATE_INFO(compositor_glare_bloom_downsample_simple_average)
152DEFINE("SIMPLE_AVERAGE")
153ADDITIONAL_INFO(compositor_glare_bloom_downsample_shared)
156
157GPU_SHADER_CREATE_INFO(compositor_glare_bloom_downsample_karis_average)
158DEFINE("KARIS_AVERAGE")
159ADDITIONAL_INFO(compositor_glare_bloom_downsample_shared)
162
163GPU_SHADER_CREATE_INFO(compositor_glare_bloom_upsample)
164LOCAL_GROUP_SIZE(16, 16)
165SAMPLER(0, sampler2D, input_tx)
166IMAGE(0, GPU_RGBA16F, read_write, image2D, output_img)
167COMPUTE_SOURCE("compositor_glare_bloom_upsample.glsl")
@ GPU_RGBA16F
VecBase< float, 4 > float4
ImageBase< float, 2 > image2D
SamplerBase< float, 2 > sampler2D
#define PUSH_CONSTANT_ARRAY(type, name, array_size)
#define SAMPLER(slot, type, name)
#define ADDITIONAL_INFO(info_name)
#define PUSH_CONSTANT(type, name)
#define DEFINE(name)
#define GPU_SHADER_CREATE_INFO(_info)
#define LOCAL_GROUP_SIZE(...)
#define IMAGE(slot, format, qualifiers, type, name)
#define GPU_SHADER_CREATE_END()
#define COMPUTE_SOURCE(filename)
#define DO_STATIC_COMPILATION()