Implement gl_polyblend for GL3.

Closes #965.
This commit is contained in:
Yamagi 2023-01-21 16:24:02 +01:00
parent c5c2af0320
commit 548b7ff37f
3 changed files with 8 additions and 0 deletions

View file

@ -309,6 +309,11 @@ GL3_Draw_Fill(int x, int y, int w, int h, int c)
void
GL3_Draw_Flash(const float color[4], float x, float y, float w, float h)
{
if (gl_polyblend->value == 0)
{
return;
}
int i=0;
GLfloat vBuf[8] = {

View file

@ -97,6 +97,7 @@ cvar_t *gl3_particle_size;
cvar_t *gl3_particle_fade_factor;
cvar_t *gl3_particle_square;
cvar_t *gl3_colorlight;
cvar_t *gl_polyblend;
cvar_t *gl_lefthand;
cvar_t *r_gunfov;
@ -219,6 +220,7 @@ GL3_Register(void)
gl3_particle_square = ri.Cvar_Get("gl3_particle_square", "0", CVAR_ARCHIVE);
// if set to 0, lights (from lightmaps, dynamic lights and on models) are white instead of colored
gl3_colorlight = ri.Cvar_Get("gl3_colorlight", "1", CVAR_ARCHIVE);
gl_polyblend = ri.Cvar_Get("gl_polyblend", "1", CVAR_ARCHIVE);
// 0: use lots of calls to glBufferData()
// 1: reduce calls to glBufferData() with one big VBO (see GL3_BufferAndDraw3D())

View file

@ -543,6 +543,7 @@ extern cvar_t *gl3_overbrightbits;
extern cvar_t *gl3_particle_fade_factor;
extern cvar_t *gl3_particle_square;
extern cvar_t *gl3_colorlight;
extern cvar_t *gl_polyblend;
extern cvar_t *r_modulate;
extern cvar_t *gl_lightmap;