mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-15 23:12:14 +00:00
b9a6fe80a4
Turns out that the name doesn't accurately describe what it does. It is correct for images that come with their own palette or are true color. But for images using the game palette it doesn't use the red channel to determine translucency but the palette index! Ugh... This means it cannot be done with a simple operation in the shader because it won't get a proper source image. The only solution is to create a separate texture.
48 lines
738 B
C
48 lines
738 B
C
#ifndef R_RENDER
|
|
#define R_RENDER
|
|
|
|
#include "basictypes.h"
|
|
|
|
enum RenderFlags
|
|
{
|
|
// [BB] Added texture compression flags.
|
|
RFL_TEXTURE_COMPRESSION=1,
|
|
RFL_TEXTURE_COMPRESSION_S3TC=2,
|
|
|
|
RFL_FRAMEBUFFER = 4,
|
|
RFL_BUFFER_STORAGE = 8,
|
|
RFL_SHADER_STORAGE_BUFFER = 16,
|
|
};
|
|
|
|
enum TexMode
|
|
{
|
|
TM_MODULATE = 0, // (r, g, b, a)
|
|
TM_MASK = 1, // (1, 1, 1, a)
|
|
TM_OPAQUE = 2, // (r, g, b, 1)
|
|
TM_INVERSE = 3, // (1-r, 1-g, 1-b, a)
|
|
};
|
|
|
|
struct RenderContext
|
|
{
|
|
unsigned int flags;
|
|
unsigned int maxuniforms;
|
|
float version;
|
|
float glslversion;
|
|
int max_texturesize;
|
|
char * vendorstring;
|
|
|
|
int MaxLights() const
|
|
{
|
|
return maxuniforms>=2048? 128:64;
|
|
}
|
|
|
|
bool hasGLSL() const
|
|
{
|
|
return glslversion >= 1.3f;
|
|
}
|
|
};
|
|
|
|
extern RenderContext gl;
|
|
|
|
#endif
|
|
|