Modeldef option to always render model

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Modeldef option to always render model

Postby Bauul » Sun May 08, 2022 12:41 pm

Currently the rendering of in-game models is directly tied to the rendering of the underlying Thing a model is tied to, specifically whether or not the sector the Thing's origin is in is being rendered at the time.

This works fine for sprites, but in the era of increasingly large models (such as entire levels being exported as OBJs) there can be situations where you want the model to be visible even if the source-sector is out of sight.

The only current solution is the RenderRadius variable, which checks all sectors in a given radius and displays the model if any of those sectors are visible. However, in order to have a very large model consistently displayed throughout a map the required RenderRadius can end up being huge, and as it's a per-tic operation can absolutely wreck FPS on larger maps. I've had it halve frame rate by trying to get a large model to render properly (such as the staircase in Water 3 of Elementalism), meaning you have to choose between the model popping into view, or a terrible frame rate.

A long-term solution would be to render the model when any part of it would be visible, but I suspect that would be a substantial effort. In the mean time, a functional alternative would be a Modeldef flag that tells GZDoom to simply always render the model, regardless of what sectors are visible.

This would be significantly faster than using a giant RenderRadius (as it wouldn't need thousands of sight-checks every tic) and would also prevent any kind of popping-into-view that plagues using large models generally. It would be inefficient to use on smaller models placed multiple times, but for giant singular models that are visible throughout a map it would be incredibly useful.
Bauul
 
Joined: 29 Aug 2016

Re: Modeldef option to always render model

Postby Major Cooke » Sun May 08, 2022 1:27 pm

EDIT: Nevermind, I thought it was something else.
Last edited by Major Cooke on Sun May 08, 2022 5:06 pm, edited 1 time in total.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: Modeldef option to always render model

Postby Enjay » Sun May 08, 2022 1:30 pm

Indeed, but Bauul's post explains why he feels RenderRadius isn't always suitable. I don't know if he's correct or not, but he's looking for an alternative to RenderRadius.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Modeldef option to always render model

Postby Major Cooke » Sun May 08, 2022 5:11 pm

I'm honestly wondering if this would be better as an actor flag so we can control it live instead of just a model flag.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: Modeldef option to always render model

Postby Bauul » Sun May 08, 2022 5:28 pm

True, an actor flag would also work perfectly well too (given RenderRadius is an Actor flag there's precedent there).
Bauul
 
Joined: 29 Aug 2016

Re: Modeldef option to always render model

Postby Apeirogon » Wed Jun 01, 2022 3:50 pm

Major Cooke wrote:I'm honestly wondering if this would be better as an actor flag so we can control it live instead of just a model flag.

IIRC some nice features wasnt been added to actor class because of an impact on its size. Like, actors size in memory size is already several megabytes, again IIRC, which is not couples well with nowadays CPUs. So it better to be a model flag only.
"How change it than?" You shouldnt? Just redefine same model under different name with different rendering flags in modeldef. Having a list of models that ALWAYS should be drawn, no matter what is better in my opinion, that nobody asked for.
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests