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.
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.
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:
Launch the game in standalone or PIE.
Go to the viewpoint you wish to profile.
freezerendering on the console
profilegpu on the console
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.
#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
#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
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.