x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] Occlusion culling one frame lag

There seams to be a one frame lag between the moment when a static mesh becomes unoccluded and when it begins being rendered.

The problem disappears when occlusion culling is disabled in project settings (obviously). It also can be minimized with bounds scaling, but values have to be quite high (above 5.0).

There's also a similar issue when traversing the level in editor. Sometimes a mesh does not render until you move the camera.

What could be causing this issue?

EDIT: Attached example project for UE 4.8.0 (Culling.zip)

Product Version: Not Selected
Tags:
culling.zip (667.4 kB)
more ▼

asked Jul 09 '15 at 04:56 PM in Rendering

avatar image

Answers.Archive STAFF
1.9k 199 306 679

avatar image Answers.Archive STAFF Jul 09 '15 at 04:57 PM

Hi,

We think this post contains useful information which we would like to share with our public UE4 community. With your approval, we would like to make a copy of this post on the public AnswerHub which includes the discussion but strips out your username and company name. Please let us know if you are okay with this.

Thanks!

avatar image Answers.Archive STAFF Jul 09 '15 at 04:57 PM

Sure, no problem.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed Jul 09 '15 at 04:57 PM by Ben Halliday for the following reason:

The question is answered, right answer was accepted


2 answers: sort voted first

Hi Marcin,

There is a couple of options to try that you may or may not have explored. I used your test scene as a base for any settings I mention below.

  • Bounds Scale: This is mesh specific and can be changed via the details panel. The default value is 1.0. Increasing the bounds scale to 1.15 increased the bounds enough that These object rendered before the noticeable pop-in. Since the walls are broken up into smaller pieces they have a smaller bounds (which can be visualized by going to viewport > Show > advanced > bounds). Smaller object bounds will occlude the object more quickly to better optimize the scene.

  • r.VisualizeOccludedPrimitives: enabling this console command will draw a green box around any occluded primitive. This works while editing, but not during PIE/simulate. This can be useful when adjusting the bounds scale of objects to see if they are occluded or not.

  • Project Settings > Rendering: Disabling Occlusion Culling completely. Not really an option for most, but an option none-the-less.

  • r.HZBOcclusion: This setting used to be enabled by default (which if you look at the tip in the output log will indicate 1 use to be the default), but needs to be enabled now to use since it still needs a little bit of work. HZB Occlusion's results are more approximate, but it is meant to scale better. - 0 (default): disabled - 1: Use HZB occlusion system (Less GPU and CPU cost, more conservative results) - 2: Froce HZB occlusion system (overrides rendering platform preferences)

Enabling HZB Occlusion will likely provide the better result for you without the need for tweaking bounds scales for any meshes that are causing issues. In your test scene, simply enabling HZB occlusion solves the issue. There is the occasional pop-in from the corners if moving the camera really fast, but it's not as noticeable as before. On the other hand, if it's only a few meshes that are causing issue then I would suggest adjusting just those meshes bound scales slightly until they do not pop-in like so.

I hope this helps and if you have any questions feel free to let me know.

Tim

more ▼

answered Jul 09 '15 at 04:57 PM

avatar image

Answers.Archive STAFF
1.9k 199 306 679

avatar image Answers.Archive STAFF Jul 09 '15 at 04:57 PM +

Hi Tim,

Thanks for detailed answer. Would the short answer be, that this behaviour is expected and the assets are not prepared correctly?

As for the bounds scale. If bounds are spheres, as visualized in static mesh editor, they should work well for thin long vertical pieces and horizontal movement, as in attached project. What am I missing?

Thanks, Marcin

avatar image Answers.Archive STAFF Jul 09 '15 at 04:57 PM

Hi Marcin,

All assets are going to be given a bounds scale of 1.0 by default and the bounding box is determined by the mesh itself in the editor. There isn't really any setup that you have to do aside from getting it into the engine.

The sphere has to bound the geometry just like the box does. The renderer will use whichever one is more appropriate for the operation it is doing. With HZB occlusion it's looking at more than just the bounds box when considering culling the object. (As a reference the information on how HZB calculates bounds can be found in HZBOcclusion.usf in the source).

Using long then meshes with the default occlusion is going to work more with the bounds box than using the approximation that HZB occlusion can provide. Increasing the bounds manually is the other option for any meshes that are popping in.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hey,

can you check the console command r.OneFrameThreadLag ? Its set to 1 by default and controls the synchronization of the game with the render thread. Try with a setting of 0.

Cheers, Oliver

more ▼

answered Jul 09 '15 at 04:56 PM

avatar image

Answers.Archive STAFF
1.9k 199 306 679

avatar image Answers.Archive STAFF Jul 09 '15 at 04:57 PM

Hi Oliver,

I tried to set it in runtime and with ConsoleVariables.ini, but there's no change.

Thanks, Marcin

P.S. Sorry for the delay, but the comment got stuck two days ago somewhere between my browser and the server ;)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question