mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-08 07:28:22 -10:00
This is a generic way to get matrix data to shaders without using (old-school) uniforms. This is another step towards more compatibility with how new APIs (Vulkan) do things to increase the odds for a Vulkan port at some point.
45 lines
1.2 KiB
C
45 lines
1.2 KiB
C
#pragma once
|
|
|
|
#include "graphics/2d.h"
|
|
|
|
extern transform_stack gr_model_matrix_stack;
|
|
extern matrix4 gr_view_matrix;
|
|
extern matrix4 gr_model_view_matrix;
|
|
extern matrix4 gr_projection_matrix;
|
|
extern matrix4 gr_last_projection_matrix;
|
|
extern matrix4 gr_env_texture_matrix;
|
|
|
|
void gr_matrix_on_frame();
|
|
|
|
void gr_start_instance_matrix(const vec3d* offset, const matrix* rotation);
|
|
void gr_start_angles_instance_matrix(const vec3d* pos, const angles* rotation);
|
|
void gr_end_instance_matrix();
|
|
|
|
void gr_set_proj_matrix(float fov, float aspect, float z_near, float z_far);
|
|
void gr_end_proj_matrix();
|
|
|
|
void gr_set_view_matrix(const vec3d* pos, const matrix* orient);
|
|
void gr_end_view_matrix();
|
|
|
|
void gr_set_2d_matrix(/*int x, int y, int w, int h*/);
|
|
void gr_end_2d_matrix();
|
|
|
|
void gr_push_scale_matrix(const vec3d *scale_factor);
|
|
void gr_pop_scale_matrix();
|
|
|
|
void gr_setup_viewport();
|
|
|
|
void gr_reset_matrices();
|
|
|
|
extern matrix4 gr_texture_matrix;
|
|
|
|
void gr_set_texture_panning(float u, float v, bool enable);
|
|
|
|
/**
|
|
* @brief Set current matrix uniforms
|
|
*
|
|
* Use this before rendering with a shader requiring the matrix uniforms so that the matrix uniform block point has the
|
|
* up-to-date data.
|
|
*/
|
|
void gr_matrix_set_uniforms();
|