Change gamma only for 3d rendered

This commit is contained in:
Denis Pauk 2020-02-10 22:35:49 +02:00 committed by Yamagi
parent 9bf3be03a7
commit 5707a70294
2 changed files with 11 additions and 28 deletions

View file

@ -1606,7 +1606,6 @@ Vk_InitImages
void Vk_InitImages (void)
{
int i, j;
float g;
float overbright;
registration_sequence = 1;
@ -1637,35 +1636,18 @@ void Vk_InitImages (void)
if(overbright > 4.0)
overbright = 4.0;
g = (2.1 - vid_gamma->value);
for (i=0 ; i<256 ; i++) {
int inf;
if (g == 1.0)
{
for (i=0 ; i<256 ; i++) {
int inf;
inf = i * overbright;
inf = i * overbright;
if (inf < 0)
inf = 0;
if (inf > 255)
inf = 255;
if (inf < 0)
inf = 0;
if (inf > 255)
inf = 255;
gammatable[i] = inf;
}
gammatable[i] = inf;
}
else
for (i=0 ; i<256 ; i++)
{
int inf;
inf = (255 * pow ( (i+0.5)/255.5 , g ) + 0.5) * overbright;
if (inf < 0)
inf = 0;
if (inf > 255)
inf = 255;
gammatable[i] = inf;
}
}
/*

View file

@ -1288,8 +1288,9 @@ RE_BeginFrame( float camera_separation )
** change modes if necessary
*/
if (r_mode->modified || vid_fullscreen->modified || vk_msaa->modified || r_clear->modified || vk_picmip->modified ||
vk_validation->modified || vk_texturemode->modified || vk_lmaptexturemode->modified || vk_aniso->modified || vid_gamma->modified ||
vk_mip_nearfilter->modified || vk_sampleshading->modified || r_vsync->modified || vk_device_idx->modified || vk_overbrightbits->modified)
vk_validation->modified || vk_texturemode->modified || vk_lmaptexturemode->modified || vk_aniso->modified ||
vk_mip_nearfilter->modified || vk_sampleshading->modified || r_vsync->modified || vk_device_idx->modified ||
vk_overbrightbits->modified)
{
if (vk_texturemode->modified || vk_lmaptexturemode->modified || vk_aniso->modified)
{