BenPyton / ProceduralDungeon

This is an Unreal Engine 4/5 plugin to generate procedural dungeon.
MIT License
527 stars 64 forks source link

How to change occlusion culling distance? #12

Closed TheNovaProject closed 2 years ago

TheNovaProject commented 2 years ago

Hi! First off I just want to thank you for the plugin, its invaluable to the project I'm working on at the moment and I want to thank you for the contribution.

I just have one query in relation to the occlusion culling setting in project settings, I'm wondering if I can change the distance that it lets levels load in at since my project is fairly openly spaced I'm wanting it to only come into effect maybe 10 levels wide so that the effect wouldn't be noticed as much by the player instead of the 2/3 levels distance at present but I'm not sure if this is something I can change and if it is how I could do so?

Thanks in advance, keep up the good work!

BenPyton commented 2 years ago

Hi TheNovaProject,

The occlusion culling is just a check (BoxOverlap) to know in which room the player is. And then it set the visibility on of this room and its directly connected rooms (because we see them through the opened doors). This was done that way because of the specs of the project I had developped the plugin for (it was made of closed rooms).

So, to answer your question, there is no "distance" taken into account for the culling (and therefor no setting for it).

Nevertheless, you can make yourself the occlusion you want depending on, your project. You have multiple ways for doing it :

What is done actually in the plugin is not a "loading/unloading" of the level, but just a visibility toggle of the static actors inside of the rooms (computed during the generation process). Thus, all of the rooms are already loaded and in memory. Again, this is because of the specs of the initial project (because of the computed navmesh mainly).

I hope htis will helps you in your project 🙂

BenPyton commented 1 year ago

Just to make an update for future readers, the occlusion distance can now be changed since plugin's version 2.1.0