// used for dlight push checking and other things
int r_framecount;
-// used for visibility checking
-qbyte r_pvsbits[(MAX_MAP_LEAFS+7)>>3];
-
mplane_t frustum[4];
matrix4x4_t r_identitymatrix;
cvar_t r_bloom = {CVAR_SAVE, "r_bloom", "0"};
cvar_t r_bloom_intensity = {CVAR_SAVE, "r_bloom_intensity", "2"};
cvar_t r_bloom_blur = {CVAR_SAVE, "r_bloom_blur", "8"};
-cvar_t r_bloom_resolution = {CVAR_SAVE, "r_bloom_resolution", "256"};
+cvar_t r_bloom_resolution = {CVAR_SAVE, "r_bloom_resolution", "320"};
cvar_t r_bloom_power = {CVAR_SAVE, "r_bloom_power", "4"};
rtexturepool_t *r_main_texturepool;
rtexture_t *r_bloom_texture_screen;
void gl_main_shutdown(void)
{
- // this seems to cause a already freed crash after a couple vid_restarts...
- //R_FreeTexturePool(&r_main_texturepool);
- r_main_texturepool = NULL;
+ R_FreeTexturePool(&r_main_texturepool);
r_bloom_texture_screen = NULL;
r_bloom_texture_bloom = NULL;
}
R_FarClip_Box(r_refdef.worldmodel->normalmins, r_refdef.worldmodel->normalmaxs);
for (i = 0;i < r_refdef.numentities;i++)
R_FarClip_Box(r_refdef.entities[i]->mins, r_refdef.entities[i]->maxs);
-
+
return r_farclip_meshfarclip - r_farclip_directiondist;
}
for (screenwidth = 1;screenwidth < vid.realwidth;screenwidth *= 2);
for (screenheight = 1;screenheight < vid.realheight;screenheight *= 2);
bloomwidth = min(r_view_width, r_bloom_resolution.integer);
- bloomheight = min(r_view_height, r_bloom_resolution.integer);
+ bloomheight = min(r_view_height, bloomwidth * r_view_height / r_view_width);
varray_texcoord2f[0][0] = 0;
varray_texcoord2f[0][1] = (float)r_view_height / (float)screenheight;
varray_texcoord2f[0][2] = (float)r_view_width / (float)screenwidth;
c_bloomcopypixels += bloomwidth * bloomheight;
// blend on at multiple offsets vertically
// TODO: do offset blends using GLSL
- range = r_bloom_blur.integer;//(int)(r_bloom_blur.value * bloomwidth / 320);
+ range = r_bloom_blur.integer * bloomwidth / 320;
GL_BlendFunc(GL_ONE, GL_ZERO);
for (x = -range;x <= range;x++)
{
c_bloomcopypixels += bloomwidth * bloomheight;
// blend on at multiple offsets horizontally
// TODO: do offset blends using GLSL
- range = r_bloom_blur.integer * bloomheight / r_view_height;//(int)(r_bloom_blur.value * bloomwidth / 320);
+ range = r_bloom_blur.integer * bloomwidth / 320;
GL_BlendFunc(GL_ONE, GL_ZERO);
for (x = -range;x <= range;x++)
{
GL_ColorMask(r_refdef.colormask[0], r_refdef.colormask[1], r_refdef.colormask[2], 1);
r_rtworld = r_shadow_realtime_world.integer;
r_rtworldshadows = r_shadow_realtime_world_shadows.integer && gl_stencil;
- r_rtdlight = r_shadow_realtime_world.integer || r_shadow_realtime_dlight.integer;
+ r_rtdlight = (r_shadow_realtime_world.integer || r_shadow_realtime_dlight.integer) && !gl_flashblend.integer;
r_rtdlightshadows = r_rtdlight && (r_rtworld ? r_shadow_realtime_world_dlightshadows.integer : r_shadow_realtime_dlight_shadows.integer) && gl_stencil;
r_lightmapintensity = r_rtworld ? r_shadow_realtime_world_lightmaps.value : 1;
R_BlendView();
R_TimeReport("blendview");
-
+
GL_Scissor(0, 0, vid.realwidth, vid.realheight);
GL_ScissorTest(false);
}
R_SkyStartFrame();
- if (r_refdef.worldmodel && r_refdef.worldmodel->brush.FatPVS)
- r_refdef.worldmodel->brush.FatPVS(r_refdef.worldmodel, r_vieworigin, 2, r_pvsbits, sizeof(r_pvsbits));
R_WorldVisibility();
R_TimeReport("worldvis");
vec3_t right1, right2, diff, normal;
VectorSubtract (org2, org1, normal);
- VectorNormalizeFast (normal);
// calculate 'right' vector for start
VectorSubtract (r_vieworigin, org1, diff);
- VectorNormalizeFast (diff);
CrossProduct (normal, diff, right1);
+ VectorNormalize (right1);
// calculate 'right' vector for end
VectorSubtract (r_vieworigin, org2, diff);
- VectorNormalizeFast (diff);
CrossProduct (normal, diff, right2);
+ VectorNormalize (right2);
vert[ 0] = org1[0] + width * right1[0];
vert[ 1] = org1[1] + width * right1[1];