Reuse r_showtris in renders

This commit is contained in:
Denis Pauk 2023-10-02 17:21:42 +03:00
parent 67e892f186
commit c916e56d2d
13 changed files with 25 additions and 21 deletions

View file

@ -371,6 +371,8 @@ Set `0` by default.
* **r_shadows**: Enables rendering of shadows. Quake IIs shadows are
very simple and are prone to render errors.
* **r_showtris**: Show rendered triangles boarders.
* **vid_displayrefreshrate**: Sets the displays refresh rate. The
default `-1` let the game determine the refresh rate automatically.
Often the default setting is okay, but some graphics drivers report

View file

@ -114,7 +114,7 @@ cvar_t *r_modulate;
cvar_t *gl_nobind;
cvar_t *gl1_round_down;
cvar_t *gl1_picmip;
cvar_t *gl_showtris;
cvar_t *r_showtris;
cvar_t *gl_showbbox;
cvar_t *gl1_ztrick;
cvar_t *gl_zfix;
@ -1192,7 +1192,7 @@ R_Register(void)
gl_nobind = ri.Cvar_Get("gl_nobind", "0", 0);
gl1_round_down = ri.Cvar_Get("gl1_round_down", "1", 0);
gl1_picmip = ri.Cvar_Get("gl1_picmip", "0", 0);
gl_showtris = ri.Cvar_Get("gl_showtris", "0", 0);
r_showtris = ri.Cvar_Get("r_showtris", "0", 0);
gl_showbbox = ri.Cvar_Get("gl_showbbox", "0", 0);
gl1_ztrick = ri.Cvar_Get("gl1_ztrick", "0", 0);
gl_zfix = ri.Cvar_Get("gl_zfix", "0", 0);

View file

@ -108,7 +108,7 @@ R_DrawTriangleOutlines(void)
int i, j;
glpoly_t *p;
if (!gl_showtris->value)
if (!r_showtris->value)
{
return;
}

View file

@ -209,7 +209,7 @@ extern cvar_t *gl1_dynamic;
extern cvar_t *gl_nobind;
extern cvar_t *gl1_round_down;
extern cvar_t *gl1_picmip;
extern cvar_t *gl_showtris;
extern cvar_t *r_showtris;
extern cvar_t *gl_showbbox;
extern cvar_t *gl_finish;
extern cvar_t *gl1_ztrick;

View file

@ -296,7 +296,7 @@ GL3_Register(void)
//gl_lightmap = ri.Cvar_Get("r_lightmap", "0", 0);
//gl_shadows = ri.Cvar_Get("r_shadows", "0", CVAR_ARCHIVE);
//gl_nobind = ri.Cvar_Get("gl_nobind", "0", 0);
gl_showtris = ri.Cvar_Get("gl_showtris", "0", 0);
r_showtris = ri.Cvar_Get("r_showtris", "0", 0);
gl_showbbox = Cvar_Get("gl_showbbox", "0", 0);
//gl1_ztrick = ri.Cvar_Get("gl1_ztrick", "0", 0); NOTE: dump this.
//gl_zfix = ri.Cvar_Get("gl_zfix", "0", 0);

View file

@ -205,12 +205,12 @@ GL3_DrawGLFlowingPoly(msurface_t *fa)
static void
DrawTriangleOutlines(void)
{
STUB_ONCE("TODO: Implement for gl_showtris support!");
STUB_ONCE("TODO: Implement for r_showtris support!");
#if 0
int i, j;
glpoly_t *p;
if (!gl_showtris->value)
if (!r_showtris->value)
{
return;
}

View file

@ -296,7 +296,7 @@ GL4_Register(void)
//gl_lightmap = ri.Cvar_Get("r_lightmap", "0", 0);
//gl_shadows = ri.Cvar_Get("r_shadows", "0", CVAR_ARCHIVE);
//gl_nobind = ri.Cvar_Get("gl_nobind", "0", 0);
gl_showtris = ri.Cvar_Get("gl_showtris", "0", 0);
r_showtris = ri.Cvar_Get("r_showtris", "0", 0);
gl_showbbox = Cvar_Get("gl_showbbox", "0", 0);
//gl1_ztrick = ri.Cvar_Get("gl1_ztrick", "0", 0); NOTE: dump this.
//gl_zfix = ri.Cvar_Get("gl_zfix", "0", 0);

View file

@ -205,12 +205,12 @@ GL4_DrawGLFlowingPoly(msurface_t *fa)
static void
DrawTriangleOutlines(void)
{
STUB_ONCE("TODO: Implement for gl_showtris support!");
STUB_ONCE("TODO: Implement for r_showtris support!");
#if 0
int i, j;
glpoly_t *p;
if (!gl_showtris->value)
if (!r_showtris->value)
{
return;
}

View file

@ -142,7 +142,7 @@ extern cvar_t *vk_finish;
extern cvar_t *vk_shadows;
extern cvar_t *vk_dynamic;
extern cvar_t *vk_msaa;
extern cvar_t *vk_showtris;
extern cvar_t *r_showtris;
extern cvar_t *r_lightmap;
extern cvar_t *vk_texturemode;
extern cvar_t *vk_lmaptexturemode;

View file

@ -1460,7 +1460,7 @@ static void CreatePipelines()
QVk_DebugSetObjectName((uint64_t)vk_drawDLightPipeline.layout, VK_OBJECT_TYPE_PIPELINE_LAYOUT, "Pipeline Layout: dynamic light");
QVk_DebugSetObjectName((uint64_t)vk_drawDLightPipeline.pl, VK_OBJECT_TYPE_PIPELINE, "Pipeline: dynamic light");
// vk_showtris render pipeline
/* r_showtris render pipeline */
VK_LOAD_VERTFRAG_SHADERS(shaders, d_light, basic_color_quad);
vk_showTrisPipeline.cullMode = VK_CULL_MODE_NONE;
vk_showTrisPipeline.depthTestEnable = VK_FALSE;
@ -1470,7 +1470,7 @@ static void CreatePipelines()
QVk_DebugSetObjectName((uint64_t)vk_showTrisPipeline.layout, VK_OBJECT_TYPE_PIPELINE_LAYOUT, "Pipeline Layout: show triangles");
QVk_DebugSetObjectName((uint64_t)vk_showTrisPipeline.pl, VK_OBJECT_TYPE_PIPELINE, "Pipeline: show triangles");
//vk_shadows render pipeline
/* vk_shadows render pipeline */
VK_LOAD_VERTFRAG_SHADERS(shaders, shadows, basic_color_quad);
vk_shadowsPipelineFan.blendOpts.blendEnable = VK_TRUE;
vk_shadowsPipelineFan.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
@ -1478,7 +1478,7 @@ static void CreatePipelines()
QVk_DebugSetObjectName((uint64_t)vk_shadowsPipelineFan.layout, VK_OBJECT_TYPE_PIPELINE_LAYOUT, "Pipeline Layout: draw shadows: fan");
QVk_DebugSetObjectName((uint64_t)vk_shadowsPipelineFan.pl, VK_OBJECT_TYPE_PIPELINE, "Pipeline: draw shadows: fan");
// underwater world warp pipeline (postprocess)
/* underwater world warp pipeline (postprocess) */
VK_LOAD_VERTFRAG_SHADERS(shaders, world_warp, world_warp);
vk_worldWarpPipeline.depthTestEnable = VK_FALSE;
vk_worldWarpPipeline.depthWriteEnable = VK_FALSE;
@ -1487,7 +1487,7 @@ static void CreatePipelines()
QVk_DebugSetObjectName((uint64_t)vk_worldWarpPipeline.layout, VK_OBJECT_TYPE_PIPELINE_LAYOUT, "Pipeline Layout: underwater view warp");
QVk_DebugSetObjectName((uint64_t)vk_worldWarpPipeline.pl, VK_OBJECT_TYPE_PIPELINE, "Pipeline: underwater view warp");
// postprocessing pipeline
/* postprocessing pipeline */
VK_LOAD_VERTFRAG_SHADERS(shaders, postprocess, postprocess);
vk_postprocessPipeline.depthTestEnable = VK_FALSE;
vk_postprocessPipeline.depthWriteEnable = VK_FALSE;

View file

@ -118,7 +118,7 @@ static cvar_t *vk_custom_particles;
cvar_t *vk_postprocess;
cvar_t *vk_dynamic;
cvar_t *vk_msaa;
cvar_t *vk_showtris;
cvar_t *r_showtris;
cvar_t *r_lightmap;
cvar_t *vk_texturemode;
cvar_t *vk_lmaptexturemode;
@ -1157,7 +1157,7 @@ R_Register( void )
vk_postprocess = ri.Cvar_Get("vk_postprocess", "1", CVAR_ARCHIVE);
vk_dynamic = ri.Cvar_Get("vk_dynamic", "1", 0);
vk_msaa = ri.Cvar_Get("r_msaa_samples", "0", CVAR_ARCHIVE);
vk_showtris = ri.Cvar_Get("vk_showtris", "0", 0);
r_showtris = ri.Cvar_Get("r_showtris", "0", 0);
r_lightmap = ri.Cvar_Get("r_lightmap", "0", 0);
vk_texturemode = ri.Cvar_Get("vk_texturemode", "VK_MIPMAP_LINEAR", CVAR_ARCHIVE);
vk_lmaptexturemode = ri.Cvar_Get("vk_lmaptexturemode", "VK_MIPMAP_LINEAR", CVAR_ARCHIVE);

View file

@ -187,7 +187,7 @@ static void R_DrawTriangleOutlines (void)
int i, j, k;
vkpoly_t *p;
if (!vk_showtris->value)
if (!r_showtris->value)
return;
VkBuffer vbo;
@ -702,7 +702,7 @@ static void R_DrawInlineBModel (entity_t *currententity, model_t *currentmodel,
psurf->texturechain = r_alpha_surfaces;
r_alpha_surfaces = psurf;
}
else if (!(psurf->flags & SURF_DRAWTURB) && !vk_showtris->value)
else if (!(psurf->flags & SURF_DRAWTURB) && !r_showtris->value)
{
Vk_RenderLightmappedPoly(psurf, modelMatrix, alpha, currententity);
}
@ -888,7 +888,7 @@ static void R_RecursiveWorldNode (mnode_t *node, entity_t *currententity)
}
else
{
if (!(surf->flags & SURF_DRAWTURB) && !vk_showtris->value)
if (!(surf->flags & SURF_DRAWTURB) && !r_showtris->value)
{
Vk_RenderLightmappedPoly(surf, NULL, 1.f, currententity);
}

View file

@ -91,7 +91,9 @@ replacement_t replacements[] = {
{"gl_lightmap", "r_lightmap"},
{"gl1_polyblend", "gl_polyblend"},
{"gl_cull", "r_cull"},
{"intensity", "gl1_intensity"}
{"intensity", "gl1_intensity"},
{"gl_showtris", "r_showtris"},
{"vk_showtris", "r_showtris"}
};