Blender V5.0
gpencil_vfx_infos.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
8# include "gpu_shader_compat.hh"
9
11
12# include "draw_view_infos.hh"
14
15# define COMPOSITE
16#endif
17
19
20GPU_SHADER_CREATE_INFO(gpencil_fx_common)
21SAMPLER(0, sampler2D, color_buf)
22SAMPLER(1, sampler2D, reveal_buf)
23/* Reminder: This is considered SRC color in blend equations.
24 * Same operation on all buffers. */
25FRAGMENT_OUT(0, float4, frag_color)
26FRAGMENT_OUT(1, float4, fragRevealage)
27FRAGMENT_SOURCE("gpencil_vfx_frag.glsl")
29
30GPU_SHADER_CREATE_INFO(gpencil_fx_composite)
32DEFINE("COMPOSITE")
33PUSH_CONSTANT(bool, is_first_pass)
34ADDITIONAL_INFO(gpencil_fx_common)
35ADDITIONAL_INFO(gpu_fullscreen)
37
38GPU_SHADER_CREATE_INFO(gpencil_fx_colorize)
40DEFINE("COLORIZE")
41PUSH_CONSTANT(float3, low_color)
42PUSH_CONSTANT(float3, high_color)
43PUSH_CONSTANT(float, factor)
44PUSH_CONSTANT(int, mode)
45ADDITIONAL_INFO(gpencil_fx_common)
46ADDITIONAL_INFO(gpu_fullscreen)
48
49GPU_SHADER_CREATE_INFO(gpencil_fx_blur)
51DEFINE("BLUR")
52PUSH_CONSTANT(float2, offset)
53PUSH_CONSTANT(int, samp_count)
54ADDITIONAL_INFO(gpencil_fx_common)
55ADDITIONAL_INFO(gpu_fullscreen)
57
58GPU_SHADER_CREATE_INFO(gpencil_fx_transform)
60DEFINE("TRANSFORM")
61PUSH_CONSTANT(float2, axis_flip)
62PUSH_CONSTANT(float2, wave_dir)
63PUSH_CONSTANT(float2, wave_offset)
64PUSH_CONSTANT(float, wave_phase)
65PUSH_CONSTANT(float2, swirl_center)
66PUSH_CONSTANT(float, swirl_angle)
67PUSH_CONSTANT(float, swirl_radius)
68ADDITIONAL_INFO(gpencil_fx_common)
69ADDITIONAL_INFO(gpu_fullscreen)
71
72GPU_SHADER_CREATE_INFO(gpencil_fx_glow)
74DEFINE("GLOW")
75PUSH_CONSTANT(float4, glow_color)
76PUSH_CONSTANT(float2, offset)
77PUSH_CONSTANT(int, samp_count)
78PUSH_CONSTANT(float4, threshold)
79PUSH_CONSTANT(bool, first_pass)
80PUSH_CONSTANT(bool, glow_under)
81PUSH_CONSTANT(int, blend_mode)
82ADDITIONAL_INFO(gpencil_fx_common)
83ADDITIONAL_INFO(gpu_fullscreen)
85
86GPU_SHADER_CREATE_INFO(gpencil_fx_rim)
88DEFINE("RIM")
89PUSH_CONSTANT(float2, blur_dir)
90PUSH_CONSTANT(float2, uv_offset)
91PUSH_CONSTANT(float3, rim_color)
92PUSH_CONSTANT(float3, mask_color)
93PUSH_CONSTANT(int, samp_count)
94PUSH_CONSTANT(int, blend_mode)
95PUSH_CONSTANT(bool, is_first_pass)
96ADDITIONAL_INFO(gpencil_fx_common)
97ADDITIONAL_INFO(gpu_fullscreen)
99
100GPU_SHADER_CREATE_INFO(gpencil_fx_shadow)
102DEFINE("SHADOW")
103PUSH_CONSTANT(float4, shadow_color)
104PUSH_CONSTANT(float2, uv_rot_x)
105PUSH_CONSTANT(float2, uv_rot_y)
106PUSH_CONSTANT(float2, uv_offset)
107PUSH_CONSTANT(float2, blur_dir)
108PUSH_CONSTANT(float2, wave_dir)
109PUSH_CONSTANT(float2, wave_offset)
110PUSH_CONSTANT(float, wave_phase)
111PUSH_CONSTANT(int, samp_count)
112PUSH_CONSTANT(bool, is_first_pass)
113ADDITIONAL_INFO(gpencil_fx_common)
114ADDITIONAL_INFO(gpu_fullscreen)
116
117GPU_SHADER_CREATE_INFO(gpencil_fx_pixelize)
119DEFINE("PIXELIZE")
120PUSH_CONSTANT(float2, target_pixel_size)
121PUSH_CONSTANT(float2, target_pixel_offset)
122PUSH_CONSTANT(float2, accum_offset)
123PUSH_CONSTANT(int, samp_count)
124ADDITIONAL_INFO(gpencil_fx_common)
125ADDITIONAL_INFO(gpu_fullscreen)
#define GPU_SHADER_CREATE_INFO(_info)
#define GPU_SHADER_CREATE_END()
#define SAMPLER(slot, type, name)
#define FRAGMENT_SOURCE(filename)
#define ADDITIONAL_INFO(info_name)
#define PUSH_CONSTANT(type, name)
#define DEFINE(name)
#define FRAGMENT_OUT(slot, type, name)
#define DO_STATIC_COMPILATION()
SamplerBase< float, 2 > sampler2D