New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cgame: introduce cg_lowModels to load low quality models #2989
base: for-0.55.0/sync
Are you sure you want to change the base?
Conversation
We can probably generate them from the original models. |
The effort of doing low poly models is probably not worth it anyway, the gain would not be worth the effort. |
I agree. |
cabe219
to
c7457d5
Compare
c7457d5
to
cc4197d
Compare
@@ -526,21 +526,21 @@ static bool CG_ParseBuildableSoundFile( const char *filename, buildable_t builda | |||
return true; | |||
} | |||
|
|||
static bool CG_RegisterBuildableAnimation( buildableInfo_t *ci, const char *modelName, int anim, const char *animName, | |||
static bool CG_RegisterBuildableAnimation( buildableInfo_t *ci, const char *modelName, const char* foundSuffix, int anim, const char *animName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about a single argument with the contents of fileBase
from the other function, instead of modelName+foundSuffix?
@@ -182,6 +182,8 @@ Cvar::Cvar<std::string> cg_sayCommand("cg_sayCommand", "instead of talking, chat | |||
// TODO: only works for player models. Buildings and weapons are also relevant | |||
Cvar::Cvar<bool> cg_lazyLoadModels("cg_lazyLoadModels", "load models only when needed", Cvar::CHEAT, false); | |||
|
|||
Cvar::Cvar<bool> cg_lowModels("cg_lowModels", "load low quality models when available", Cvar::NONE, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cg_lowQualityModels
?
How are you generating these models? |
Add
cg_lowModels
to load low quality models.The purpose of this cvar is to be used in
low
andlowest
presets.If
cg_lowModels
is enabled, when looking forbuildables/eggpod/eggpod.iqm
, loadbuildables/eggpod/eggpod_low.iqm
if it exists.It is only implemented for buildables for now, I may implement it for player models later.
The purpose is to load a low quality variant of a model for performance purpose.
This may be a low poly model, but I doubt we have the resource to produce some.
What we can do though, is to edit existing IQM models with IQE Browser and delete some bones.
Some low-end old graphics card can only hardware accelerate the model animations if the models have no more than 41 bones.
Some of our models have many more than that, sometime more than an hundreds of that, forcing the game to fallback on a slow CPU implementation.
But many of our models have some bones we can remove, like legs of buildables. Those legs are animated for moving when being hurt or things like that, but removing the leg animation bones and a few others like the head bones do not break the whole animation most of the time.
It looks like
Cvar::Latch
is not implemented yet on CGame side, this would be appreciated as thecg_lowModels
cvar should be latched (we need to reload the models to see a difference).This commit should works on
master
but I make this PR targetfor-0.55.0/sync
because since it requires models that are not released, no one can use the cvar yet anyway, and targetting thefor-0.55.0/sync
makes things easier to me when dealing with the various repositories.