Commit Graph

45 Commits (c07b666bec23b8dfb6db08d0decfb31f1c358b01)

Author SHA1 Message Date
antonmic 3fd03479de Addressed PR feedback
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
Steve Pham fa0f2a1007
Fix unused warnings release (#3677)
* Release build fix for Windows
* Release build fix for Android
* Release build fix for Windows
* Release build fix for Android
* Release build fix for Linux
* Release build fix for Mac
* Release build fix for iOS

Signed-off-by: Steve Pham <spham@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
pappeste 33cbc2db21 AtomLyIntegration
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
Chris Burel 1837d05169 Rename EMotionFX class members to follow the `m_` naming convention
Signed-off-by: Chris Burel <burelc@amazon.com>
4 years ago
Chris Burel 2cfee517a0 Adjust EMotionFXAtom to work with the new EMotionFX size_t API
Signed-off-by: Chris Burel <burelc@amazon.com>
4 years ago
Benjamin Jillich 868d718a18
Added automatic bounding box expansion, fixed several bugs in the aabb calculations and removed node OBBs (#2871)
Merge pull request #2871 from aws-lumberyard-dev/jillich/EmfxAabbImprovements
4 years ago
Kyle B 51271fa15b Created group for Lod component data
Signed-off-by: Kyle B <kylebirnbaum@gmail.com>
4 years ago
Benjamin Jillich 8a47476498 Merge branch 'development' into jillich/EmfxAabbImprovements 4 years ago
Esteban Papp b33a4db332 Merge branch 'development' into cmake/SPEC-2513_w4267 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
Benjamin Jillich b840b24de2 Ported the actor and a few other places
* Fixed a bug with updating the static aabb for actors. It called that before the mesh was loaded resulting in an invalid aabb.
* Ported a few more places to AZ::Aabb from MCore::AABB

Signed-off-by: Benjamin Jillich <jillich@amazon.com>
4 years ago
santorac b407e501e3 Merge branch 'development' into Atom/santorac/OptionalSceneApiMaterialConversion 4 years ago
Chris Santora fec79a7d53 Moved the material slot list from ModelLodAsset to ModelAsset, so all the slots live in one main list. This removes data duplication between LODs and cleans up the code a bit.
I had to update the ModelLod class to take in both the ModelLodAsset and ModelAsset for initialization so it can fetch the slots for each mesh.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Santora 3daf3f7d7a Fixed an issue with Actors where the material slot IDs were incorrect, and caused the displayed slot labels to be all "<unknown>" (and likely other issues).
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
Guthrie Adams ffbeb903c1 Material Component: Add functions to lookup material ids by name
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
pappeste eb2da69e6e AtomLyIntegration
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@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
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
Steve Pham 70042fcdcd
O3DE Copyright Updates for Linux Foundation (#1504) 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
yuriy0 704c127e34
If there are too many wrinkle masks, discard the lowest weight ones (#988)
Since the shader supports a fixed maximum number of active wrinkle masks, if the number of active wrinkle masks is larger than that, it will crash where wrinkleMaskObjectSrg->SetImageArray is called with an array_view which is larger than the target image array.

We need a sensible method of truncating the number of masks. One such method is to discard the lowest weight masks.
5 years ago
nvsickle e55580af57 Merge remote-tracking branch 'upstream/stabilization/2106' into nvsickle/MergeStabilizationJun18 5 years ago
Aaron Ruiz Mora 7781307afe
Fixed cloth automated tests. (#1400)
Bone transforms buffer is not valid when using Null renderer, which caused the test to fail since it reported an error and ultimately crashing as well. For now it's been worked around by checking the pointer is valid and not printing the error when null renderer is used, a task for the Atom team has been created to fix this properly in the future (ATOM-15807).
5 years ago
AMZN-mnaumov c0dc0cb936
Merge pull request #1337 from aws-lumberyard-dev/mnaumov/StabilizationJun15
Stabilization to Development merge - 06/15/21
5 years ago
yuriy0 a9c55c1070
Update actor render bounding box (#991)
* Extend MeshFeatureProcessor to allow changing the mesh bbox, which requires re-compute the culling data for that mesh

* Update actor mesh bbox when EMFX actor instance bbox changes.

Also use the actor instance global bbox to compute the local bbox for the skinned render mesh, instead of the using the static bounds based bbox, as not every actor instance is going to be using the static bounds bbox.

* Store per-instance mesh AABB in the right place.

In the MeshInstanceData, which is unique per instance, instead of in the Model, which is shared between all instances.

For greater clarity, also remove Model::m_aabb and the corresponding getter and setter, as it isn't immediately obvious whether this gets the model asset bbox or the mesh instance bbox. Callers should instead be explicit about which bbox they want.

* Bug fix: model asset is not necessarily ready in AcquireMesh

* Remove now-unused forward declaration

* Update MockMeshFeatureProcessor with SetLocalAabb/GetLocalAabb
5 years ago
Roman 1f6bb14ed3
[EMFX][ATOM] crash during mesh reload (#1301)
* Fixed a crash when entering game mode, removing a mesh and re-adding mesh.
5 years ago
Benjamin Jillich 863aac2cb9
[LYN-3727] Actor Draw Bounds Draw Bounds & [LYN-3725] Actor Draw Skeleton Doesn't Draw Skeleton (#1168)
* [LYN-3727] Actor Draw Bounds Draw Bounds & [LYN-3725] Actor Draw Skeleton Doesn't Draw Skeleton

* Added skeleton, aabb and emfx debug drawing to the actor component.
* Aux geom rendering is flickering as also reported in the Discord channels. Trick with using the scene notification bus did not work as the actor instance is not bound to a given scene as far as I am aware.
5 years ago
Tommy Walton ded39be57e
Merging WrinkleMask support from 1.0 to main (#680)
Added a loop to the skin shader that will sample from wrinkle masks, multiply them by a weight, combine them, and use them instead of vertex colors for wrinkle map blending

Added an array of masks, an array of weights, and a wrinkle mask count to the DefaultObjectSrg. -Will create a follow up task to handle this a better way.

Removed motion vector (for now) from skin.materialtype since we're not using them, and removed depthtransparent since skin doesn't support transparency

Added an interface to the MeshFeatureProcessor to get the object srg

Wrapped srg->Compile in if(srg->IsQueuedForCompile()) to prevent compiling twice --This doesn't stop a race condition if both happen at the same time, but that is at least far less likely. It will need a better solution later.

Added a function to the MorphTargetExporter that will check to see if a texture that matches the blend shape name exists in a particular folder, and adds a reference to that image to the MorphTargetMetaAsset --Only supports .tif, and doesn't automatically re-process the .fbx if the folder is updated. These can be improved in later iterations

Added a null check in MaterialTypeSourceData.cpp to fix a crash I ran into

Added a for loop in two places to look for the first submesh that has a morph target, instead of just using the first to check if a lod has morph targets or not. --I have a better fix for this, but it involves more areas of the code, so I'm saving that for another change.

Modified AtomActorInstance to look for any morph targets that have a wrinkle mask reference

Then each frame, for any morph targets with non-zero weights that also have wrinkle masks, it updates the mask array, weights, and count on the object srg.
5 years ago
karlberg 822368ef01 Changes to get visibility system working again in-game 5 years ago
Aaron Ruiz Mora 5fd8c35878
Fixing cloth working with Actors by reading directly from ModelAsset instead from EMFX Mesh. (#235)
- Fixing cloth working with Actors by reading directly from ModelAsset instead from EMFX Mesh.
- Actor caches map from joint indices in skin metadata to skeleton indices so they can be query later.
- Actor cloth skinning reads indices and weights from Model Asset instead from EMFX Mesh.
- Actor cloth skinning with unlimited skinning bones.
- Sort out cloth unit tests by disabling them until there is a way to create an Atom mesh
- Addressing feedback.
5 years ago
Benjamin Jillich 0fa00a117c
[ATOM-14477] Add clone function to model and/or model asset (#135)
* Added clone methods for the buffer, model lod and model assets.
* Cloning works via the creators.
* Mesh handle/instance now knows about the model asset it originated from as well as the cloned model asset that we need for instancing until instancing works without the dependencies to the asset ids.
* MeshComponentRequestBus returns the original asset id and the model asset. If you need access to the clone, go by the model.
* Cloth component mesh now gettings its model asset from the model as it needs to work on the clone.
* Moved the requires cloning function from the mesh loader in the mesh feature processor to the mesh component controller.
* As we need the model asset to be loaded before we can check if it requires cloning or not, we couldn't pass in a bool from the controller but had to use a callback.
* Using asset hint instead of asset id for the model lod asset creator error.
* Storing a map of source buffer asset ids and the actual cloned buffer assets rather than just their ids.
* Using the buffer assets from the new map directly and removed the search process in the mesh loop where the asset views are created.
* Fixed the vegetation mocks.
* Using the actor's mesh asset when emitting the on model ready event for the mesh component notification bus.
* Mesh components notifications connection policy changed to adapt to cloned model asset.
* Handling empty meshes in model lod asset creator.
* Removed the requires cloning callback from the mesh feature processor and made it a parameter to the acquire mesh function
* Fixing mocks and unit tests
5 years ago
moraaar 808fd1d3ba Cloth works with Actors in Atom. Cloth system uses MeshAssetHelper to read model mesh information for actors too. 5 years ago
alexpete 8469c9ca0a Integrating github/staging through commit 5f214be 5 years ago
alexpete 1044dc3da1 Integrating github/staging through commit ab87ed9 5 years ago
alexpete c2cbd430fe Integrating up through commit 90f050496 5 years ago
alexpete 75dc720198 Integrating latest 47acbe8 5 years ago
alexpete a10351f38d Initial commit 5 years ago