]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - render.h
another attempt at fixing bugs with downloads caused by the workaround
[xonotic/darkplaces.git] / render.h
index 2a56bf6a6ab44a331a4402f106331c58b5cdfe13..b933881d65f9176d73cb27bd7d089ce3c24b11bf 100644 (file)
--- a/render.h
+++ b/render.h
@@ -214,6 +214,7 @@ typedef struct rsurfacestate_s
        float *array_deformedsvector3f;
        float *array_deformedtvector3f;
        float *array_deformednormal3f;
+       float *array_generatedtexcoordtexture2f;
        float *array_color4f;
        float *array_texcoord3f;
 
@@ -255,7 +256,6 @@ typedef struct rsurfacestate_s
        size_t modeltexcoordlightmap2f_bufferoffset;
        int *modelelement3i;
        int modelelement3i_bufferobject;
-       int *modelneighbor3i;
        int *modellightmapoffsets;
        int modelnum_vertices;
        int modelnum_triangles;
@@ -285,6 +285,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;
@@ -360,12 +366,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
@@ -402,12 +409,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;