diff --git a/src/swrenderer/line/r_walldraw.cpp b/src/swrenderer/line/r_walldraw.cpp index a1972417a..5b7518440 100644 --- a/src/swrenderer/line/r_walldraw.cpp +++ b/src/swrenderer/line/r_walldraw.cpp @@ -262,7 +262,8 @@ namespace swrenderer drawerargs.SetTextureVStep(sampler.uv_step); drawerargs.SetTextureVPos(sampler.uv_pos); drawerargs.DrawColumn(Thread); - drawerargs.DrawDepthColumn(Thread, zbufferdepth); + if (r_models) + drawerargs.DrawDepthColumn(Thread, zbufferdepth); uint64_t step64 = sampler.uv_step; uint64_t pos64 = sampler.uv_pos; @@ -281,7 +282,8 @@ namespace swrenderer drawerargs.SetTextureVStep(sampler.uv_step); drawerargs.SetTextureVPos(sampler.uv_pos); drawerargs.DrawColumn(Thread); - drawerargs.DrawDepthColumn(Thread, zbufferdepth); + if (r_models) + drawerargs.DrawDepthColumn(Thread, zbufferdepth); uint64_t step64 = sampler.uv_step; uint64_t pos64 = sampler.uv_pos; @@ -308,7 +310,8 @@ namespace swrenderer drawerargs.SetTextureVStep(sampler.uv_step); drawerargs.SetTextureVPos(uv_pos); drawerargs.DrawColumn(Thread); - drawerargs.DrawDepthColumn(Thread, zbufferdepth); + if (r_models) + drawerargs.DrawDepthColumn(Thread, zbufferdepth); y += count; left -= count; diff --git a/src/swrenderer/plane/r_flatplane.cpp b/src/swrenderer/plane/r_flatplane.cpp index 6161d0619..82e27f89f 100644 --- a/src/swrenderer/plane/r_flatplane.cpp +++ b/src/swrenderer/plane/r_flatplane.cpp @@ -275,7 +275,8 @@ namespace swrenderer drawerargs.SetDestX2(x2); drawerargs.DrawSpan(Thread); - drawerargs.DrawDepthSpan(Thread, zbufferdepth); + if (r_models) + drawerargs.DrawDepthSpan(Thread, zbufferdepth); } ///////////////////////////////////////////////////////////////////////// diff --git a/src/swrenderer/plane/r_skyplane.cpp b/src/swrenderer/plane/r_skyplane.cpp index eeb72ebe2..ef7a6b898 100644 --- a/src/swrenderer/plane/r_skyplane.cpp +++ b/src/swrenderer/plane/r_skyplane.cpp @@ -225,7 +225,8 @@ namespace swrenderer else drawerargs.DrawDoubleSkyColumn(Thread); - drawerargs.DrawDepthSkyColumn(Thread, 1.0f / 65536.0f); + if (r_models) + drawerargs.DrawDepthSkyColumn(Thread, 1.0f / 65536.0f); } void RenderSkyPlane::DrawSkyColumn(int start_x, int y1, int y2) diff --git a/src/swrenderer/r_renderthread.h b/src/swrenderer/r_renderthread.h index 6bc23bba5..3e559155b 100644 --- a/src/swrenderer/r_renderthread.h +++ b/src/swrenderer/r_renderthread.h @@ -29,6 +29,8 @@ class DrawerCommandQueue; typedef std::shared_ptr DrawerCommandQueuePtr; class RenderMemory; +EXTERN_CVAR(Bool, r_models); + namespace swrenderer { class VisibleSpriteList; diff --git a/src/swrenderer/scene/r_opaque_pass.cpp b/src/swrenderer/scene/r_opaque_pass.cpp index 989110e59..f18cdc2ec 100644 --- a/src/swrenderer/scene/r_opaque_pass.cpp +++ b/src/swrenderer/scene/r_opaque_pass.cpp @@ -963,6 +963,10 @@ namespace swrenderer { RenderVoxel::Project(Thread, thing, sprite.pos, sprite.voxel, sprite.spriteScale, sprite.renderflags, fakeside, fakefloor, fakeceiling, sec, thingShade, foggy, thingColormap); } + else if (!r_models) + { + RenderSprite::Project(Thread, thing, sprite.pos, sprite.tex, sprite.spriteScale, sprite.renderflags, fakeside, fakefloor, fakeceiling, sec, thingShade, foggy, thingColormap); + } else { int spritenum = thing->sprite; diff --git a/src/swrenderer/scene/r_scene.cpp b/src/swrenderer/scene/r_scene.cpp index 6cccef52e..8c0b81cef 100644 --- a/src/swrenderer/scene/r_scene.cpp +++ b/src/swrenderer/scene/r_scene.cpp @@ -67,6 +67,7 @@ EXTERN_CVAR(Bool, r_shadercolormaps) EXTERN_CVAR(Int, r_clearbuffer) CVAR(Bool, r_scene_multithreaded, false, 0); +CVAR(Bool, r_models, false, 0); namespace swrenderer { @@ -156,7 +157,8 @@ namespace swrenderer R_UpdateFuzzPosFrameStart(); - MainThread()->Viewport->SetupPolyViewport(); + if (r_models) + MainThread()->Viewport->SetupPolyViewport(); ActorRenderFlags savedflags = MainThread()->Viewport->viewpoint.camera->renderflags; // Never draw the player unless in chasecam mode diff --git a/src/swrenderer/things/r_playersprite.cpp b/src/swrenderer/things/r_playersprite.cpp index 02f17bde6..41ec47239 100644 --- a/src/swrenderer/things/r_playersprite.cpp +++ b/src/swrenderer/things/r_playersprite.cpp @@ -88,14 +88,15 @@ namespace swrenderer int floorlight, ceilinglight; F3DFloor *rover; - renderHUDModel = gl_IsHUDModelForPlayerAvailable(players[consoleplayer].camera->player); - if (!r_drawplayersprites || !Thread->Viewport->viewpoint.camera || !Thread->Viewport->viewpoint.camera->player || (players[consoleplayer].cheats & CF_CHASECAM) || (r_deathcamera && Thread->Viewport->viewpoint.camera->health <= 0)) return; + + if (r_models && gl_IsHUDModelForPlayerAvailable(players[consoleplayer].camera->player)) + renderHUDModel = true; FDynamicColormap *basecolormap; CameraLight *cameraLight = CameraLight::Instance();