Modeldef option to always render model

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Modeldef option to always render model

Re: Modeldef option to always render model

by Dark-Assassin » Sat May 27, 2023 2:32 pm

I must have been thinking of a different flag then. Whoops.

Re: Modeldef option to always render model

by Darkcrafter » Sat May 27, 2023 8:47 am

Dark-Assassin wrote: Sat May 27, 2023 8:27 am Use the +NOSECTOR flag on the actor and it should stop the model from disappearing.
It will make it invisible. It will not disappear indeed though :lol:

Re: Modeldef option to always render model

by Darkcrafter » Sat May 27, 2023 8:32 am

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.

Re: Modeldef option to always render model

by Dark-Assassin » Sat May 27, 2023 8:27 am

Use the +NOSECTOR flag on the actor and it should stop the model from disappearing.

Re: Modeldef option to always render model

by Darkcrafter » Sat May 27, 2023 8:16 am

I'd support the suggestion.

Re: Modeldef option to always render model

by 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.

Re: Modeldef option to always render model

by 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).

Re: Modeldef option to always render model

by 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.

Re: Modeldef option to always render model

by 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.

Re: Modeldef option to always render model

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

EDIT: Nevermind, I thought it was something else.

Modeldef option to always render model

by 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.

Top