Commit Graph

26 Commits (c4dce0da95fce21f10bfb63deeb9ee7238059d8f)

Author SHA1 Message Date
Chris Galvan c4dce0da95
Merge pull request #7702 from aws-lumberyard-dev/cgalvan/FixedSetImageAssetPathAPI
Updated SetImageAssetPath on image gradient to be more robust
4 years ago
Chris Galvan 506c5ec0a8 Fixed SetImageAssetPath API on image gradient
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
4 years ago
Chris Galvan b2c7cf4452 Moved GetValueFromImageAsset from ImageAsset to ImageGradientComponent
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
4 years ago
Chris Galvan 9cd84b6b2d Only allow streaming image assets with supported pixel formats to be selected for an image gradient
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
4 years ago
Chris Galvan 2e762ba0eb Modified activate logic from PR feedback
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
4 years ago
Chris Galvan 2f3c4d37df Improved image gradient GetValue(s) performance by using cached image data
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
4 years ago
Chris Galvan 2c54b48a9e Modified image gradient config json serializer to be able to detect version difference earlier
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
4 years ago
Chris Galvan 22f018c310 Moved the ImageProcessingDefines to the Include folder and added it to the header only target
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
4 years ago
Chris Galvan 6322dd5397 Updated the image gradient component to use a streaming image asset
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
4 years ago
Mike Balfour 83878e6377
Change GetValues() to take in const positions. (#6987)
* Change GetValues() to take in const positions.
To support this, span needed some template deductions to correctly convert from non-const containers to const ones.

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

* Removed the most problematic template deduction rules.

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

* Remove duplicate validate_iterator methods.
iterator type is a pointer, not a value, so "const iterator" and "const const_iterator" produce the same function signature.

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

* Fixed the span types.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
Mike Balfour c403fa3db6
More GetValues() overrides (#6896)
* Benchmarks and tests for Image and Constant GetValues

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

* Verify GetValues for Perlin and Random Gradients

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

* Standardized the assert format for GetValues().

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

* More GetValues unit tests and test cleanup

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

* Fixed typos

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

* GetValues() unit tests for surface gradients.

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

* Benchmarks for ShapeAreaFalloff Gradient

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

* Added benchmarks for all remaining gradients and cleaned up the helper methods.

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

* Renamed class for better report formatting.

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

* Added missing Mocks dependencies for the Editor tests.

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

* First batch of specific GetValues() overrides.
Each one is measurably faster than the generic version.  Also, in ShapeAreaFalloffGradient, I optimized and simplified the logic a bit, so GetValue() is marginally faster too.

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

* Change GetValues() to use span and add more overrides.

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

* Convert GetValues() to use AZStd::span and added more overrides.

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

* Add missing include.

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

* PR feedback - switch to fill

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

* Fixed the logic and added unit tests and comments.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
Mike Balfour 79431f5e5f
First batch of GetValues() overrides (#6852)
* Benchmarks and tests for Image and Constant GetValues

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

* Verify GetValues for Perlin and Random Gradients

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

* Standardized the assert format for GetValues().

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

* More GetValues unit tests and test cleanup

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

* Fixed typos

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

* GetValues() unit tests for surface gradients.

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

* Benchmarks for ShapeAreaFalloff Gradient

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

* Added benchmarks for all remaining gradients and cleaned up the helper methods.

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

* Renamed class for better report formatting.

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

* Added missing Mocks dependencies for the Editor tests.

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

* First batch of specific GetValues() overrides.
Each one is measurably faster than the generic version.  Also, in ShapeAreaFalloffGradient, I optimized and simplified the logic a bit, so GetValue() is marginally faster too.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
Mike Balfour b0af08e61f Moved GradientSignal component headers to Include directory.
All of the component headers in the gem have been moved to the Include directory to make them public to other gems.  This allows "upstream" unit tests and benchmarks to easily create real non-mocked-out versions of these components to do more integration-level and system-level testing and benchmarking.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
Mike Balfour 48260486fb
Change gradients to use cached GradientTransform instance (#6591)
* Change flow so that TerrainSystem stops responding during deactivation.
Some systems might accidentally try to call back to the TerrainSystem inside a DestroyBegin notification, so make sure it stops listening before sending out the notification.

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

* Change gradients to cache and use a GradientTransform instance.
In my local test case, calling EBus on every call took 337 ms, using a lambda to wrap the calls took 197 ms, and using the fully cached version took 170 ms.

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

* Remove the wrappingTransform function and go back to the switch statement.
There was a bit of overhead to each function call due to using AZStd::function that just isn't necessary for this use case.

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

* Add profile markers to the heightfield updates so that they're more visible.

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

* Cleared state while component is deactivated.
The state was getting refreshed even while the component was in a deactivated state, which meant that it wasn't properly notifying of state changes when it became active since it wasn't detecting an actual change.  By clearing the state when deactivated, and ensuring the state isn't getting refreshed *while* deactivated, the notifications work properly.

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

* Fixed compile warning on unit test.

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

* Addressed PR feedback - changed comments, reduced mutex scope

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
Mike Balfour a10bf92739
Encapsulated gradient transform logic into separate class (#6586)
* First version of GradientTransform class.
The gradient transform logic is getting encapsulated into a class so that it can be cached and used by components in a much more optimal way than making ebus calls to the GradientTransform component on every transformed point.

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

* Moved GradientTransform into its own source files.

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

* Clean up and simplify GradientTransform logic.
Added extensive commenting and split TransformPositionToUVW into a separate method for normalizing (TransformPositionToUVWNormalized) so that there doesn't need to be any conditional logic.  There's no runtime variance as to which one needs to be called from a given call site.

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

* Added unit tests for GradientTransform.

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

* Add comparison operators to GradientTransform so we can easily tell when it has changed.

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

* Updated comments to be more Doxygen-friendly.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
Mike Balfour 3e9b76cdee
Image Gradient: Switch to shared_mutex (#6558)
* Improve lock contention by switching to a shared_lock.
ImageGradient is accessed via a many-reader-one-writer pattern, so a shared_lock causes less contention in the common "read" case.

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

* Remove chatty profile marker.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
Mike Balfour 39ba06b84e
misc small terrain bugfixes (#5834)
* Removed "chatty" profile markers.
These three markers were making terrain refreshes take ~200% longer in profile builds.

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

* Terrain surface data wasn't updating its AABB correctly.
The code was making an invalid assumption that changes to the world bounds would result in an invalid dirtyRegion.  It actually gets a valid region encapsulating the old and new bounds.  The fix is an additional check to see if the terrain bounds changed.

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

* Addressed previous PR feedback that terrainSystem ought to be a local variable in each test.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
Artur K f44169f7fa
Cleanup SerializeContext.h pt.1 (#4264)
* Remove AssetSerializer inclusion from SerializeContext header

Moved a few Reflect methods to new cpp files.

In addition, some preparations for further header dependency reductions.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Fix smoke test lua failures.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Windows build fixes.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Missing license headers

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Fix white-space issues.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Code review fix for AzToolsFramework/AssetEditor/AssetEditorBus.h

Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Fix inheritance list wrapping broken by older clang-format

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
4 years ago
Jeremy Ong df9b4d4a2f Deprecate profiler categories based on global enum
(to be supplanted by registered budgets in the future)

Signed-off-by: Jeremy Ong <jcong@amazon.com>
4 years ago
Esteban Papp 1f9b284de2 Merge branch 'development' into cmake/SPEC-7179
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

# Conflicts:
#	Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin_precompiled.h
#	Code/Editor/Plugins/EditorCommon/EditorCommon_precompiled.h
#	Code/Editor/Plugins/EditorCommon/stdafx.cpp
#	Code/Editor/Plugins/FFMPEGPlugin/FFMPEGPlugin_precompiled.h
#	Code/Editor/Plugins/PerforcePlugin/PerforcePlugin_precompiled.h
#	Code/Editor/Plugins/ProjectSettingsTool/ProjectSettingsTool_precompiled.h
#	Code/Framework/AzToolsFramework/AzToolsFramework/AzToolsFramework_precompiled.h
#	Code/Tools/AssetProcessor/native/precompiled.h
#	Code/Tools/Standalone/StandaloneTools_precompiled.h
#	Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer_precompiled.h
#	Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageProcessing_precompiled.h
#	Gems/Atom/RHI/DX12/Code/Source/RHI/Atom_RHI_DX12_precompiled.h
#	Gems/Atom/RHI/Metal/Code/Include/Platform/Mac/Atom_RHI_Metal_precompiled_Platform.h
#	Gems/Atom/RHI/Metal/Code/Include/Platform/iOS/Atom_RHI_Metal_precompiled_Platform.h
#	Gems/Atom/RHI/Metal/Code/Source/Atom_RHI_Metal_precompiled.h
#	Gems/Atom/RHI/Metal/Code/atom_rhi_metal_common_files.cmake
#	Gems/Atom/RHI/Null/Code/Source/Atom_RHI_Null_precompiled.h
#	Gems/Atom/RHI/Null/Code/atom_rhi_null_common_files.cmake
#	Gems/Atom/RHI/Vulkan/Code/Include/Platform/Android/Atom_RHI_Vulkan_precompiled_Platform.h
#	Gems/Atom/RHI/Vulkan/Code/Include/Platform/Linux/Atom_RHI_Vulkan_precompiled_Platform.h
#	Gems/Atom/RHI/Vulkan/Code/Include/Platform/Mac/Atom_RHI_Vulkan_precompiled_Platform.h
#	Gems/Atom/RHI/Vulkan/Code/Include/Platform/Windows/Atom_RHI_Vulkan_precompiled_Platform.h
#	Gems/Atom/RHI/Vulkan/Code/Source/Atom_RHI_Vulkan_precompiled.h
#	Gems/Atom/RHI/Vulkan/Code/Source/RHI/SwapChain.cpp
#	Gems/Atom/RHI/Vulkan/Code/atom_rhi_vulkan_common_files.cmake
#	Gems/AtomLyIntegration/AtomFont/Code/Include/AtomLyIntegration/AtomFont/AtomFont_precompiled.h
#	Gems/Blast/Code/Source/StdAfx.cpp
#	Gems/Camera/Code/Source/Camera_precompiled.h
#	Gems/EMotionFX/Code/Source/EMotionFX_precompiled.h
#	Gems/FastNoise/Code/Source/FastNoise_precompiled.h
#	Gems/Gestures/Code/Source/Gestures_precompiled.h
#	Gems/GradientSignal/Code/Source/GradientSignal_precompiled.h
#	Gems/GraphCanvas/Code/precompiled.h
#	Gems/ImGui/Code/Source/ImGui_precompiled.h
#	Gems/InAppPurchases/Code/Source/InAppPurchases_precompiled.h
#	Gems/LmbrCentral/Code/Source/LmbrCentral_precompiled.h
#	Gems/LmbrCentral/Code/Tests/ShapeGeometryUtilTest.cpp
#	Gems/LyShine/Code/Editor/UiCanvasEditor_precompiled.h
#	Gems/LyShine/Code/Source/Animation/LyShine_precompiled.h
#	Gems/LyShine/Code/Source/LyShine_precompiled.h
#	Gems/LyShineExamples/Code/Source/LyShineExamples_precompiled.h
#	Gems/Maestro/Code/Source/Cinematics/Maestro_precompiled.h
#	Gems/Maestro/Code/Source/Maestro_precompiled.h
#	Gems/MessagePopup/Code/Source/MessagePopup_precompiled.h
#	Gems/Metastream/Code/Source/Metastream_precompiled.h
#	Gems/Microphone/Code/Source/Microphone_precompiled.h
#	Gems/Multiplayer/Code/Source/Multiplayer_precompiled.h
#	Gems/PhysX/Code/NumericalMethods/Source/NumericalMethods_precompiled.h
#	Gems/PhysX/Code/Source/PhysXUnsupported_precompiled.h
#	Gems/PhysX/Code/Source/PhysX_precompiled.h
#	Gems/PhysX/Code/physx_unsupported_files.cmake
#	Gems/PhysXDebug/Code/Source/PhysXDebugUnsupported_precompiled.h
#	Gems/PhysXDebug/Code/Source/PhysXDebug_precompiled.h
#	Gems/ScriptCanvas/Code/Editor/precompiled.h
#	Gems/ScriptCanvas/Code/Source/precompiled.h
#	Gems/ScriptCanvasDeveloper/Code/Source/precompiled.h
#	Gems/ScriptCanvasPhysics/Code/Source/ScriptCanvasPhysics_precompiled.h
#	Gems/ScriptEvents/Code/Source/precompiled.h
#	Gems/ScriptEvents/Code/Tests/Editor/EditorTests.cpp
#	Gems/ScriptedEntityTweener/Code/Source/ScriptedEntityTweener_precompiled.h
#	Gems/SliceFavorites/Code/Source/SliceFavorites_precompiled.h
#	Gems/StartingPointCamera/Code/Source/StartingPointCamera_precompiled.h
#	Gems/StartingPointInput/Code/Source/StartingPointInput_precompiled.h
#	Gems/StartingPointMovement/Code/Source/StartingPointMovement_precompiled.h
#	Gems/SurfaceData/Code/Source/SurfaceData_precompiled.h
#	Gems/TextureAtlas/Code/Source/TextureAtlas_precompiled.h
#	Gems/TickBusOrderViewer/Code/Source/TickBusOrderViewer_precompiled.h
#	Gems/Twitch/Code/Source/Twitch_precompiled.h
#	Gems/VirtualGamepad/Code/Source/VirtualGamepad_precompiled.h
#	Gems/WhiteBox/Code/Source/WhiteBoxUnsupported_precompiled.h
#	Gems/WhiteBox/Code/Source/WhiteBox_precompiled.h
4 years ago
Steve Pham 38261d0800
Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
4 years ago
Esteban Papp 33a19b05bc GradientSignal
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
Steve Pham b4a2edec6a
Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
5 years ago
Steve Pham 70042fcdcd
O3DE Copyright Updates for Linux Foundation (#1504) 5 years ago
alexpete 1044dc3da1 Integrating github/staging through commit ab87ed9 5 years ago
alexpete a10351f38d Initial commit 5 years ago