Opened 11 years ago
Last modified 10 years ago
#2039 new enhancement
Implement caching of terrain normals — at Initial Version
Reported by: | wraitii | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Backlog |
Component: | Core engine | Keywords: | |
Cc: | sanderd17 | Patch: |
Description
After #1988 was committed, and because of other bits of code already using it (foam generation for the water, decal generation)
Calculating terrain normals is fairly slow, uses a ton of temporary memory, and is generally not a good idea to do on the fly. #1988 means we'll be calculating normals all the time. We should cache the values of each vertex normal, which will considerably speed up such a task.
A few concerns:
-Atlas needs a way to not cache terrain or to invalidate the terrain cache (there is a message for that I believe)
-A cache should be as quickly accessed as possible.
-We need to sort out the fixed v not fixed issue with normals. Imo, we should use the non-fixed version as much as possible for anything graphical (ie not checked for OOS), because it's simply faster.
Normals are most likely calculated first in PatchRData, when building the terrain mesh.