mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-30 15:41:47 +00:00
Added DONTCULLBACKFACES MODELDEF flag to forcefully disable backface culling on models
This commit is contained in:
parent
845f5e0833
commit
a4d146c843
2 changed files with 7 additions and 1 deletions
|
@ -787,6 +787,10 @@ void gl_InitModels()
|
||||||
map[c]=1;
|
map[c]=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("dontcullbackfaces"))
|
||||||
|
{
|
||||||
|
smf.flags |= MDL_DONTCULLBACKFACES;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sc.ScriptMessage("Unrecognized string \"%s\"", sc.String);
|
sc.ScriptMessage("Unrecognized string \"%s\"", sc.String);
|
||||||
|
@ -949,8 +953,9 @@ void gl_RenderModel(GLSprite * spr)
|
||||||
gl_RenderState.EnableTexture(true);
|
gl_RenderState.EnableTexture(true);
|
||||||
// [BB] In case the model should be rendered translucent, do back face culling.
|
// [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.
|
// 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
|
||||||
// TO-DO: Implement proper depth sorting.
|
// TO-DO: Implement proper depth sorting.
|
||||||
if (!( spr->actor->RenderStyle == LegacyRenderStyles[STYLE_Normal] ))
|
if (!(spr->actor->RenderStyle == LegacyRenderStyles[STYLE_Normal]) && !(smf->flags & MDL_DONTCULLBACKFACES))
|
||||||
{
|
{
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
glFrontFace(GL_CW);
|
glFrontFace(GL_CW);
|
||||||
|
|
|
@ -370,6 +370,7 @@ enum
|
||||||
MDL_USEACTORPITCH = 32,
|
MDL_USEACTORPITCH = 32,
|
||||||
MDL_USEACTORROLL = 64,
|
MDL_USEACTORROLL = 64,
|
||||||
MDL_BADROTATION = 128,
|
MDL_BADROTATION = 128,
|
||||||
|
MDL_DONTCULLBACKFACES = 256,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FSpriteModelFrame
|
struct FSpriteModelFrame
|
||||||
|
|
Loading…
Reference in a new issue