mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-17 01:31:25 +00:00
Allow gl_texture to affect models. Aids in debugging lightmap contribution on models.
This commit is contained in:
parent
da1b0530b9
commit
447f825831
1 changed files with 16 additions and 0 deletions
|
@ -45,6 +45,7 @@
|
|||
#include "hw_models.h"
|
||||
|
||||
CVAR(Bool, gl_light_models, true, CVAR_ARCHIVE)
|
||||
EXTERN_CVAR(Bool, gl_texture);
|
||||
|
||||
VSMatrix FHWModelRenderer::GetViewToWorldMatrix()
|
||||
{
|
||||
|
@ -57,6 +58,13 @@ void FHWModelRenderer::BeginDrawModel(FRenderStyle style, FSpriteModelFrame *smf
|
|||
{
|
||||
state.SetDepthFunc(DF_LEqual);
|
||||
state.EnableTexture(true);
|
||||
|
||||
if (!gl_texture)
|
||||
{
|
||||
state.SetTextureMode(TM_STENCIL);
|
||||
state.SetRenderStyle(STYLE_Stencil);
|
||||
}
|
||||
|
||||
// [BB] In case the model should be rendered translucent, do back face culling.
|
||||
// This solves a few of the problems caused by the lack of depth sorting.
|
||||
// [Nash] Don't do back face culling if explicitly specified in MODELDEF
|
||||
|
@ -84,6 +92,14 @@ void FHWModelRenderer::BeginDrawHUDModel(FRenderStyle style, const VSMatrix &obj
|
|||
state.SetDepthFunc(DF_LEqual);
|
||||
state.SetDepthClamp(true);
|
||||
|
||||
state.EnableTexture(true);
|
||||
|
||||
if (!gl_texture)
|
||||
{
|
||||
state.SetTextureMode(TM_STENCIL);
|
||||
state.SetRenderStyle(STYLE_Stencil);
|
||||
}
|
||||
|
||||
// [BB] In case the model should be rendered translucent, do back face culling.
|
||||
// This solves a few of the problems caused by the lack of depth sorting.
|
||||
// TO-DO: Implement proper depth sorting.
|
||||
|
|
Loading…
Reference in a new issue