Hello,
In the game me and my brother are creating we make heavy use of mesh distance fields. It’s a great tool to fix a lot of problems we would normally have such as water foam around objects, water culling, damage culling and more. But we have done some performance testing and have noticed that our gpu render times are through the roof (23ms and more) only because of the distance fields. If we turn them off, we get much higher frame rates and normal GPU profiler times (14ms and less), which is really really depressing news for us.
The thing is that we would be totally okay with having only a few object generate distance fields as we only use them on particular meshes where we need them anyway. But as far as we’ve researched it’s either all or nothing, which means that we can’t exclude any meshes that are generating them without actually needing their fields.
Now, we have regained a little bit of hope seeing the new update release of 4.16 which claims to improve distance fields generating with 2.5x times faster. This would definitely help. But we are wondering if any of you have any other tips (and tricks) to use distance fields as optimal as possible. Perhaps anyone knows of a way to exclude certain meshes from generating unneeded fields?
What we have tried so far is first of all select a whole bunch of objects and ticked off “affect mesh distance fields” under lighting, but this doesn’t change anything, as far as we tested the gpu profiler still shows 6ms generation time for the fields and it’s still very much slowing down our game.
We’ve then also tried reducing the distance field resolution scale down to 0, but again to no noticeable improvement on FPS.
The strange thing is that when we ticked off “affect mesh distance fields” under lighting and then go into visualize mode “show mesh distance fields” we don’t see the object’s distance fields in there, yet somehow they are still being generated and are still impacting performance. Does anyone know why this is?
Hope we get some replies, we really love distance fields and it would be really painful and a huge setback if we have to disable them completely.
To give an example of the “real problem”… Our game runs pretty smooth even with the distance fields. But the performance issues arise when there a lot of small objects together in one place. Most likely due to the fact there are tons and tons of distance fields that are being generated and overlapping. (although I don’t know if overlapping of distance fields has any cost). Like we have a dock which consists of many wood planks and on this dock there are also a lot of props, such as barrels, ropes, … When I look at this “clutter” of objects that’s when the real performance issues arise. The distance fields cost goes so high the game becomes really stuttery and slow.