Allow gl_texture to affect models. Aids in debugging lightmap contribution on models.
This commit is contained in:
parent
4c3848cfb2
commit
fb49a919cb
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
|
||||
|
|
@ -83,6 +91,14 @@ void FHWModelRenderer::BeginDrawHUDModel(FRenderStyle style, const VSMatrix &obj
|
|||
{
|
||||
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.
|
||||
// TO-DO: Implement proper depth sorting.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue