Remove vk_round_down as regressed visual quality

This commit is contained in:
Denis Pauk 2020-11-29 23:49:25 +02:00 committed by Yamagi
parent 0d57f47b9b
commit 8e5f68bb68
4 changed files with 12 additions and 34 deletions

View file

@ -393,8 +393,6 @@ it's `+set busywait 0` (setting the `busywait` cvar) and `-portable`
* **vk_picmip**: Shrink factor for the textures. (default: `0`) * **vk_picmip**: Shrink factor for the textures. (default: `0`)
* **vk_round_down**: Toggle the rounding of texture sizes. (default: `1`)
* **vk_dynamic**: Use dynamic lighting. (default: `1`) * **vk_dynamic**: Use dynamic lighting. (default: `1`)
* **vk_showtris**: Display mesh triangles. (default: `0`) * **vk_showtris**: Display mesh triangles. (default: `0`)

View file

@ -141,7 +141,6 @@ extern cvar_t *vk_validation;
extern cvar_t *vk_bitdepth; extern cvar_t *vk_bitdepth;
extern cvar_t *vk_picmip; extern cvar_t *vk_picmip;
extern cvar_t *vk_skymip; extern cvar_t *vk_skymip;
extern cvar_t *vk_round_down;
extern cvar_t *vk_flashblend; extern cvar_t *vk_flashblend;
extern cvar_t *vk_finish; extern cvar_t *vk_finish;
extern cvar_t *vk_polyblend; extern cvar_t *vk_polyblend;

View file

@ -800,22 +800,17 @@ static uint32_t Vk_Upload32 (byte *data, int width, int height, imagetype_t type
byte **texBuffer, int *upload_width, int *upload_height) byte **texBuffer, int *upload_width, int *upload_height)
{ {
int scaled_width, scaled_height; int scaled_width, scaled_height;
qboolean mipmap = (type != it_pic && type != it_sky); int miplevel = 1;
*texBuffer = NULL; *texBuffer = NULL;
for (scaled_width = 1; scaled_width < width; scaled_width <<= 1) for (scaled_width = 1; scaled_width < width; scaled_width <<= 1)
; ;
if (vk_round_down->value && scaled_width > width && mipmap)
scaled_width >>= 1;
for (scaled_height = 1; scaled_height < height; scaled_height <<= 1) for (scaled_height = 1; scaled_height < height; scaled_height <<= 1)
; ;
if (vk_round_down->value && scaled_height > height && mipmap) if (type != it_pic)
scaled_height >>= 1;
// let people sample down the world textures for speed
if (mipmap)
{ {
// let people sample down the world textures for speed
scaled_width >>= (int)vk_picmip->value; scaled_width >>= (int)vk_picmip->value;
scaled_height >>= (int)vk_picmip->value; scaled_height >>= (int)vk_picmip->value;
} }
@ -835,11 +830,6 @@ static uint32_t Vk_Upload32 (byte *data, int width, int height, imagetype_t type
if (scaled_width == width && scaled_height == height) if (scaled_width == width && scaled_height == height)
{ {
memcpy(*texBuffer, data, scaled_width * scaled_height * 4); memcpy(*texBuffer, data, scaled_width * scaled_height * 4);
// scale is not required and no mipmap
if (!mipmap)
{
return 1;
}
} }
else else
{ {
@ -853,25 +843,18 @@ static uint32_t Vk_Upload32 (byte *data, int width, int height, imagetype_t type
Vk_LightScaleTexture(*texBuffer, scaled_width, scaled_height); Vk_LightScaleTexture(*texBuffer, scaled_width, scaled_height);
} }
if (mipmap) while (scaled_width > 1 || scaled_height > 1)
{ {
int miplevel = 1; scaled_width >>= 1;
scaled_height >>= 1;
while (scaled_width > 1 || scaled_height > 1) if (scaled_width < 1)
{ scaled_width = 1;
scaled_width >>= 1; if (scaled_height < 1)
scaled_height >>= 1; scaled_height = 1;
if (scaled_width < 1) miplevel++;
scaled_width = 1;
if (scaled_height < 1)
scaled_height = 1;
miplevel++;
}
return miplevel;
} }
return 1; return miplevel;
} }
/* /*

View file

@ -97,7 +97,6 @@ cvar_t *vk_validation;
cvar_t *vk_bitdepth; cvar_t *vk_bitdepth;
cvar_t *vk_picmip; cvar_t *vk_picmip;
cvar_t *vk_skymip; cvar_t *vk_skymip;
cvar_t *vk_round_down;
cvar_t *vk_flashblend; cvar_t *vk_flashblend;
cvar_t *vk_finish; cvar_t *vk_finish;
cvar_t *r_clear; cvar_t *r_clear;
@ -1152,7 +1151,6 @@ R_Register( void )
vk_bitdepth = ri.Cvar_Get("vk_bitdepth", "0", 0); vk_bitdepth = ri.Cvar_Get("vk_bitdepth", "0", 0);
vk_picmip = ri.Cvar_Get("vk_picmip", "0", 0); vk_picmip = ri.Cvar_Get("vk_picmip", "0", 0);
vk_skymip = ri.Cvar_Get("vk_skymip", "0", 0); vk_skymip = ri.Cvar_Get("vk_skymip", "0", 0);
vk_round_down = ri.Cvar_Get("vk_round_down", "1", 0);
vk_flashblend = ri.Cvar_Get("vk_flashblend", "0", 0); vk_flashblend = ri.Cvar_Get("vk_flashblend", "0", 0);
vk_finish = ri.Cvar_Get("vk_finish", "0", CVAR_ARCHIVE); vk_finish = ri.Cvar_Get("vk_finish", "0", CVAR_ARCHIVE);
r_clear = ri.Cvar_Get("r_clear", "0", CVAR_ARCHIVE); r_clear = ri.Cvar_Get("r_clear", "0", CVAR_ARCHIVE);