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"

How does object occlusion and culling work in UE4?

Hey everyone! I am still relatively new to Unreal 4 and I was wondering if someone here can either explain in detail or point me to a good learning resource for how object occlusion works in this engine? I have not been very successful in finding any info on how it works or how to set it up. What little I have read makes it seem like it is an automatic system? If that is the case it is not working for my scene. I want to occlude objects with other objects ( i.e. objects that are compleatly hidden behind a wall should drop out and not render for one example ) Is there a setting that needs to be enabled to make object occlusion work? In older versions of Crytek, and other proprietary engines I have used, artists place occluder meshes inside of their static assets so that when assets bounding volumes are totally obscurred by the occluder mesh, they don't draw, or they can also place occluder helpers in the scene that occlude everything behind them. Does UE4 have anything similar to this? Is there some kind of volume that can occlude objects behind it? I am at a bit of a loss on how to get objects behind walls to not draw. I tested if this is automatic by running the game in the editor then viewing in wireframe and I can see that everything is drawing, so if it is supposed to be automatic, then it doesn't work, unless testing in wireframe is not the correct way to do it??? Is there a way to capture the camera's frustum and see what is being drawn?

Any help would be most appreciated.

Thanks - Jason!

Product Version: UE 4.9
Tags:
more ▼

asked Oct 03 '15 at 07:15 AM in Rendering

avatar image

Jay_Lew_45
36 2 5 8

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

2 answers: sort voted first

Hi Jason,

Unreal Engine 4 uses an automatic process for culling that uses Scene Depth and the bounds of an object.

When using the Wireframe viewmode, this is not a good method for testing if an object is occluded in UE4. You can use the (Editor only) console command r.visualizeOccludedPrimitives 1 to view the occluded objects. This will render a green bounds box for any objects that are occluded. Adjusting the bounds scale will increase the green bounding box and can cause the mesh to be rendered even when it's not in view.

In the project settings you can disable Occlusion Culling completely if you need, but in most cases this is not needed.

There is an alternative method of occlusion in the engine that is not on by default. It's less strict than the currently default method. You can enable this by using the console command r.HZBOcclusion 1

This uses an approximation with occlusion culling. It will occlude the mesh dependent more on size and bounds scale than strictly on bounds scale. This can be useful in some instances, but problematic in others where it would cause meshes to be rendered that you wouldn't necessarily wan to be when hidden. This is largely why it's not on by default at the moment.

Using the first console command above is the best solution right now for debugging what's being occluded and what's not for the time being.

I hope this helps.

Tim

more ▼

answered Oct 05 '15 at 03:37 PM

avatar image

Tim Hobson ♦♦ STAFF
48.8k 887 101 878

avatar image Vertex Soup Oct 21 '16 at 01:59 PM

@Tim Hobson could you please elaborate a bit more what is considered bounds? I hope Unreal is intelligent enough to not tak pivot position when it is outside of tight mesh bounding box, eg using workflow with baking pivot. Eg my pivot is at level origin but my actual mesh might be offseted somewhere else. In this case is bounds of object what I can see in Static Mesh Editor once i toggle this option on? Thank you.

avatar image Tim Hobson ♦♦ STAFF Oct 24 '16 at 01:23 PM

@Vertex Soup

The pivot point is not considered for bounds (unless you're using assets in a Blueprint where the bounds is much larger then!) speaking specifically about Static and Skeletal meshes. The tight bounding box is around geometry only. The box is used to then generate the sphere bounds that touch each corner of the box.

The bounds you see in the static/skeletal mesh editors is the bounds for the mesh. You can also view this in your editor by going to show > Advanced > Bounds.

With 4.13 and the introduction of the Preview Scenes, when you enable Bounds view you'll also see the bounds of the floor mesh along with the sky sphere, which could possibly be misleading to you. Disable these from the Preview Scene Settings or just focus on your actual geometry.

-Tim

avatar image Vertex Soup Oct 24 '16 at 01:32 PM

Thank you for clarification Tim! :) Wiser every day.

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

This went over my head, Im more of a visual learning. Only thing I figured out was activating the Bounds. I hit play viewing the other viewports. I didn't see any meshes disappearing. I feel like this is a subject that is lacking. I can't find any videos for Unreal on setting up good optimization with occlusion culling. Unity has tons of info and video on this. I finally found this vid https://youtu.be/6MhsdwTW3SQ I would like to it go in depth with custom created meshes on setting up scenes when moving from area to area on how that works.

more ▼

answered Jul 29 '17 at 12:55 AM

avatar image

Trugb35
31 2 4 6

avatar image Tim Hobson ♦♦ STAFF Jul 29 '17 at 06:57 AM

Maybe this will help in addition to my video that you linked: https://docs.unrealengine.com/udk/Three/VisibilityCulling.html

This documentation is for Unreal Engine 3, but mostly holds true with UE4 with only a few of the viewmodes not working the same in UE4. The information contained within is still good though and may help you get a better understanding of the culling system.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

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

Answers to this question