- Disable model rendering in the software renderer

This commit is contained in:
Magnus Norddahl 2017-11-29 22:18:21 +01:00
parent 6c4f6f94f4
commit a8b79a28c8
7 changed files with 22 additions and 8 deletions

View file

@ -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;

View file

@ -275,7 +275,8 @@ namespace swrenderer
drawerargs.SetDestX2(x2);
drawerargs.DrawSpan(Thread);
drawerargs.DrawDepthSpan(Thread, zbufferdepth);
if (r_models)
drawerargs.DrawDepthSpan(Thread, zbufferdepth);
}
/////////////////////////////////////////////////////////////////////////

View file

@ -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)

View file

@ -29,6 +29,8 @@ class DrawerCommandQueue;
typedef std::shared_ptr<DrawerCommandQueue> DrawerCommandQueuePtr;
class RenderMemory;
EXTERN_CVAR(Bool, r_models);
namespace swrenderer
{
class VisibleSpriteList;

View file

@ -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;

View file

@ -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

View file

@ -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();