Trouble with disappearing models.

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Trouble with disappearing models.

Post by Nash »

https://dl.dropbox.com/u/47355875/New%20Folder.zip

1) Just drag this .zip on to gzdoom.exe
2) From the start position, without moving the player, turn your view around.

You will see the roof mesh suddenly appear. Move the view far away enough and the mesh will disappear. This is because the sector that houses the thing is not visible anymore; therefore the thing is not drawn.

Can anyone think of any solutions around this? Using 3-d floors for roof work is not acceptable, due to the way the control sectors have to be precisely aligned, mass producing these houses for a small town (which no doubt, the houses will be all over the place and in different angles too) is out of the question. Using models is the easiest way.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Trouble with disappearing models.

Post by Enjay »

I realise that this is far from a universal solution but if the structures you want are exactly like the ones in your test map, I'd do it like the attached example (load it on top of your example zip).
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Trouble with disappearing models.

Post by Nash »

Ah, so make the sector that houses the roof the same sector as the outside sectors. To improve performance, I guess what I can do is enclose the perimeter of each house to a large containing sector, so that the engine does still have a chance to occlude the thing... I mean, Sector 1 is going to be huge, and having all of the roofs in the map not culled at all would be a bad thing...

Thanks for the simple solution. :)
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Trouble with disappearing models.

Post by Enjay »

What I did there is pretty much the principle that I use for most large-ish sized static models. ie make sure that the actor is in a sector that you can always see whenever you should be able to see the model. There are some obvious limitations but it works in many cases.

Creating a containing sector that is just big enough to contain the model (and thereby will always be seen when the model is visible) like you suggest is also very useful. Again there are limitations but it often works.

Here is one of the limitations I have come across when messing with models and trying to ensure that they are always visible:
Spoiler:
As I mentioned with the above example, creating a "containing sector" can allow you to use invisible 3D floors or other tricks to give the model some fake collision properties. When I'm setting something like that up, I find that it helps to put translucent mid textures on the lines that form the edges of the containing sector so that when I check it in game, I can see how close my sector comes to matching the shape of the model. This can help out quite a bit if the model has a complicated shape. Once it's all done, the mid textures get removed.


Another example that you might find useful:
Spoiler:
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Trouble with disappearing models.

Post by Nash »

... :O

Argh Enjay, you and your mysterious unreleasable mods! :'( :P

But yes, very useful tips, thank you. Will keep these in mind.
Spoiler:
User avatar
NeuralStunner
 
 
Posts: 12325
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Trouble with disappearing models.

Post by NeuralStunner »

Enjay wrote:However, if you try, you can see the hole in the middle that is actually the same sector as the normally lit surrounding area.
If you used UDMF, there's a sector property perfect for concealing such things. ;)
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Trouble with disappearing models.

Post by Enjay »

Nash wrote:Argh Enjay, you and your mysterious unreleasable mods! :'( :P
These aren't so much unreleasable as not worth releasing. The first one (with the cars) is a horrible, blocky, simplistic map with not much to do in it and the second is only a tiny area with no real gameplay to speak of - sort of a mapping doodle I suppose.
NeuralStunner wrote:If you used UDMF, there's a sector property perfect for concealing such things. ;)
There is? I'm intrigued. Given that the little square is the same sector as the rest of the surrounding area, would the sector property not affect the entire area as well as the little square?

I used UDMF to modify Nash's example (though it took me about three times as long as it would have in an editor that I know properly). :P
User avatar
NeuralStunner
 
 
Posts: 12325
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Trouble with disappearing models.

Post by NeuralStunner »

Enjay wrote:Given that the little square is the same sector as the rest of the surrounding area, would the sector property not affect the entire area as well as the little square?
Heh, that would be a bit of a problem, yes. Image
Jitan
Posts: 44
Joined: Tue Oct 04, 2011 6:32 am

Re: Trouble with disappearing models.

Post by Jitan »

I got this problem too, I make a huge house and can only see it if I look at the actor directly. So it seem there are solution
User avatar
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: Trouble with disappearing models.

Post by Tormentor667 »

Nash wrote:Argh Enjay, you and your mysterious unreleasable mods! :'( :P
User avatar
ReX
Posts: 1578
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Trouble with disappearing models.

Post by ReX »

Enjay wrote:.... make sure that the actor is in a sector that you can always see whenever you should be able to see the model. There are some obvious limitations but it works in many cases.
Is there an explanation for why GZDooM has such a limitation with models? And are there any indications that Graf may be working towards a permanent solution? I am constantly finding that I can't use the work-around when very long models are involved.
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Trouble with disappearing models.

Post by Nash »

It has nothing to do with models. Actor Things are like that in the Doom engine: if the sector is out of view, all Things in that sector are not drawn. The same thing will happen with the corpse of a Spider Mastermind in sprite form (which is very wide) .

In most cases, this doesn't manifest in "normal" circumstances, but because we are using huge objects whose geometry perimeter is larger than the sector... it becomes really evident.

This is probably done for performance reasons. Disabling this behaviour in the Doom engine is probably an easy fix (probably just have to comment out the line responsible for doing this) but I guess performance will be really slow because Things wouldn't be occluded anymore...
User avatar
Nash
 
 
Posts: 17434
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Trouble with disappearing models.

Post by Nash »

Double post. Is there possibly another way to build the construct as demonstrated in my first post, but without the flat middle sector to do the sloping? Besides slope tilt Things. So basically what I'm looking for is a sharp triangle silhouette for the house (if viewed from the side).
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Trouble with disappearing models.

Post by Enjay »

Can't check - at work, but could you make the roof out of 4 triangles (each slope being a rectangle made from 2 triangles like you would if making a model) and use vertex hights? (I *think* they only work on triangles - right?)
User avatar
Sgt Dopey
Posts: 558
Joined: Thu Jan 13, 2011 8:44 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Australia

Re: Trouble with disappearing models.

Post by Sgt Dopey »

Enjay wrote: (I *think* they only work on triangles - right?)
They're best used on triangles
Locked

Return to “Editing (Archive)”