Health and ammo packs don't render properly on low LOD settings

Wanderer

L1: Registered
Nov 29, 2023
6
0
Hello everyone.

While working on my map, I have repeatedly run into the issue of health and ammo packs disappearing (i.e. their models not being rendered) even though they are still in my field of view. This seems to be influenced by the direction I am looking and the distance am I away from them - looking straight at the packs from close enough usually makes them render correctly, but looking anywhere in the general direction of down and to the right (from the perspective of the picture attached) results in most of them temporarily turning invisible. They have not actually disappeared, as you can still see a shadow (look next to the point) and still see them with mat_wireframe 3, but their model is failing to render.

Can anyone tell me why this is happening? My map is symmetrical, but this effect is not (looking at the same places on the other side does not produce identical results).

Thanks.

Note: This map was made for a sourcemod called Team Fortress 2 Classic, but I loaded the map in regular TF2 and the problem persists, so any solutions you can give me will still apply.

Edit: I have discovered that changing my LOD settings (specifically r_lod to 1 instead of the default -1) fixes it for me. But I would still like to know how I can make these packs visible to all players regardless of their LOD settings.

Edit 2: Somehow, this issue doesn't seem to affect other peoples' maps. As a test, I re-compiled a decompiled koth_viaduct and took a look at some of the packs from thousands of HU away with the lowest LOD settings, and yet they still render. How? The entities are exactly the same. In fact, I copied these mysterious working packs into my map (near the spot in picture one) and they stopped working. So it is something about my map. But what?

I have attached images from my view in Hammer++. One just viewing this area normally and one with the portal file loaded. Maybe this will help someone more knowledgeable than me figure it out.

Image 1:

20231203052851_1.jpg


Image 2:

1701663095352.png


Image 3:

1701663143700.png
 
Last edited:

Tiftid

the Embodiment of Scarlet Devil
aa
Sep 10, 2016
532
399
I reckon it'll be more helpful to attach a screenshot of the properties of the health and ammo packs, as well as the Map Properties.
You may be trying to use a weird, buggy screenspace culling feature.
 

Wanderer

L1: Registered
Nov 29, 2023
6
0
Thank you for the reply. As requested:

Map Properties

1701688049536.png


Properties of a disappearing ammo pack on my map:

1701688165202.png


Map properties of a decompiled, unedited Viaduct for comparison:

1701688225995.png


Properties of a non-disappearing ammo pack on Viaduct:
1701688300840.png


Again though, I kind of doubt the properties of the packs could be the problem, given that I can copy a pack that works fine in one map into my map and it stops working, without any changes to its properties. But maybe there is some hidden jank going on.
 

Wanderer

L1: Registered
Nov 29, 2023
6
0
There is not a single func_occluder in the map, and no func_areaportal(window) in that entire large middle area. I checked using Entity Report.

Screenspace culling seems like the right hunch to me - by using mat_wireframe 1, I can see the packs' wireframes when they have disappeared in normal view.
This is significant because this does not work if they are not rendered due to VIS deciding that they shouldn't - if I'm inside or behind a brush and use that command, I cannot see the packs' wireframes (which is correct). So it can't be areaportals or occluders, it must be some other setting or missing entity that handles that. (Edit: This conclusion is incorrect. See below.)
I ran around some other custom maps for TF2C with my low LOD settings and could never get this problem to appear, so it must be something with this map specifically.

Update: I compiled the map with all tool brushes disabled and the problem was fixed. Now I need to find the tool brush causing this. Maybe it was an areaportal after all? Though I couldn't imagine why.
 
Last edited:

Wanderer

L1: Registered
Nov 29, 2023
6
0
Final post in this thread (doublepost but I think it's warranted):

The culprit was an areaportalwindow in one of the doorways leading to this area. I don't know how or why this brush in particular could possibly have led to those models not rendering, but oh well.

Let the lesson of this thread be this:

If you have issues with models randomly disappearing when they shouldn't and have tried changing any and all possible fade / render distance properties, compile the map without toolbrushes. To do this, turn them off in the VisGroups menu (right-hand side in Hammer++). If the problem does not persist in this version of the map, then the problem is likely caused by a tool brush (in my case func_areaportalwindow). It doesn't have to be one that would seem to be able to interfere with the disappearing model - in my case, it was still in the same room, but nowhere near the spot from which the models were incorrectly invisible.

And don't draw premature conclusions about programs you don't really understand, I guess :p