]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - render.h
fix brightness of fullbright entities in r_glsl 1 mode by using a 128
[xonotic/darkplaces.git] / render.h
index be0cf47ef0e5e86c02cdf0e278d378c41a57a094..889ed6406380311a7d3f3c7e863269ea9d6bb630 100644 (file)
--- a/render.h
+++ b/render.h
@@ -175,6 +175,7 @@ extern cvar_t r_test;
 
 extern rtexture_t *r_texture_blanknormalmap;
 extern rtexture_t *r_texture_white;
+extern rtexture_t *r_texture_grey128;
 extern rtexture_t *r_texture_black;
 extern rtexture_t *r_texture_notexture;
 extern rtexture_t *r_texture_whitecube;
@@ -214,6 +215,7 @@ typedef struct rsurfacestate_s
        float *array_deformedsvector3f;
        float *array_deformedtvector3f;
        float *array_deformednormal3f;
+       float *array_generatedtexcoordtexture2f;
        float *array_color4f;
        float *array_texcoord3f;
 
@@ -284,6 +286,12 @@ typedef struct rsurfacestate_s
        float *lightmapcolor4f;
        int lightmapcolor4f_bufferobject;
        size_t lightmapcolor4f_bufferoffset;
+       float *texcoordtexture2f;
+       int texcoordtexture2f_bufferobject;
+       size_t texcoordtexture2f_bufferoffset;
+       float *texcoordlightmap2f;
+       int texcoordlightmap2f_bufferobject;
+       size_t texcoordlightmap2f_bufferoffset;
        // transform matrices to render this entity and effects on this entity
        matrix4x4_t matrix;
        matrix4x4_t inversematrix;
@@ -359,12 +367,13 @@ void RSurf_DrawBatch_Simple(int texturenumsurfaces, msurface_t **texturesurfacel
 #define SHADERPERMUTATION_FOG (1<<5) // tint the color by fog color or black if using additive blend mode
 #define SHADERPERMUTATION_COLORMAPPING (1<<6) // indicates this is a colormapped skin
 #define SHADERPERMUTATION_DIFFUSE (1<<7) // (lightsource) whether to use directional shading
-#define SHADERPERMUTATION_SPECULAR (1<<8) // (lightsource or deluxemapping) render specular effects
-#define SHADERPERMUTATION_CUBEFILTER (1<<9) // (lightsource) use cubemap light filter
-#define SHADERPERMUTATION_OFFSETMAPPING (1<<10) // adjust texcoords to roughly simulate a displacement mapped surface
-#define SHADERPERMUTATION_OFFSETMAPPING_RELIEFMAPPING (1<<11) // adjust texcoords to accurately simulate a displacement mapped surface (requires OFFSETMAPPING to also be set!)
+#define SHADERPERMUTATION_CONTRASTBOOST (1<<8) // r_glsl_contrastboost boosts the contrast at low color levels (similar to gamma)
+#define SHADERPERMUTATION_SPECULAR (1<<9) // (lightsource or deluxemapping) render specular effects
+#define SHADERPERMUTATION_CUBEFILTER (1<<10) // (lightsource) use cubemap light filter
+#define SHADERPERMUTATION_OFFSETMAPPING (1<<11) // adjust texcoords to roughly simulate a displacement mapped surface
+#define SHADERPERMUTATION_OFFSETMAPPING_RELIEFMAPPING (1<<12) // adjust texcoords to accurately simulate a displacement mapped surface (requires OFFSETMAPPING to also be set!)
 
-#define SHADERPERMUTATION_MAX (1<<12) // how many permutations are possible
+#define SHADERPERMUTATION_MAX (1<<13) // how many permutations are possible
 #define SHADERPERMUTATION_MASK (SHADERPERMUTATION_MAX - 1) // mask of valid indexing bits for r_glsl_permutations[] array
 
 // these are additional flags used only by R_GLSL_CompilePermutation
@@ -401,12 +410,13 @@ typedef struct r_glsl_permutation_s
        int loc_SpecularScale;
        int loc_SpecularPower;
        int loc_GlowScale;
-       int loc_SceneBrightness;
+       int loc_SceneBrightness; // or: Scenebrightness * ContrastBoost
        int loc_OffsetMapping_Scale;
        int loc_AmbientColor;
        int loc_DiffuseColor;
        int loc_SpecularColor;
        int loc_LightDir;
+       int loc_ContrastBoostCoeff; // 1 - 1/ContrastBoost
 }
 r_glsl_permutation_t;