Commit Graph

74 Commits (3d21a9f4bd7c6fac6499b9665702cb52d39d3eb6)

Author SHA1 Message Date
antonmic 3fd03479de Addressed PR feedback
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
antonmic 1f72001cdb Added two missing MeshDataInstance to ModelDataInstance renames in error message
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
antonmic dcbcab68d2 merging latest to resolve auto-merge conflict
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
antonmic dadf06edda Fixed issue where skin material wouldn't render if applied to a model with several submeshes and those submeshes had different material types applied to them.
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
dmcdiar fe005c9c50 Added exposure controls to the ReflectionProbe component
Signed-off-by: dmcdiar <dmcdiar@amazon.com>
4 years ago
Tommy Walton 256564a3e0
Model Hot-Reloading (#4304)
* Added a ModelReloader class that handles reloading the hierarchy of assets in the correct order. A ModelReloaderSystem that is used to make sure there is only one ModelReloader at a time for a given asset. Modified the Model, ModelLodAsset, and Buffer assets to not automatically reload, and instead handle reloads manually via AssetCatalog events. Modified the MeshLoader to kick off a reload via the ModelReloaderSystem whenever a model asset is added or changed.

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Comment updates

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Minor naming and comment updates based on PR feedback

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Correcting previous commit. I flipped == to != when switching from count to find, when it should have stayed ==

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Updating RenderCommon header

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Removing unneeded headers

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Reverting RayTracingFeatureProcessor change following Doug's guidance. This logic was tricky to get right initially, and leads to TDR when incorrect, so leaving as is.

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Removing a tab

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Added missing #include for AssetId

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Adding missing RTTI header

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Include ModelAsset definition intead of forward declaring it to avoid a static assert on Linux

Signed-off-by: amzn-tommy <waltont@amazon.com>
4 years ago
Ken Pruiksma 8791ae7ed7
Terrain feature processor improvements regarding material, mesh, and lod (#4303)
* Terrain feature processor improvements regarding material, mesh, and lod
- Now using a material with pbr lighting for terrain. Removed some of the old shader code that wasn't needed anymore
- Move heightmap image declaration to the material so it's not needed in the object SRG anymore
- Added prototype code (commented out) for smoothing the terrain with a b-spline weighting function
- Mesh data is all made with a proper mesh asset now.
- Added basic LOD support (no continuous LOD yet, but it does pop between lod levels)
- Moved RenderCommon to be accessible publicly. It contains stencil refs that should be public.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Fixing terrain's per object srg because of changes in the default per object srg.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* PR Fixes

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Removing unused static.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>
4 years ago
Mike Balfour 4b2dc9b3a4
Terrain System fixes (#4299)
* Remove the "TEST_SUPPORTED" traits.
Terrain unit tests should be usable on all platforms, so they shouldn't need a platform-specific trait to enable/disable.

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

* Fix a few misc terrain bugs.
* Change Activate/Deactivate to happen immediately instead of deferring.  There were too many order-of-operation bugs caused by trying to defer this.
* Added implementation for calculating normals.
* Fixed bug where GetHeightSynchronous wasn't stopping at the highest-priority layer.
* Added locks for SurfaceData bus to help ensure we lock our mutexes in the correct order and avoid deadlocks.

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

* Add trivial TerrainSystem tests.
Tests construction, Activate(), Deactivate(), and destruction.

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

* Unified Terrain system calls on single bus.

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

* Added mock for TerrainDataNotificationBus listener.
Also added unit tests to verify the listener, and added in missing notification events.

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

* Removed extra Sampler class.
Fixed up APIs to correctly pass Sampler and terrainExistsPtr around.

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

* Switched MockTerrainSystem to be proper gmock.
This makes it for flexible to use and easier to reuse from other test environments.

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

* Fix settings bug caused by bad order of operations that occurred when the methods moved to a different bus.

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

* Eliminate extra EBus by simplifying area initialization.
Previously, there was a back-and-forth ebus signal used for the terrain system to find any terrain spawners that were created prior to the terrain system activation.  Now it uses the more simple technique of just grabbing all the spawners that are currently hooked up to the spawner ebus.

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

* Switch to NiceMock so that "uninteresting" mock calls get ignored.

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

* Addressed PR feedback.
Filled in terrainExistsPtr at the end, and added it to GetNormal as well.

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

* Fixed shader height calculation.
It was off by half a pixel, and it was interpolating, both of which were wrong.

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

* Create initial LmbrCentral mocks that other Gems can use.
To help improve mock maintenance over time, this creates mocks in the same Gem as the systems being mocked, instead of the other Gems that need to use mocked systems during testing.  This way, the mocks should more easily stay in sync with the interface that they mock out.

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

* Null-guard any uses of Atom to make the class easier to unit test.

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

* Add more mocked terrain services

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

* Moved Terrain mocks to publicly-available Mocks directory.  Also added more unit tests.

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

* Change debug code to use EXACT instead of BILINEAR height sampling, because it's specifically using the terrain grid.

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

* Added support for the sampler filters.

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

* Fix bad merge.

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

* Add unit test to verify terrain layers define terrain regions.

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

* Moved the AABB component mock into a private terrain header, since it's a specialized mock just for the terrain tests.

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

* Moved sampler and normal calculations into TerrainSystem so that they can work across multiple adjacent areas.

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

* Missed a couple of unit test changes.

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

* Removed normal query as well, that needs a seprate unit test.

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

* Removed unused variable that was only caught in Linux/Android builds.

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

* Addressed PR feedback
Made the parameter names consistently listed in MockShapes.h.
Added comments to TerrainHeightGradientListComponent explaining why terrainExists is always true when a gradient exists.
Also fixed a bug where terrainExists should technically be *false* if no gradient exists.

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

* Added more descriptive comments and names for ClampPosition.

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

* Unit tests to verify height samplers work correctly.

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

* Fix bug where wireframe didn't refresh when the setting changed.

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

* Created TerrainWorldRenderer Component and moved all terrain rendering management code into it.

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

* Fixed the icon references

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

* Removed expensive profile marker.

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>

* Fixed AR error - constexpr doesn't need to be in a lambda capture.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
Scott Romero 8cbc5bc447
[development] Atom CPU profiler include cleanup (#4272)
- Removed all unnecessary includes to Atom CpuProfiler.h
 - Added includes to AzCore Profiler.h where necessary

Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com
4 years ago
dmcdiar df42377fc6 Minor changes to forward pass IBL specular
Signed-off-by: dmcdiar <dmcdiar@amazon.com>
4 years ago
dmcdiar db5fd91ac9 Merge branch 'development' into Atom/dmcdiar/ATOM-4126 4 years ago
dmcdiarmid-ly 16e806abff
Merge pull request #4200 from aws-lumberyard-dev/Atom/dmcdiar/ATOM-16437
Instance the ray tracing BLAS objects
4 years ago
Scott Romero 36bcf5849a
[development] Migrated Atom CPU profiler to utilize new AzCore Profiler interface and related macros (#4160)
- Added new interface type AZ::Debug::Profiler to externally register profiler systems
 - Modified the Atom CPU profiler to register as an AzCore profiler
 -- This allows full engine markers to be visualized in the associated ImGui tool
 - Converted all AZ_ATOM_PROFILE_* macros to use AZ_PROFILE_* macros instead

Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com
4 years ago
dmcdiar efce1033bc Instanced the RayTracingBLAS objects to enable re-use when the same model is added multiple times.
Signed-off-by: dmcdiar <dmcdiar@amazon.com>
4 years ago
dmcdiar b737e9f80e Merge branch 'development' into Atom/dmcdiar/ATOM-4126 4 years ago
dmcdiar 880f4d96cc Changed the ReflectionProbe component to use an OBB
Signed-off-by: dmcdiar <dmcdiar@amazon.com>
4 years ago
Mike Balfour 0505f200e5
Remove extra/bad profile markers (#4031)
Many of these are just extra noise in the profile, but the one in Archive.cpp could also cause PIX to crash.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
dmcdiar fd007548e0 MeshFeatureProcessor::SetVisible now adds or removes the mesh from the raytracing scene as appropriate.
Signed-off-by: dmcdiar <dmcdiar@amazon.com>
4 years ago
Kyle Birnbaum 2b1f4c2fc0
Merge branch 'development' into ExposeLodControls 4 years ago
Kyle B b53a085700 Merge branch 'development' into ExposeLodControls 4 years ago
Kyle B e410eecd93 fixed mesh feature processor abstract interface
Signed-off-by: Kyle B <kylebirnbaum@gmail.com>
4 years ago
Esteban Papp f8e99cd7dd Merge branch 'development' into cmake/SPEC-2513_w4244
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

# Conflicts:
#	Code/Editor/CryEditDoc.cpp
#	Code/Framework/AzToolsFramework/AzToolsFramework/Input/QtEventToAzInputManager.cpp
#	Gems/Atom/Feature/Common/Code/Source/PostProcessing/BlendColorGradingLutsPass.cpp
#	Gems/PhysXDebug/Code/Source/SystemComponent.cpp
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
pappeste 38fd7f0013 fixing Atom
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
Kyle B 6acbea722e minor syntax changes and adding a refresh tree attributeto the editor component
Signed-off-by: Kyle B <kylebirnbaum@gmail.com>
4 years ago
Kyle B 0c05c9f204 [not working] Made lod selection more generic for further work
Signed-off-by: Kyle B <kylebirnbaum@gmail.com>
4 years ago
Kyle B 51271fa15b Created group for Lod component data
Signed-off-by: Kyle B <kylebirnbaum@gmail.com>
4 years ago
Kyle B 9c5c2e7de6 un-did const on function that did not need it
Signed-off-by: Kyle B <kylebirnbaum@gmail.com>
4 years ago
Kyle B 3db93a564d Made formatting changes per pull comments, incuding adding comments, changing spacing, and changing the ui type of component fields
Signed-off-by: Kyle B <kylebirnbaum@gmail.com>
4 years ago
Kyle B 1a48118ece Added comments and formatted as close to the original
Signed-off-by: Kyle B <kylebirnbaum@gmail.com>
4 years ago
Kyle B 5b88d96eec Exposed fields to the mesh component giving greater Lod control from the editor
Signed-off-by: Kyle B <kylebirnbaum@gmail.com>
4 years ago
Chris Santora 66f7fa2f42 Fixed a bug where a new entity using a mesh that was already loaded would not be able to correctly initialize a material component.
Repro steps:
- Create two entities.
- Entity 1
  - Add a mesh component and assign a model with multiple sub-meshes
  - Add a material component. The material component looks correct.
- Entity 2
  - Add a mesh component and assign the same model as the other entity
  - Add a material component. The material component shows "<unknown>" for all material slot names

The problem was that ReflectedPropertyEditor creates a new Asset<> reference with the correct ID but does not load it. This asset is passed to EditorMaterialComponent, MaterialComponentController, and MeshFeatureProcessor and none of these tell the Asset to load. The MeshFeatureProcessor was not loading the Asset or connecting to the AssetBus because the instance already existed in the InstanceDatabse so from the FP's perspecive there was no need. But for the FP's GetModelAsset() API to function correctly it needs to have the asset initialized to the available AssetData pointer. So we updated the MeshFeatureProcessor to always connect to the AssetBus so it will find the available AssetData via the OnAssetReady callback.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Santora 14d2e38b90 Refactored how model material slots work in preparation to support more flexible material conversion options for the scene asset pipeline. The material slot IDs are based on the MaterialUid that come from SceneAPI. Since these IDs are also used as the AssetId sub-ID for the converted material assets, the system was just checking the material asset sub-ID to determine the material slot ID. But in order to support certain FBX material conversion options, we needed to break this tie, so the slot ID is separate from the AssetId of the material in that slot. This will allow some other material to be used in the slot, instead of being forced to use one that was generated from the FBX.
Here we inttroduce a new struct ModelMaterialSlot which formalizes the concept of material slot, with an ID, display name, and default material assignment. The ID still comes from the MaterialUid like before. The display name is built-in, rather than being parsed out from the asset file name. And the default material assignment can be any material asset, it doesn't have to come from the FBX (or other scene file).

This commit is just the preliminary set of changes. Cursory testing shows that it works pretty well but more testing is needed (and likely some fixes) before merging.

Here is what's left to do...
Add serialization version converters to preserve prior prefab data.
See if we can get rid of GetLabelByAssetId function only rely on the display name inside ModelMaterialSlot.
I'm not sure if the condition for enabling the "Edit Material Instance..." context menu item is correct.
Test actors
Lots more testing in general

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
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
Chris Galvan d7574777a8 Resolved merge conflicts
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
5 years ago
amzn-sean aff4859251 short term fix for editor/game mode/launcher tick times consistency (#1720)
Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com>
5 years ago
amzn-sean a02ecefab9
short term fix for editor/game mode/launcher tick times consistency (#1720)
Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com>
5 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
Gene Walters 4e14c0069b Merge branch 'upstream/stabilization/2106' into genewalt/gitflow_210628 5 years ago
Tommy Walton 5656736db4
Fix for LYN-3726 : Actor Draw Character Doesn't Work (#1336)
-Re-purposed an unused boolean in RPI::Cullable for previous frame's visiblity to instead represent objects that are hidden in the simulation.
-Updated MeshFeatureProcessor::SetVisible to set this value on the cullable.
-Updated the MeshComponent to handle visiblity changes by not rendering the mesh instead of deactivating and/or reactivating the component.
-Updated the AtomActorInstance to handle changes to the visibility from the ActorComponent.

Tested by creating two entities with static mesh components, on entity hidden and the other visible. Plus three entities with actor components, one where the actor is visible, one where the entity is visible but the 'render character' setting on the actor component is disabled, and one where the 'render character' setting is enabled, but the entity is not visible.

For each of these 5 entities, I added them as 5 loose entities, 5 entities that were children to a parent entity, and a slice with all 5 as children to a parent entity, and tested toggling visibility of the parent entities.

For each of these 3 sets of 5 entities, I added them directly to the level, added them all to a layer where the layer was visible, and added them all to a layer where the layer was not visible, and tested toggling the visibility of the layers.
5 years ago
Doug McDiarmid ec511dce76 Fixed ray tracing tangent stream format. 5 years ago
Doug McDiarmid 55e5dfc059 Merge branch 'stabilization/2106' into Atom/dmcdiar/LYN-4660 5 years ago
Steve Pham 70042fcdcd
O3DE Copyright Updates for Linux Foundation (#1504) 5 years ago
Doug McDiarmid c3c69fedd6 Changed the Tangent and BItangent streams to be optional when setting up ray tracing data for a mesh. 5 years ago
Doug McDiarmid 0581de25b3 Merge branch 'stabilization/2106' into Atom/dmcdiar/LYN-4660 5 years ago
Ken Pruiksma 570696ad76
[ATOM-14344][ATOM-13908] Merging skinned and static mesh motion shaders using an optional vertex stream (#1491)
[ATOM-14344][ATOM-13908] Merging skinned and static mesh motion shaders using an optional vertext stream. This removes the log spam "Mesh does not have all the required input streams. Missing 'POSITIONT0'." and allows Material::GetShaderCollection() to be const only as it was intended. The MeshFeatureProcessor also no longer needs to decide which motion vector shader to use, and therefore no longer has m_skinnedMeshWithMotion in the descriptor to acquire a mesh.
5 years ago
Tommy Walton be0fbaaddc
LYN-2227 : Improve mesh initialization performance by not creating draw packet more than once (#1476)
* Move SetUseForwardPassIblSpecular to happen when acquiring a mesh, instead of immediately after so that we don't build the drawpacket twice for every mesh

* Update the MeshFeatureProcessor to use the booleans from the descriptor directly instead of having loose booleans in the MeshDataInstance

* m_excludeFromReflectionCubeMaps is not (and does not need to be) part of the descriptor, since setting is cheap and doesn't duplicate work that is done when acquiring the mesh
5 years ago
Doug McDiarmid 4378f1f88c Skipped meshes that do not have the required streams when adding to the RayTracingFeatureProcessor. 5 years ago
Doug McDiarmid 72e5ab4437 Merge branch 'development' into Atom/dmcdiar/ATOM-5702 5 years ago
Doug McDiarmid dc1d34c83f NoMSAA supervariant support
Added a ShaderSystem supervariant to provide a system-wide supervariant name.
Changed ShaderAsset to append the system-wide supervariant name when searching for supervariants.
Added the NoMSAA supervariant to several shaders.
5 years ago