qzdoom/src/gl_load/gl_interface.h
Christoph Oelckers 4937848123 - refactoring of fixed colormap stuff to have it better organized and to reduce the number of uniforms in the main shader.
This removes 3 uniforms, consisting of 9 floats. Those were merged into other values that never get used at the same time.
It also moves the costly setup of the fixed colormap out of the render state into the 2D processing code.
Since 3D forces use of render buffers now, it is no longer necessary to draw the entire scene with the colormap active, meaning it can be handled more efficiently.
2018-06-16 22:40:44 +02:00

48 lines
1.2 KiB
C

#ifndef R_RENDER
#define R_RENDER
#include "basictypes.h"
enum TexMode
{
TM_MODULATE = 0, // (r, g, b, a)
TM_MASK, // (1, 1, 1, a)
TM_OPAQUE, // (r, g, b, 1)
TM_INVERSE, // (1-r, 1-g, 1-b, a)
TM_REDTOALPHA, // (1, 1, 1, r)
TM_CLAMPY, // (r, g, b, (t >= 0.0 && t <= 1.0)? a:0)
TM_INVERTOPAQUE, // (1-r, 1-g, 1-b, 1)
TM_FOGLAYER, // (renders a fog layer in the shape of the active texture)
TM_FIXEDCOLORMAP = TM_FOGLAYER, // repurposes the objectcolor uniforms to render a fixed colormap range. (Same constant because they cannot be used in the same context.
};
enum ELightMethod
{
LM_DEFERRED = 1, // calculate lights up front in a separate pass
LM_DIRECT = 2, // calculate lights on the fly along with the render data
};
enum EBufferMethod
{
BM_DEFERRED = 1, // use a temporarily mapped buffer, for GL 3.x core profile
BM_PERSISTENT = 2 // use a persistently mapped buffer
};
struct RenderContext
{
unsigned int flags;
unsigned int maxuniforms;
unsigned int maxuniformblock;
unsigned int uniformblockalignment;
int lightmethod;
int buffermethod;
float glslversion;
int max_texturesize;
char * vendorstring;
};
extern RenderContext gl;
#endif