Tessellation Camera Distance LOD?

I was wondering if there was a way to control the density of Tessellated meshes/materials as they expand away from or coming toward the camera. Right now my Tessellation triangle density remains the same on all meshes in the level causing a significant performance hit.

Thanks!

Have you tried enabling adaptive tessellation on the material’s properties. That causes the engine to try to choose a tessellation factor to maintain a constant triangle density in screen space. The tessellation factor specified by the material is then read as a multiplier so that you can boost or decrease the computed tessellation factor.

I always enable adaptive tessellation and I’ve never noticed fps changes based on distance from materials with tessellation

I posted a big forum post with some tests and pictures.

I did a test with 100 shields using dx11 tessellation on their mateiral

http://forums.epicgames.com/threads/978673-Picture-Gallery-Dx11-Turn-Texture-Detail-into-3D-Vertex-level-Detail-Procedural-HD?p=31728190&viewfull=1#post31728190

100 shield with no tessellation = 90 FPS (my set maximum), no drop at all, no matter what distance

100 shields WITH tessellation material, if I was very very far = 90 FPS

If I got relatively close but could see all 100 shields, I was then at 70 FPS, at a distance where the tessellation amount should have been 0. (there’s a pic at the link above)

I never noticed an increase in the FPS as I got further away from all the 100 shields (where the tessellation should go to 0).

My material was using a tessellation factor of 1

I also used a Material instance Tess factor of 0.777

#The only FPS Changes

The only gains in fps I got where actually very close, when some shields were getting culled.

#How to use Tess Factor as a Distance Multiplier Correctly?

I am happy to assume I am just not using the existing system correctly.

Should I not be using a factor of 0.777 or 1 for a relatively small object, seen anywhere from super far away to very up close?

#Thanks!

Thanks!

Rama

It’s hard to measure the perf impact if you are just looking at framerate.

You might consider using our GPU profiler. The UI is very early, but the gist is that you enter “profilegpu” on the console or press Ctrl+Shift+Comma to profile the next frame on the GPU. You will get a hierarchical breakdown of where GPU time went for that frame.

For a variety of reasons the numbers you get back from the GPU are not always consistent (frequency scaling, other applications using GPU resources, the driver further optimizing shaders in the background, etc.). I’d suggest always taking a few captures to verify your numbers. It also helps to make sure you are rendering exactly the same objects, so I’d suggest the following:

  1. Launch the game in standalone or PIE.
  2. Go to the viewpoint you wish to profile.
  3. freezerendering on the console
  4. profilegpu on the console
  5. Check out results, report 4-5 a few times.

A couple of experiments can help you determine the performance impact of different levels of tessellation. A good test is to look at the shadow depth passes for a movable directional light as that pass is often vertex bound and will be most impacted by tessellation. You can then experiment with tessellation on/off, adaptive on/off, and different tessellation multipliers.

Thanks for the tip about freezerendering Nick, and your analysis workflow suggestions!

:slight_smile:

Rama

(I would check mark this but its not my thread)

#Would be Very Nice
I’ve done a lot with DX11 Tessellation in UE4, and I also would appreciate some sort of easy scalar value to plug in to control how much the tessellation factor scales itself with distance of actor to camera :slight_smile:

#In the Meantime

In the meantime here’s the basic idea of a Material network you could use to regulate the Tesselation factor by distance

I’ve dynamically changed tessellation factor via material instances, so I can say that changing this value alot during game time is not a problem

but compiling the material shader does take a while :slight_smile:

:slight_smile:

Rma

you can multiply the scene depth and max tessellation value together to scale tessellation to distance.

Hey there, I was experimenting a lot and did some math and found a great solution to this problem. I even did a Tutorial how to change the tessellation lod of your object based on your distance towards the object:

I hope this helps. The material is driven by 6 parameters -> 3 for World Displacement and 3 for Tesselation Multiplier. You can set up the base value (maximum depth, maximum iterations) and then the minimum and maximum distance. The minimum distance is the distance from the object, where the set tesselation value (depth or iterations) stays the same. Then from the minimum towards the maximum distance it transitions towards 0.

Greetings,
Dave

PS: I also just added an unreal engine wiki page:

Hello,

This is a question from the beta version of the engine. We are marking this answered for tracking purposes. If you are experiencing an issue similar to this please post a new question.

Thank you.