SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
84 stars 18 forks source link

Problems with furniture render distance including new barriers on Volk Military Base #4349

Closed Happy12222 closed 4 months ago

Happy12222 commented 4 months ago

Here is example of me watching through new barriers and furniture https://youtu.be/TXiLifoXeFg And here some more examples of furniture disappearing on other location https://youtu.be/58uU0VAMIRU

SDGNelson commented 4 months ago

Awesome trick jumping on the zombie's head to get over the low wall at the end of the airstrip!

Unfortunately, the camera through the small barrier trick predates the wall replacement. If anything it's a little better now that most of the walls are using the larger objects which block the camera. This is a limitation of Unity's current physics system: Each collider can only be assigned one physics layer, so on a per-physics-layer basis we have to decide whether they should block the camera. In other engines like Unreal or Godot we would be able to assign on a per-object basis whether the camera can pass through using layer masks. My hope long-term is that with Unity's eventual physics engine update we can do something like that.

Hiding objects inside buildings is a tradeoff between performance and gameplay as you highlighted. When rewriting the "culling volumes" I did consider using the on-screen size so that they would appear when scoped in, but this would enable an order of magnitude more objects when scoped in requiring e.g. frustum culling for the volumes, and still be exploitable without aggressive hysteresis - I didn't feel it was worth it.