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.
Modeldef option to always render model
Moderator: GZDoom Developers
-
- Posts: 8140
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: Modeldef option to always render model
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.
-
-
- Posts: 26476
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Modeldef option to always render model
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.
-
- Posts: 8140
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: Modeldef option to always render model
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.
-
- Posts: 78
- Joined: Mon Aug 29, 2016 4:23 pm
Re: Modeldef option to always render model
True, an actor flag would also work perfectly well too (given RenderRadius is an Actor flag there's precedent there).
-
- Posts: 1605
- Joined: Mon Jun 12, 2017 12:57 am
Re: Modeldef option to always render model
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.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.
"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.
-
- Posts: 559
- Joined: Sat Sep 23, 2017 8:42 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
Re: Modeldef option to always render model
I'd support the suggestion.
-
- Posts: 741
- Joined: Thu Mar 19, 2009 3:40 am
- Location: South Australia
Re: Modeldef option to always render model
Use the +NOSECTOR flag on the actor and it should stop the model from disappearing.
-
- Posts: 559
- Joined: Sat Sep 23, 2017 8:42 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
Re: Modeldef option to always render model
One thing that concerns me about "alwaysrenderable" flag is that wouldn't skyboxes also render it too? So that it will be like doing the same job twice, e.g. the skybox cameras render those models and the main player camera too.
I think then it would have to be coupled with "ONLYVISIBLE TO CAMERA #" flag.
I think then it would have to be coupled with "ONLYVISIBLE TO CAMERA #" flag.
-
- Posts: 559
- Joined: Sat Sep 23, 2017 8:42 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
Re: Modeldef option to always render model
It will make it invisible. It will not disappear indeed thoughDark-Assassin wrote: ↑Sat May 27, 2023 8:27 am Use the +NOSECTOR flag on the actor and it should stop the model from disappearing.

-
- Posts: 741
- Joined: Thu Mar 19, 2009 3:40 am
- Location: South Australia
Re: Modeldef option to always render model
I must have been thinking of a different flag then. Whoops.