Commit Graph

5343 Commits

Author SHA1 Message Date
santorac 9e6eadd9a9 Merge branch 'development' into Atom/santorac/OptionalSceneApiMaterialConversion 2021-08-02 09:07:42 -07:00
Jeremy Ong 9b0db508c9 Merge pull request #2554 from aws-lumberyard-dev/Atom/IndexedDataVector
Promote IndexedDataVector to public Feature/Utils header
2021-08-02 07:52:34 -06:00
Steve Pham b46a80be2c Fix for Linux/Vulkan/Editor crash on startup
* Temporary fix for Linux/Vulkan/XCB where the swap chain is not ready to present until the resize is complete
* Fix invalid GUID from LinuxXcbConnectionManager

Signed-off-by: spham-amzn <spham@amazon.com>
2021-07-31 08:42:02 -07:00
Jeremy Ong 68a7a21e62 Reintroduce .h and .inl split
Signed-off-by: Jeremy Ong <jcong@amazon.com>
2021-07-31 00:26:28 -06:00
Jeremy Ong 78760245c5 Remove one level of indentation
Signed-off-by: Jeremy Ong <jcong@amazon.com>
2021-07-31 00:26:26 -06:00
Jeremy Ong e1ce742f14 Generalize comments pertaining to light data and consolidate inline
header

Signed-off-by: Jeremy Ong <jcong@amazon.com>
2021-07-31 00:26:25 -06:00
Jeremy Ong bb782e83b4 Promote IndexedDataVector to public Feature/Utils header
Signed-off-by: Jeremy Ong <jcong@amazon.com>
2021-07-31 00:26:23 -06:00
santorac 5d3d3b907e Changed a couple function parameters to const&
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 16:52:43 -07:00
lumberyard-employee-dm bb372f05cd Fixed the emplace function implementations for stack and queue (#2657)
* Fixed the emplace function implementations for stack and queue

Cleaned up several functions in the stack, queue and priority_queue
classes that were non-standard or weren't needed.

Updated the "style" of the code to use more modern concepts: "typedef" ->
"using", empty constructor body -> default keyword.

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

* Replaced the custom implementations of AZStd stack, (proirity)queue

Theses classes now have a template alias to the standard library version
of the classes

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
2021-07-30 18:20:21 -05:00
Guthrie Adams e2eba69d33 updating FindMaterialAssignmentIdInLod to use ModelMaterialSlot
}

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
2021-07-30 18:19:35 -05:00
santorac b407e501e3 Merge branch 'development' into Atom/santorac/OptionalSceneApiMaterialConversion 2021-07-30 14:54:14 -07:00
AMZN-koppersr 0318419932 Merge pull request #2656 from nemerle/versioned_property_redundant_ref
AZStd::ref prevented compiler from using RVO
2021-07-30 14:27:20 -07:00
SergeyAMZN 461743ef2d Enabled PhysX system component in asset builders since it's required … (#2652)
* Enabled PhysX system component in asset builders since it's required for cooking collision meshes

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

* Added AssetCatalogService to the list of dependent

Signed-off-by: pereslav <pereslav@amazon.com>
2021-07-30 16:14:49 -05:00
Guthrie Adams acdad52032 Merge pull request #2638 from aws-lumberyard-dev/Atom/guthadam/material_component_find_assignmentid
Material Component: Add functions to lookup material ids by name
2021-07-30 15:39:27 -05:00
carlitosan 6a35782773 Merge pull request #2660 from aws-lumberyard-dev/carlitosan/development
Carlitosan/development  Fix variable name display in the property window
2021-07-30 13:20:57 -07:00
Chris Santora 13679a7cc3 Reverted partial support for property overrides on default material assignments. This needs more UI design discussion first.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:41:15 -07:00
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>
2021-07-30 11:41:14 -07:00
Chris Santora 1a478608a7 Restored the previous behavior of preventing material property overrides when there is no explicit material override assignment.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:41:12 -07:00
Chris Santora b19a895889 Reverted accidentally commented out code.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:41:10 -07:00
Chris Santora 6fa891848d Factored out redundant call to GetMaterialSlots().
Removed code that was intended to handle duplicate default material assignments, but duplicacate default material assignments aren't possible yet.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:41:09 -07:00
Chris Santora 21d5baa184 Fixed an issue where I had changed prior functionality by mistake, preventing exported materials from replacing material assignments.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:41:07 -07:00
Chris Santora abec7a4f5b Fixed an issue where a default material should show up as a filled-in value in the UI even though it should appear as empty, indicating the default is being used.
Also, I'm going back on what I said in my last commit, and removing the converter for version 3 in EditorMaterialComponent::ConvertVersion. The code that I had put in before wouldn't work because it was relying on the new m_defaultMaterialAsset which will be empty for old data. The only way we could support version conversion is if we preserve legacy versions of multiple types like EditorMaterialComponentSlot and MaterialAssignmentId. Since this serialization version is old and pre-dates the public release of O3DE, it's unlikely that we need to continue supporting this version so isn't worth maintaining.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:41:06 -07:00
Chris Santora 75b4d62dcb Restored the version converter EditorMaterialComponent::ConvertVersion for version 3, which wasn't possible with an earlier version of my changes.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:41:04 -07:00
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>
2021-07-30 11:41:02 -07:00
Chris Santora a71ee7eb3a Fixed the MaterialAssignmentId version converter to properly handle the default material assignment slot.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:41:01 -07:00
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>
2021-07-30 11:40:59 -07:00
Chris Santora 28671c8546 Addressed suggestions from gadams3 to make EditorMaterialComponent get the default material assets from its own data rather than fetching them from the asset. Presumably this should give more reliable behavior.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:40:57 -07:00
Chris Santora e145ce1d01 Updated EditorMaterialComponentSlot to support editing property overrides and UV overrides for the material, regardless of whether there is a material override or not.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:40:56 -07:00
Chris Santora 670dd6c5bc Removed the GetLabelByAssetId function since now we can use the display name that comes with the ModelMaterialSlot.
Updated OpenMaterialExporter() to account for the fact that multiple material slots can have the same default material asset.
Updated the material inspector to sort material slots by name to match the order in the Material Component.
Updated ExportItem to protect its data members, which makes it more clear that assetId and materialSlotName are readonly inputs.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:40:54 -07:00
Chris Santora e3ceaa477e Added a version converter for MaterialAssignmentId. This allowed me to successfully load the Sponza level in AtomTest.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:40:53 -07:00
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>
2021-07-30 11:40:51 -07:00
Chris Santora 0cf6ecf3f7 Deleted unused "default" materials from RPI. Long ago these were used as defaults for FBX material conversion process, but that's no longer the case. And I'm about to add a new approach for default material conversion in SceneAPI.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
2021-07-30 11:40:49 -07:00
chcurran 1b1fb26886 Merge branch 'development' of https://github.com/o3de/o3de into carlitosan/development 2021-07-30 11:37:54 -07:00
chcurran 893a80a54e Fix variables names in the property window
Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
2021-07-30 11:37:40 -07:00
carlitosan edfac0f7f0 Merge pull request #2655 from aws-lumberyard-dev/carlitosan/development
display unused variables in the editor; bump builder version for rece…
2021-07-30 11:35:54 -07:00
nemerle e52606da69 AZStd::ref prevented compiler from using RVO
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
2021-07-30 19:31:43 +02:00
chcurran 3633bf2ed0 remove accidental submission of commented out event handling
Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
2021-07-30 10:07:23 -07:00
chcurran 0313b16a85 display unused variables in the editor; bump builder version for recent change to EntityId nodes
Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
2021-07-30 09:50:54 -07:00
Guthrie Adams 28096d1620 Merge pull request #2636 from aws-lumberyard-dev/jhlliar/addMoreInstrumentation
[ATOM-15976] Add more instrumentation
2021-07-30 11:25:17 -05:00
Guthrie Adams dae45f0fac Merge pull request #2403 from aws-lumberyard-dev/jhlliar/implementFunctionStatisticsWindow
[ATOM-15689] Add function statistics view to CPU Profiler
2021-07-30 11:23:20 -05:00
Guthrie Adams e087cd87fb removed extra space from namespace comment
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
2021-07-30 10:49:41 -05:00
Benjamin Jillich 48d1e20169 Removed the MCore::Quaternion class #2600
Merge pull request #2600 from aws-lumberyard-dev/jillich/RemovedMCoreQuaternion
2021-07-30 00:07:40 -07:00
Guthrie Adams ffbeb903c1 Material Component: Add functions to lookup material ids by name
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
2021-07-29 18:09:40 -05:00
Jacob Hilliard 4d618ea619 Profiling: Add more instrumentation
Adds new instrumentation macros throughout the codebase, using the
visualizer to find where current instrumentation is lacking using the
shadowed sponza sample + editor. Some notes from exploring:

- We spend ~5ms in CullingScene: BeginCulling
- PipelineStateCache: Compact usually 1ms
- CompileImageBarriers takes most of the time in CompileResourceBarriers

Signed-off-by: Jacob Hilliard <jhlliar@amazon.com>
2021-07-29 16:04:54 -07:00
Guthrie Adams b19b0a0e0d Merge pull request #2627 from aws-lumberyard-dev/Atom/guthadam/fixing_material_property_override_lua_test_script
fixing material property override lua test script
2021-07-29 17:11:06 -05:00
Nicholas Van Sickle 70b3840288 Fix the home key popping up ImGui when it shouldn't. (#2620)
This disables WM_INPUT forwarding to the input system while in game mode and makes ImGui listen to the synthetic keyboard events from the viewport instead - these synthetic events go through Qt's event system, so will only show up when the viewport "sees" a home key press.

Signed-off-by: nvsickle <nvsickle@amazon.com>
2021-07-29 16:30:45 -05:00
Guthrie Adams b357cd0000 Merge pull request #2605 from aws-lumberyard-dev/Atom/guthadam/updating_atomtoolsappication_comments_and_formatting
AtomToolsApplication minor comments/formatting
2021-07-29 15:23:53 -05:00
Guthrie Adams 1c9e2fd74c Merge pull request #2604 from aws-lumberyard-dev/Atom/guthadam/add_missing_bindings_for_display_mapper_operation_type
Add missing display mapper operation type bindings
2021-07-29 15:23:14 -05:00
Guthrie Adams ca2889a0ef fixing material property override lua test script
O3DE vector usage in lua has changed since script was written

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
2021-07-29 15:17:58 -05:00
amzn-phist 99f7085c05 Fixes resource selectors not showing (#2621)
These statics were getting dead-stripped by the compiler, so removed
some of the macro magic and just do direct registration instead.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
2021-07-29 14:56:13 -05:00