This file contains the declarations for shader management functions. More...
Macros | |
#define | DEFAULT_RENDER_SHADER "shaders/deferredShader.vs", "shaders/deferredShader.fs" |
Defines the default vertex and fragment shaders for rendering shadows. | |
#define | DEFAULT_DEPTH_SHADER "shaders/simpleDepthShader.vs", "shaders/simpleDepthShader.fs" |
Defines the default vertex and fragment shaders for simple depth rendering. | |
#define | DEFAULT_SCREEN_SHADER "shaders/screen.vs", "shaders/screen.fs" |
Defines the default vertex and fragment shaders for screen post-processing. | |
#define | DEFAULT_SMAA_SHADER "shaders/smaa.vs", "shaders/smaa.fs" |
Defines the default vertex and fragment shaders for SMAA (Subpixel Morphological Anti-Aliasing). | |
#define | DEFAULT_SKYBOX_SHADER "shaders/skybox.vs", "shaders/skybox.fs" |
Defines the default vertex and fragment shaders for rendering the skybox. | |
#define | DEFAULT_GUI_SHADER "shaders/gui.vs", "shaders/gui.fs" |
Defines the default vertex and fragment shaders for rendering the GUI. | |
#define | DEFAULT_SSR_SHADER "shaders/ssr.vs", "shaders/ssr.fs" |
Defines the default vertex and fragment shaders for Screen Space Reflections (SSR). | |
#define | DEFAULT_LIGHT_SHADER "shaders/lightPass.vs", "shaders/lightPass.fs" |
Defines the default vertex and fragment shaders for rendering lights. | |
#define | DEFAULT_SSAO_SHADER "shaders/ssao.vs", "shaders/ssao.fs" |
Defines the default vertex and fragment shaders for Screen Space Ambient Occlusion (SSAO). | |
#define | DEFAULT_SSAO_BLUR_SHADER "shaders/ssaoBlur.vs", "shaders/ssaoBlur.fs" |
Defines the default vertex and fragment shaders for SSAO blur. | |
#define | DEFAULT_BLOOM_SHADER "shaders/bloom.vs", "shaders/bloom.fs" |
Defines the default vertex and fragment shaders for bloom effect. | |
Functions | |
void | create_shaders (Shader shaders[]) |
Creates multiple shaders. | |
Shader | create_shader (char *vertexPath, char *fragmentPath) |
Creates a shader program from vertex and fragment shader files. | |
void | set_shader_screen_size (Shader ID, int width, int height) |
Sets the screen size for the shader program. | |
void | set_shaders_screen_size (int width, int height) |
Sets the screen size for all shaders. | |
void | use_shader (Shader ID) |
Uses the specified shader program. | |
void | set_shader_int (Shader ID, char *name, int value) |
Sets an integer uniform in the shader program. | |
void | set_shader_float (Shader ID, char *name, float value) |
Sets a float uniform in the shader program. | |
void | set_shader_vec2 (Shader ID, char *name, vec2 value) |
Sets a vec2 uniform in the shader program. | |
void | set_shader_vec3 (Shader ID, char *name, vec3 value) |
Sets a vec3 uniform in the shader program. | |
void | set_shader_vec4 (Shader ID, char *name, vec4 value) |
Sets a vec4 uniform in the shader program. | |
void | set_shader_mat4 (Shader ID, char *name, mat4 value) |
Sets a mat4 uniform in the shader program. | |
This file contains the declarations for shader management functions.
The functions declared in this file are used to create, use, and set various types of data in shaders. Shaders are essential for rendering graphics in OpenGL, and these functions provide a convenient interface for managing them.
#define DEFAULT_RENDER_SHADER "shaders/deferredShader.vs", "shaders/deferredShader.fs" |
Defines the default vertex and fragment shaders for rendering shadows.
The vertex shader is located at "shaders/forwardShadowShader.vs" and the fragment shader is located at "shaders/forwardShadowShader.fs".
#define DEFAULT_DEPTH_SHADER "shaders/simpleDepthShader.vs", "shaders/simpleDepthShader.fs" |
Defines the default vertex and fragment shaders for simple depth rendering.
The vertex shader is located at "shaders/simpleDepthShader.vs" and the fragment shader is located at "shaders/simpleDepthShader.fs".
#define DEFAULT_SCREEN_SHADER "shaders/screen.vs", "shaders/screen.fs" |
Defines the default vertex and fragment shaders for screen post-processing.
The vertex shader is located at "shaders/screen.vs" and the fragment shader is located at "shaders/screen.fs".
#define DEFAULT_SMAA_SHADER "shaders/smaa.vs", "shaders/smaa.fs" |
Defines the default vertex and fragment shaders for SMAA (Subpixel Morphological Anti-Aliasing).
The vertex shader is located at "shaders/smaa.vs" and the fragment shader is located at "shaders/smaa.fs".
#define DEFAULT_SKYBOX_SHADER "shaders/skybox.vs", "shaders/skybox.fs" |
Defines the default vertex and fragment shaders for rendering the skybox.
The vertex shader is located at "shaders/skybox.vs" and the fragment shader is located at "shaders/skybox.fs".
#define DEFAULT_GUI_SHADER "shaders/gui.vs", "shaders/gui.fs" |
Defines the default vertex and fragment shaders for rendering the GUI.
The vertex shader is located at "shaders/gui.vs" and the fragment shader is located at "shaders/gui.fs".
#define DEFAULT_SSR_SHADER "shaders/ssr.vs", "shaders/ssr.fs" |
Defines the default vertex and fragment shaders for Screen Space Reflections (SSR).
The vertex shader is located at "shaders/ssr.vs" and the fragment shader is located at "shaders/ssr.fs".
#define DEFAULT_LIGHT_SHADER "shaders/lightPass.vs", "shaders/lightPass.fs" |
Defines the default vertex and fragment shaders for rendering lights.
The vertex shader is located at "shaders/lightPass.vs" and the fragment shader is located at "shaders/lightPass.fs".
#define DEFAULT_SSAO_SHADER "shaders/ssao.vs", "shaders/ssao.fs" |
Defines the default vertex and fragment shaders for Screen Space Ambient Occlusion (SSAO).
The vertex shader is located at "shaders/ssao.vs" and the fragment shader is located at "shaders/ssao.fs".
#define DEFAULT_SSAO_BLUR_SHADER "shaders/ssaoBlur.vs", "shaders/ssaoBlur.fs" |
Defines the default vertex and fragment shaders for SSAO blur.
The vertex shader is located at "shaders/ssaoBlur.vs" and the fragment shader is located at "shaders/ssaoBlur.fs".
#define DEFAULT_BLOOM_SHADER "shaders/bloom.vs", "shaders/bloom.fs" |
Defines the default vertex and fragment shaders for bloom effect.
The vertex shader is located at "shaders/bloom.vs" and the fragment shader is located at "shaders/bloom.fs".
void create_shaders | ( | Shader | shaders[] | ) |
Creates multiple shaders.
This function initializes and compiles multiple shaders from predefined paths.
shaders | An array of Shader objects to be created. |
Shader create_shader | ( | char * | vertexPath, |
char * | fragmentPath | ||
) |
Creates a shader program from vertex and fragment shader files.
This function reads the vertex and fragment shader source code from the specified file paths, compiles them, and links them into a shader program.
vertexPath | The file path to the vertex shader source code. |
fragmentPath | The file path to the fragment shader source code. |
void set_shader_screen_size | ( | Shader | ID, |
int | width, | ||
int | height | ||
) |
Sets the screen size for the shader program.
This function sets the screen width and height for the shader program, which can be used for rendering calculations.
ID | The Shader object representing the shader program. |
width | The width of the screen. |
height | The height of the screen. |
void set_shaders_screen_size | ( | int | width, |
int | height | ||
) |
Sets the screen size for all shaders.
This function sets the screen width and height for all shaders in the shader cache.
width | The width of the screen. |
height | The height of the screen. |
void use_shader | ( | Shader | ID | ) |
Uses the specified shader program.
This function activates the shader program identified by the given Shader ID.
ID | The Shader object representing the shader program to be used. |
void set_shader_int | ( | Shader | ID, |
char * | name, | ||
int | value | ||
) |
Sets an integer uniform in the shader program.
This function sets the value of an integer uniform variable in the shader program.
ID | The Shader object representing the shader program. |
name | The name of the uniform variable in the shader program. |
value | The integer value to set for the uniform variable. |
void set_shader_float | ( | Shader | ID, |
char * | name, | ||
float | value | ||
) |
Sets a float uniform in the shader program.
This function sets the value of a float uniform variable in the shader program.
ID | The Shader object representing the shader program. |
name | The name of the uniform variable in the shader program. |
value | The float value to set for the uniform variable. |
void set_shader_vec2 | ( | Shader | ID, |
char * | name, | ||
vec2 | value | ||
) |
Sets a vec2 uniform in the shader program.
This function sets the value of a vec2 (2-component vector) uniform variable in the shader program.
ID | The Shader object representing the shader program. |
name | The name of the uniform variable in the shader program. |
value | The vec2 value to set for the uniform variable. |
void set_shader_vec3 | ( | Shader | ID, |
char * | name, | ||
vec3 | value | ||
) |
Sets a vec3 uniform in the shader program.
This function sets the value of a vec3 (3-component vector) uniform variable in the shader program.
ID | The Shader object representing the shader program. |
name | The name of the uniform variable in the shader program. |
value | The vec3 value to set for the uniform variable. |
void set_shader_vec4 | ( | Shader | ID, |
char * | name, | ||
vec4 | value | ||
) |
Sets a vec4 uniform in the shader program.
This function sets the value of a vec4 (4-component vector) uniform variable in the shader program.
ID | The Shader object representing the shader program. |
name | The name of the uniform variable in the shader program. |
value | The vec4 value to set for the uniform variable. |
void set_shader_mat4 | ( | Shader | ID, |
char * | name, | ||
mat4 | value | ||
) |
Sets a mat4 uniform in the shader program.
This function sets the value of a mat4 (4x4 matrix) uniform variable in the shader program.
ID | The Shader object representing the shader program. |
name | The name of the uniform variable in the shader program. |
value | The mat4 value to set for the uniform variable. |