development
monroegm-disable-blank-issue-2
main
2111.2
2111.1
2107.1
${ noResults }
7 Commits (4d8c8fdda39849eb3a358a2fc8b5ab5c2304d237)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
0e328afcdd
|
Optimize surface providers (#7631)
* Add comparison operators to SurfaceTagWeight. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Changed AddSurfaceTagWeight to always combine weights. This simplifies the API a bit and defines the behavior if someone ever tries to add a duplicate tag. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added benchmarks for measuring the performance-critical APIs. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Changed SurfaceTagWeights to a fixed_vector. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Add inPosition to AddSurfacePoint. This will be used to detect which input the surface point is associated with. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Add inPositionIndex to the appropriate APIs. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Switched Gradient Surface benchmarks to use actual surface components. The gradient unit tests and benchmarks were previously using a mock surface data system, which led to misleading benchmark results. Now, the actual SurfaceData system gets constructed, and the tests use a mock provider, but the benchmarks use actual shape providers for more realistic benchmarking. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed unit tests to have better query ranges. Half of each previous range was querying outside the surface provider's data. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * First attempt at removing SurfacePointLists. This currently runs significantly slower than the previous code but passes the unit tests. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Another attempt at optimization. This one runs faster than the previous, but still slow. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fix the cmake dependency so that the gradient tests rebuild SurfaceData.dll when run. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Switch SurfaceAltitudeGradient over to the new bulk API. Also, optimized the non-bulk API by having it reuse the SurfacePointList to avoid the repeated allocation / deallocation cost. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Switched to using an indirect index so that all allocations are consecutive in our reserved buffer. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Switched back to SurfaceTagWeight again. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added runtime dependency to LmbrCentral for unit tests. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Switched code over to use the full EnumeratePoints in most cases. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added knowledge of max surface point creation into the system. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Add generic GetSurfacePointsFromList API implementation for surface providers. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed implementation to use the correct maximum number of input points based on the surface providers being queried. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fix out-of-bounds references on empty lists. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fix memory allocation that caused benchmark runs to crash. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Starting to clean up the API. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Move SurfacePointList into separate files for easier maintainability. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed bug where too many points were filtered out due to using the position Z as a part of the AABB check. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Made FilterPoints an internal part of SurfacePointList so we can choose when and how to perform the filtering. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Final cleanup / comments. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Added includes for non-unity builds. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Optimized GetValues() implementations. Also consolidated GetValue() and GetValues() down to a single implementation under the covers for easier maintenance. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Changed how unit tests initialize the mock lists to try and fix the linux errors. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Switch to explicit span declarations to help ensure this works with linux. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Fixed compile error. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Make the bulk terrain APIs take in const Vector instead of non-const. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> * Optimize the surface data providers for bulk queries. Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com> |
4 years ago |
|
|
d0e5f9d20b
|
Added Async APIs for the various Process*FromList/Region terrain functions. (#7480)
* Added Async APIs for the various Process*FromList terrain functions. Please note that we are currently defaulting the number of worker threads to one, because splitting the work over multiple threads causes contention when locking various mutexes, resulting in slower overall wall time for async requests split over multiple threads vs one where all the work is done on a single thread. The latter is still preferable over a regular synchronous call because it is just as quick and prevents the main thread from blocking. This should be changed once the mutex contention issues have been addressed, so that async calls automatically split the work between available job manager worker threads, unless the ProcessAsyncParams specify a different desired number of jobs. Signed-off-by: bosnichd <bosnichd@amazon.com> * Fix Linux builds by adding missing #include Signed-off-by: bosnichd <bosnichd@amazon.com> * Added a test for cancellation of terrain async requests, and fix it so that it works. Note that the benchmarks show this implementation to be slightly slower than the previous one, which I presume is because we're now calling a 'perSurfacePointFunction' in the inner loop; this can probably be addressed, but will result in a lot of code duplication, and I think efforts will be better spent on removing the mutex contention to enable running multiple terrain async jobs at the same time. Signed-off-by: bosnichd <bosnichd@amazon.com> * Added Async versions for all Process*Region terrain API functions, along with benchmarks. Signed-off-by: bosnichd <bosnichd@amazon.com> * Fix the newly added terrain async request benchmarks to actually use the async APIs. Signed-off-by: bosnichd <bosnichd@amazon.com> * Revert to the original version which just calls the synchronous API from the job function, along with some other updates in response to review feedback. Signed-off-by: bosnichd <bosnichd@amazon.com> * Change the TerrainWorldDebugger to use the async API, along with the following changes: - TerrainJobContext no longer uses a JobCancelGroup so we can guarantee the completion callbacks of associated jobs will be invoked even if it is cancelled. - As a result of the above change, the ProcessAsyncCompleteCallback function signature again accepts the associated TerrainJobContext as a param. - The TerrainProcessAsyncCancellation test has been resurrected and simplified by using binary semaphores instead of condition variables. - All the async related TerrainSystemBenchmark functions have been simplified by using binary semaphores instead of condition variables. - Global cancellation of all terrain jobs on deactivation of the TerrainSystem has been reintroduced, but in a different way than before. - Other miscellaneous changes/fixes made while testing and based on earlier PR feedback. Signed-off-by: bosnichd <bosnichd@amazon.com> * Updates based on review feedback: - Go back to using a vector instead of an array (fixed the original problem by adding custom copy/assignment constructors/operators to the WireframeSector struct). - When calling WireframeSector::Reset, block until any associated in flight has completed. - Added the concept of a minimum number of positions per terrain job. Signed-off-by: bosnichd <bosnichd@amazon.com> * Use semaphore instead of binary_semaphore in a bunch of places to account for the race condition where a completion callback fires before we started waiting for it. Signed-off-by: bosnichd <bosnichd@amazon.com> |
4 years ago |
|
|
b455b915a8
|
Making terrain query resolution a single float instead of a Vector2 (#7186)
* Making terrain query resolution a single float instead of a Vector2 Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Keeping the concept of different x/y step sizes in region queries since that may be useful and is separate from query resolution. Also keeping the concept of different x/y step sizes in physics since that's independent of the terrain gem. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Formatting cleanups Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * A few more minor cleanups Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Added support to convert serialized Vector2 query resolution to a single float. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Switch ray intersection check back to using separate values for x and y resolution Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Fixing new unit tests added to use float query resolution. Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> * Updating automated test Signed-off-by: Ken Pruiksma <pruiksma@amazon.com> |
4 years ago |
|
|
f34d3a822e
|
Add a ray cast API to the terrain system, implement it, and use it so entities can be placed on top of terrain. (#6895)
* Add a ray cast API to the terrain system, implement it, and use it so entities can be placed on top of terrain. Still to do: - Unit tests - Profiling/benchmarks - Optimization (if needed, may not be now after updating to use the iterative approach, but one option could be to use SIMD to ray cast against both triangles at once) Signed-off-by: bosnichd <bosnichd@amazon.com> * Fix typos. Signed-off-by: bosnichd <bosnichd@amazon.com> * Added a FindNearestIntersectionIterative to use in place of the first-pass FindnearestIntersectionRecursive attempt. Signed-off-by: bosnichd <bosnichd@amazon.com> * Remove some functions that are no longer being used. Signed-off-by: bosnichd <bosnichd@amazon.com> * Remove a unicode character from a comment to fix the validation build. Signed-off-by: bosnichd <bosnichd@amazon.com> * Remove another unicode character from a comment to fix the validation build. Signed-off-by: bosnichd <bosnichd@amazon.com> * Update to bail out as soon as t > 1.0f Signed-off-by: bosnichd <bosnichd@amazon.com> |
4 years ago |
|
|
7bba4172ec |
Add a GetNumSamplesFromRegion function which returns the number of samples given a region and step size. Update Terrain Feature Processor to use this function to get the number of samples instead of computing num samples independently.
Signed-off-by: amzn-sj <srikkant@amazon.com> |
4 years ago |
|
|
5dc442fcb0
|
[Terrain] First pass of the ProcessList and ProcessRegion APIs for retrieving surface data (#6729)
* [Terrain] First pass of the ProcessList and ProcessRegion APIs for retrieving surface data Signed-off-by: amzn-sj <srikkant@amazon.com> * Add a couple of more tests. The expected values were plugged in based on the values generated by the brute force approach. Signed-off-by: amzn-sj <srikkant@amazon.com> * Move some declarations out of loops since they can be reused. Signed-off-by: amzn-sj <srikkant@amazon.com> * Update all the per position callbacks to pass SurfacePoint refs. Construct only one SurfacePoint object outside the loop which can be reused. Signed-off-by: amzn-sj <srikkant@amazon.com> * Update tests to use the new per position callbacks Signed-off-by: amzn-sj <srikkant@amazon.com> * Add ProcessRegion functions to the terrain benchmark. Signed-off-by: amzn-sj <srikkant@amazon.com> * Change C style static casts to aznumeric_cast. Add maybe_unused to unused params in benchmarks. Signed-off-by: amzn-sj <srikkant@amazon.com> * Update the ProcessList API functions to use array_view instead of a vector. This includes some additional changes to satisfy build dependencies. Signed-off-by: amzn-sj <srikkant@amazon.com> * Add ProcessList API functions to benchmarks Signed-off-by: amzn-sj <srikkant@amazon.com> * Update the ProcessList API functions to take Vector2 as input positions Signed-off-by: amzn-sj <srikkant@amazon.com> * Revert changes to AtomCore library split. Add partial implementation of span(mostly just copied over from array_view) to AzCore std containers. Signed-off-by: amzn-sj <srikkant@amazon.com> * Adding some const/non-const overloads that were missing in span Signed-off-by: amzn-sj <srikkant@amazon.com> * Move input position list generation to a function Signed-off-by: amzn-sj <srikkant@amazon.com> * Bring back Vector3 version of ProcessList functions. Rename Vector2 version to follow similar pattern as the Get functions. Signed-off-by: amzn-sj <srikkant@amazon.com> * Split span.h into .h/.inl files Signed-off-by: amzn-sj <srikkant@amazon.com> * Add [mayby_unused] for unused parameters to fix build errors Signed-off-by: amzn-sj <srikkant@amazon.com> |
4 years ago |
|
|
2259cb3dc0
|
Moved TerrainDataRquestBus to AzFrameworkTestShared (#5835)
* Moved TerrainDataRquestBus to AzFrameworkTestShared Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> * Changes from PR Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com> |
4 years ago |