28 #include "../../shared/cxx.h"
41 #define SKYBOX_DEPTH -9999.0f
44 #define GL_ARRAY_LENGTH_CHUNK 4096
58 #define MAX_GL_TEXUNITS 6
61 #define texunit_0 r_state.texunits[0]
62 #define texunit_1 r_state.texunits[1]
63 #define texunit_2 r_state.texunits[2]
64 #define texunit_3 r_state.texunits[3]
65 #define texunit_4 r_state.texunits[4]
66 #define texunit_5 r_state.texunits[5]
68 #define texunit_diffuse texunit_0
69 #define texunit_lightmap texunit_1
70 #define texunit_deluxemap texunit_2
71 #define texunit_normalmap texunit_3
72 #define texunit_glowmap texunit_4
73 #define texunit_specularmap texunit_5
74 #define texunit_roughnessmap texunit_2
76 #define COMPONENTS_VERTEX_ARRAY3D 3
77 #define COMPONENTS_VERTEX_ARRAY2D 2
78 #define COMPONENTS_COLOR_ARRAY 4
79 #define COMPONENTS_INDEX_ARRAY 1
80 #define COMPONENTS_NORMAL_ARRAY 3
81 #define COMPONENTS_TANGENT_ARRAY 4
82 #define COMPONENTS_TEXCOORD_ARRAY 2
84 #define DOWNSAMPLE_PASSES 5
85 #define DOWNSAMPLE_SCALE 2
87 #define fbo_screen nullptr
88 #define fbo_render r_state.renderBuffer
89 #define fbo_bloom0 r_state.bloomBuffer0
90 #define fbo_bloom1 r_state.bloomBuffer1
92 #define default_program nullptr
184 #define R_BindTexture(tn) R_BindTextureDebug(tn, __FILE__, __LINE__, __PRETTY_FUNCTION__)
void R_EnableBlur(r_program_t *program, bool enable, r_framebuffer_t *source, r_framebuffer_t *dest, int dir)
void R_EnableShell(bool enable)
r_program_t * warp_program
void R_BindArray(GLenum target, GLenum type, const void *array)
QGL_EXTERN GLint GLenum type
void R_ReallocateStateArrays(int size)
Reallocate arrays of GL primitives if needed.
r_framebuffer_t * buffers2[DOWNSAMPLE_PASSES]
void R_EnableBumpmap(const struct image_s *normalmap)
bool roughnessmap_enabled
void R_EnableRoughnessMap(const struct image_s *image, bool enable)
r_framebuffer_t * renderBuffer
r_program_t * atmosphere_program
r_program_t * active_program
void R_SetDefaultState(void)
GLfloat * vertex_array_3d
const GLenum *typedef GLint
void R_EnableFog(bool enable)
r_program_t * combine2_program
void R_TexOverride(vec4_t rgba)
Sets special texture environment mode to override texture color; don't forget to call R_TexOverride(n...
bool R_EnableLighting(r_program_t *program, bool enable)
Enables hardware-accelerated lighting with the specified program. This should be called after any tex...
gltexunit_t texunits[MAX_GL_TEXUNITS]
bool renderbuffer_enabled
const GLuint *typedef GLuint *typedef GLenum
void R_EnableMultisample(bool enable)
GLshort * vertex_array_2d
void R_EnableDrawAsGlow(bool enable)
void R_BindDeluxemapTexture(GLuint texnum)
void R_EnableAnimation(const struct mAliasMesh_s *mesh, float backlerp, bool enable)
const r_framebuffer_t * activeFramebuffer
r_framebuffer_t * bloomBuffer0
gltexunit_t * active_texunit
const vec2_t default_texcoords[4]
#define DOWNSAMPLE_PASSES
bool frameBufferObjectsInitialized
void R_TexEnv(GLenum value)
void R_SetupSpotLight(int index, const light_t *light)
texunits maintain multitexture state
void R_EnableTexture(gltexunit_t *texunit, bool enable)
GLfloat * next_vertex_array_3d
void R_EnableBlend(bool enable)
r_program_t * geoscape_program
r_program_t programs[MAX_PROGRAMS]
void R_BindTextureDebug(int texnum, const char *file, int line, const char *function)
void R_BindBuffer(GLenum target, GLenum type, GLuint id)
void R_UseMaterial(const material_t *material)
QGL_EXTERN GLenum GLuint * dest
bool R_SelectTexture(gltexunit_t *texunit)
Returns false if the texunit is not supported.
r_program_t * simple_glow_program
bool dynamic_lighting_enabled
void R_EnableAlphaTest(bool enable)
void R_EnableStencilTest(bool enable)
r_framebuffer_t * buffers0[DOWNSAMPLE_PASSES]
r_program_t * world_program
void R_BindLightmapTexture(GLuint texnum)
r_framebuffer_t * bloomBuffer1
void R_BlendFunc(GLenum src, GLenum dest)
const material_t * active_material
r_shader_t shaders[MAX_SHADERS]
void R_EnableGlowMap(const struct image_s *image)
GLfloat * next_normal_array
void R_DisableSpotLight(int index)
r_program_t * model_program
r_framebuffer_t * buffers1[DOWNSAMPLE_PASSES]
void R_EnableWarp(r_program_t *program, bool enable)
struct image_s * normalmap
void R_EnableSpecularMap(const struct image_s *image, bool enable)
r_program_t * convolve_program
bool stencil_test_enabled
GLfloat * next_tangent_array
struct gltexunit_s gltexunit_t
texunits maintain multitexture state
void R_ReallocateTexunitArray(gltexunit_t *texunit, int size)
Reallocate texcoord array of the specified texunit, if needed.
void R_BindDefaultArray(GLenum target)
Binds the appropriate shared vertex array to the specified target.
const struct image_s * active_normalmap
void R_EnableColorArray(bool enable)
void R_BindNormalmapTexture(GLuint texnum)
void R_BindTextureForTexUnit(GLuint texnum, gltexunit_t *texunit)
Header file for the render material subsystem.