Functions for configuring shaders, rendering scenes, and drawing shadow maps. More...
Classes | |
struct | WorldShaders |
A structure to hold various shaders used in the rendering process. More... | |
Functions | |
void | render_scene (struct Window *window, struct Node *node, struct Camera *c, mat4 modelMatrix, Shader activeShader, struct WorldShaders *shaders, int viewportWidth, int viewportHeight) |
Renders the scene using the specified shader. | |
void | draw_shadow_map (struct Window *window, struct Node *root, struct Camera *c, struct WorldShaders *shaders, struct DepthMap *depthMap) |
Draws the shadow map for the scene. | |
void | draw_scene (struct Window *window, struct Node *root, struct Camera *c, struct WorldShaders *shaders, struct DepthMap *depthMap) |
Draws the entire scene. | |
void | draw_screen (struct Window *window, struct Node *scene, struct Camera *c, WorldShaders *shaders, struct DepthMap *depthMap, struct Mesh *screenPlane) |
Draws the final screen output. | |
Functions for configuring shaders, rendering scenes, and drawing shadow maps.
void render_scene | ( | struct Window * | window, |
struct Node * | node, | ||
struct Camera * | c, | ||
mat4 | modelMatrix, | ||
Shader | activeShader, | ||
struct WorldShaders * | shaders, | ||
int | viewportWidth, | ||
int | viewportHeight | ||
) |
Renders the scene using the specified shader.
This function renders the scene graph starting from the given node using the active shader. It applies the model matrix transformations and uses the provided camera and world shaders to render the scene.
window | Pointer to the Window structure. |
node | Pointer to the current Node in the scene graph. |
c | Pointer to the Camera structure. |
modelMatrix | The model matrix for transforming the node. |
activeShader | The shader program to use for rendering. |
shaders | Pointer to the WorldShaders structure containing shader programs. |
viewportWidth | The width of the viewport. |
viewportHeight | The height of the viewport. |
void draw_shadow_map | ( | struct Window * | window, |
struct Node * | root, | ||
struct Camera * | c, | ||
struct WorldShaders * | shaders, | ||
struct DepthMap * | depthMap | ||
) |
Draws the shadow map for the scene.
This function generates the shadow map by rendering the scene from the light's perspective. It uses the provided window, scene graph root node, camera, world shaders, and depth map to create the shadow map.
window | Pointer to the Window structure. |
root | Pointer to the root Node of the scene graph. |
c | Pointer to the Camera structure. |
shaders | Pointer to the WorldShaders structure containing shader programs. |
depthMap | Pointer to the DepthMap structure for storing the shadow map. |
void draw_scene | ( | struct Window * | window, |
struct Node * | root, | ||
struct Camera * | c, | ||
struct WorldShaders * | shaders, | ||
struct DepthMap * | depthMap | ||
) |
Draws the entire scene.
This function renders the entire scene graph starting from the root node. It uses the provided window, camera, world shaders, and depth map to render the scene with shadows and other effects.
window | Pointer to the Window structure. |
root | Pointer to the root Node of the scene graph. |
c | Pointer to the Camera structure. |
shaders | Pointer to the WorldShaders structure containing shader programs. |
depthMap | Pointer to the DepthMap structure for shadow mapping. |
void draw_screen | ( | struct Window * | window, |
struct Node * | scene, | ||
struct Camera * | c, | ||
WorldShaders * | shaders, | ||
struct DepthMap * | depthMap, | ||
struct Mesh * | screenPlane | ||
) |
Draws the final screen output.
This function renders the final output to the screen. It uses the provided window, scene graph, camera, world shaders, depth map, and screen plane mesh to render the final image. on the screen.
window | Pointer to the Window structure. |
scene | Pointer to the root Node of the scene graph. |
c | Pointer to the Camera structure. |
shaders | Pointer to the WorldShaders structure containing shader programs. |
depthMap | Pointer to the DepthMap structure for shadow mapping. |
screenPlane | Pointer to the Mesh structure representing the screen plane. |