]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
cmd: Re-re-re-implement the cbuf. This time using the new generic linked list.
[xonotic/darkplaces.git] / gl_rmain.c
index 9773bdd3c46b0ab80b3171291c78ddf90f2a5f38..6a69bdd656eae5b5c9497aaa1ea4a4873a5b242e 100644 (file)
@@ -211,11 +211,11 @@ cvar_t r_waterscroll = {CVAR_CLIENT | CVAR_SAVE, "r_waterscroll", "1", "makes wa
 cvar_t r_bloom = {CVAR_CLIENT | CVAR_SAVE, "r_bloom", "0", "enables bloom effect (makes bright pixels affect neighboring pixels)"};
 cvar_t r_bloom_colorscale = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_colorscale", "1", "how bright the glow is"};
 
-cvar_t r_bloom_brighten = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_brighten", "2", "how bright the glow is, after subtract/power"};
+cvar_t r_bloom_brighten = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_brighten", "1", "how bright the glow is, after subtract/power"};
 cvar_t r_bloom_blur = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_blur", "4", "how large the glow is"};
 cvar_t r_bloom_resolution = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_resolution", "320", "what resolution to perform the bloom effect at (independent of screen resolution)"};
 cvar_t r_bloom_colorexponent = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_colorexponent", "1", "how exaggerated the glow is"};
-cvar_t r_bloom_colorsubtract = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_colorsubtract", "0.125", "reduces bloom colors by a certain amount"};
+cvar_t r_bloom_colorsubtract = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_colorsubtract", "0.1", "reduces bloom colors by a certain amount"};
 cvar_t r_bloom_scenebrightness = {CVAR_CLIENT | CVAR_SAVE, "r_bloom_scenebrightness", "1", "global rendering brightness when bloom is enabled"};
 
 cvar_t r_hdr_scenebrightness = {CVAR_CLIENT | CVAR_SAVE, "r_hdr_scenebrightness", "1", "global rendering brightness"};
@@ -393,30 +393,7 @@ static void R_BuildBlankTextures(void)
 
 static void R_BuildNoTexture(void)
 {
-       int x, y;
-       unsigned char pix[16][16][4];
-       // this makes a light grey/dark grey checkerboard texture
-       for (y = 0;y < 16;y++)
-       {
-               for (x = 0;x < 16;x++)
-               {
-                       if ((y < 8) ^ (x < 8))
-                       {
-                               pix[y][x][0] = 128;
-                               pix[y][x][1] = 128;
-                               pix[y][x][2] = 128;
-                               pix[y][x][3] = 255;
-                       }
-                       else
-                       {
-                               pix[y][x][0] = 64;
-                               pix[y][x][1] = 64;
-                               pix[y][x][2] = 64;
-                               pix[y][x][3] = 255;
-                       }
-               }
-       }
-       r_texture_notexture = R_LoadTexture2D(r_main_texturepool, "notexture", 16, 16, &pix[0][0][0], TEXTYPE_BGRA, TEXF_MIPMAP | TEXF_PERSISTENT, -1, NULL);
+       r_texture_notexture = R_LoadTexture2D(r_main_texturepool, "notexture", 16, 16, Image_GenerateNoTexture(), TEXTYPE_BGRA, TEXF_MIPMAP | TEXF_PERSISTENT, -1, NULL);
 }
 
 static void R_BuildWhiteCube(void)
@@ -2847,38 +2824,10 @@ skinframe_t *R_SkinFrame_LoadMissing(void)
 
 skinframe_t *R_SkinFrame_LoadNoTexture(void)
 {
-       int x, y;
-       static unsigned char pix[16][16][4];
-
        if (cls.state == ca_dedicated)
                return NULL;
 
-       // this makes a light grey/dark grey checkerboard texture
-       if (!pix[0][0][3])
-       {
-               for (y = 0; y < 16; y++)
-               {
-                       for (x = 0; x < 16; x++)
-                       {
-                               if ((y < 8) ^ (x < 8))
-                               {
-                                       pix[y][x][0] = 128;
-                                       pix[y][x][1] = 128;
-                                       pix[y][x][2] = 128;
-                                       pix[y][x][3] = 255;
-                               }
-                               else
-                               {
-                                       pix[y][x][0] = 64;
-                                       pix[y][x][1] = 64;
-                                       pix[y][x][2] = 64;
-                                       pix[y][x][3] = 255;
-                               }
-                       }
-               }
-       }
-
-       return R_SkinFrame_LoadInternalBGRA("notexture", TEXF_FORCENEAREST, pix[0][0], 16, 16, 0, 0, 0, false);
+       return R_SkinFrame_LoadInternalBGRA("notexture", TEXF_FORCENEAREST, Image_GenerateNoTexture(), 16, 16, 0, 0, 0, false);
 }
 
 skinframe_t *R_SkinFrame_LoadInternalUsingTexture(const char *name, int textureflags, rtexture_t *tex, int width, int height, qboolean sRGB)
@@ -3148,7 +3097,9 @@ static void gl_main_start(void)
        R_BuildBlankTextures();
        R_BuildNoTexture();
        R_BuildWhiteCube();
+#ifndef USE_GLES2
        R_BuildNormalizationCube();
+#endif //USE_GLES2
        r_texture_fogattenuation = NULL;
        r_texture_fogheighttexture = NULL;
        r_texture_gammaramps = NULL;
@@ -10137,7 +10088,8 @@ void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean wr
                int updated = 0;
                for (j = model->firstmodelsurface, endj = model->firstmodelsurface + model->nummodelsurfaces;j < endj;j++)
                {
-                       if (update[j])
+                       // Update brush entities even if not visible otherwise they'll render solid black.
+                       if (update[j] && (r_refdef.viewcache.world_surfacevisible[j] || ent != r_refdef.scene.worldentity))
                        {
                                updated++;
                                R_BuildLightMap(ent, surfaces + j);