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.
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?
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.
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.