forked from cyberbotics/webots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost_processing_effect.h
85 lines (69 loc) · 5.05 KB
/
post_processing_effect.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef WR_POST_PROCESSING_EFFECT_H
#define WR_POST_PROCESSING_EFFECT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <wren/texture.h>
struct WrPostProcessingEffect;
typedef struct WrPostProcessingEffect WrPostProcessingEffect;
struct WrPostProcessingEffectPass;
typedef struct WrPostProcessingEffectPass WrPostProcessingEffectPass;
struct WrFrameBuffer;
typedef struct WrFrameBuffer WrFrameBuffer;
struct WrMesh;
typedef struct WrMesh WrMesh;
struct WrShaderProgram;
typedef struct WrShaderProgram WrShaderProgram;
struct WrTextureRtt;
typedef struct WrTextureRtt WrTextureRtt;
struct WrViewport;
typedef struct WrViewport WrViewport;
WrPostProcessingEffectPass *wr_post_processing_effect_pass_new();
void wr_post_processing_effect_pass_delete(WrPostProcessingEffectPass *pass);
void wr_post_processing_effect_pass_set_name(WrPostProcessingEffectPass *pass, const char *name);
void wr_post_processing_effect_pass_set_program(WrPostProcessingEffectPass *pass, WrShaderProgram *program);
/* This function requires a persistent pointer to the value (it is not copied from the source), otherwise WREN crashes here. */
void wr_post_processing_effect_pass_set_program_parameter(WrPostProcessingEffectPass *pass, const char *parameter_name,
const char *value);
void wr_post_processing_effect_pass_set_output_size(WrPostProcessingEffectPass *pass, int width, int height);
/* Texture counts needs to be specified before setting individual input textures or output formats */
void wr_post_processing_effect_pass_set_input_texture_count(WrPostProcessingEffectPass *pass, int count);
void wr_post_processing_effect_pass_set_output_texture_count(WrPostProcessingEffectPass *pass, int count);
void wr_post_processing_effect_pass_set_input_texture_wrap_mode(WrPostProcessingEffectPass *pass, int index,
WrTextureWrapMode mode);
void wr_post_processing_effect_pass_set_input_texture_interpolation(WrPostProcessingEffectPass *pass, int index, bool enable);
void wr_post_processing_effect_pass_set_output_texture_format(WrPostProcessingEffectPass *pass, int index,
WrTextureInternalFormat format);
void wr_post_processing_effect_pass_set_input_texture(WrPostProcessingEffectPass *pass, int index, WrTexture *texture);
/* The pass will be invoked 'count' times (1 by default) */
void wr_post_processing_effect_pass_set_iteration_count(WrPostProcessingEffectPass *pass, int count);
WrTextureRtt *wr_post_processing_effect_pass_get_output_texture(WrPostProcessingEffectPass *pass, int index);
void wr_post_processing_effect_pass_set_clear_before_draw(WrPostProcessingEffectPass *pass, bool enable);
void wr_post_processing_effect_pass_set_alpha_blending(WrPostProcessingEffectPass *pass, bool enable);
WrPostProcessingEffect *wr_post_processing_effect_new();
void wr_post_processing_effect_delete(WrPostProcessingEffect *post_processing_effect);
/* Specifying an input framebuffer is optional. If available, its first output texture will be used as
the first input texture of the effect's first pass */
void wr_post_processing_effect_set_input_frame_buffer(WrPostProcessingEffect *post_processing_effect,
WrFrameBuffer *frame_buffer);
/* At a minimum, one pass needs to be specified */
void wr_post_processing_effect_append_pass(WrPostProcessingEffect *post_processing_effect, WrPostProcessingEffectPass *pass);
/* Sets output texture 'output_index' of pass 'from' as input texture 'input_index' of pass 'to' */
void wr_post_processing_effect_connect(WrPostProcessingEffect *post_processing_effect, WrPostProcessingEffectPass *from,
int output_index, WrPostProcessingEffectPass *to, int input_index);
/* Will usually be a pass-through shader, but can be any shader with only one input */
void wr_post_processing_effect_set_result_program(WrPostProcessingEffect *post_processing_effect, WrShaderProgram *program);
/* Will hold the result of applying the result program to the first output texture of the last pass */
void wr_post_processing_effect_set_result_frame_buffer(WrPostProcessingEffect *post_processing_effect,
WrFrameBuffer *frame_buffer);
WrPostProcessingEffectPass *wr_post_processing_effect_get_first_pass(WrPostProcessingEffect *post_processing_effect);
WrPostProcessingEffectPass *wr_post_processing_effect_get_last_pass(WrPostProcessingEffect *post_processing_effect);
WrPostProcessingEffectPass *wr_post_processing_effect_get_pass(WrPostProcessingEffect *post_processing_effect,
const char *name);
void wr_post_processing_effect_set_drawing_index(WrPostProcessingEffect *post_processing_effect, unsigned int index);
void wr_post_processing_effect_setup(WrPostProcessingEffect *post_processing_effect);
void wr_post_processing_effect_apply(WrPostProcessingEffect *post_processing_effect);
#ifdef __cplusplus
}
#endif
#endif // WR_POST_PROCESSING_EFFECT_H