Update 01
- Added a SculptComponent that handles all player input and sends update request to terrain.
- ProceduralMeshComponent can be used instead of RuntimeMeshComponent.
- Other minor changes.
What surprised me most is, that the ProceduralMesh is actually **faster **than the RuntimeMesh. In the beginning you can see the performance of the RMC. (at about 2:00 i change it to PMC)
Besides that, I started to use “CalculateTangentsForMesh” to generate the Vertex Normals. Because that function is so demanding, I only execute it once when releasing the Mouse button.
I will have to replace that sooner or later, because I don’t like how that messes with my normals while sculpting.
That CalculateTangentsForMesh function also does much more than I need. It generates tangents & normals for a whole section instead for only the affected vertices.
All I need are the normals around the brush.
I will either:
- make my own method to calculate normals
- use line trace HitResult.Normal (I use this when generating the terrain. Works surprisingly well but has it’s flaws)
- wait for v2.0 of RuntimeMeshComponent. The author plans to release his own method that might be better.
Since I started this project, I noticed that my harddrive space was getting fuller for no reason.
I figured that the problem was ue4s “DerivedDataCache” which was getting bigger every time “CreateMeshSection” and “UpdateMeshSection” executes.
I had to delete 67gb yesterday and there are again 5gb in there.
It is intersting, that the “UpdateMeshSection” function of the PMC does not affect the size while the RMC does. No idea what’s going on.