You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Gems/Terrain/Code/Source/Components
Mike Balfour 49dd17f410
Optimized Terrain Debugger Wireframe rendering (#6572)
* Optimized wireframe drawing.
As a part of rearranging the code to make use of the upcoming ProcessHeightsFromRegion, the number of calls to GetHeight could be reduced, dropping the refresh time in my test case from 2550 ms to 1068 ms.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Change refresh to only happen on wireframe draws.
This helps ensure that multiple data changes in a single frame don't cause multiple refreshes, and prevents us from taking a refresh penalty when the wireframe isn't being drawn at all.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Change debugger to update wireframes incrementally.
This works by having a fixed NxN grid of sectors.  The camera is always considered as being in the center of the grid, so anytime the camera's grid square changes, only a subset of sectors are updated to have the new wireframe data.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Bugfix - sector vertex count was 4x too high.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Bugfixes & comments.
Fixed initial "mark dirty" refresh - the dirty region Z value needed to be ignored.
Added copious comments for the math & logic, and simplified some of the math.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Small update to comment for better readability.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Addressed PR feedback.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
..
TerrainHeightGradientListComponent.cpp LYN-7376 test_TerrainHeightGradientList_AddRemoveGradients 4 years ago
TerrainHeightGradientListComponent.h LYN-7376 test_TerrainHeightGradientList_AddRemoveGradients 4 years ago
TerrainLayerSpawnerComponent.cpp LYN-7376 test_TerrainHeightGradientList_AddRemoveGradients 4 years ago
TerrainLayerSpawnerComponent.h LYN-7376 test_TerrainHeightGradientList_AddRemoveGradients 4 years ago
TerrainPhysicsColliderComponent.cpp Added default material return when no mapping is assigned. 4 years ago
TerrainPhysicsColliderComponent.h Added default material return when no mapping is assigned. 4 years ago
TerrainSurfaceDataSystemComponent.cpp Restore BusDisconnect() that got accidentally removed on a recent commit. (#6557) 4 years ago
TerrainSurfaceDataSystemComponent.h review changes 4 years ago
TerrainSurfaceGradientListComponent.cpp Move to development and add review fixes. 4 years ago
TerrainSurfaceGradientListComponent.h Terrain API cleanups (#4914) 4 years ago
TerrainSystemComponent.cpp Terrain System fixes (#4299) 4 years ago
TerrainSystemComponent.h Initial stub terrain gem (#3368) 4 years ago
TerrainWorldComponent.cpp Adds check to make sure that there are not too many samples created. (#5789) 4 years ago
TerrainWorldComponent.h Adds check to make sure that there are not too many samples created. (#5789) 4 years ago
TerrainWorldDebuggerComponent.cpp Optimized Terrain Debugger Wireframe rendering (#6572) 4 years ago
TerrainWorldDebuggerComponent.h Optimized Terrain Debugger Wireframe rendering (#6572) 4 years ago
TerrainWorldRendererComponent.cpp Rendered World Size in the Terrain World Render component set to invisible (#5378) 4 years ago
TerrainWorldRendererComponent.h Fix console warning when adding TerrainWorldRendererComponent (#4964) 4 years ago