Simplified the call back for MaterialTypeSourceData::EnumeratePropertyGroups while also providing more data.
Made the Material Inspector join nested property group display names to be like "Layer 1 | Base Color", since the leaf property groups are shown as a flat list in the inspector.
Fixed CreateMaterialAssetFromSourceData to include the imported json files in the list of sourceDependencies. This triggers the Material Editor to hot-reload when one of these json files changes.
Updated a few places that were still assuming only one level of property group.
Updated EditorMaterialComponentInspector to apply the per-property-group material functors, before it was still only applying the top-level onces.
Moved some accessor function implementations to the cpp files, per feedback on another already-merged PR.
Testing:
Made changes to MinimalMultilayerPbr (in AtomSampleViewer) to use nested property groups, and saw the correct behavior in the Material Editor's property inspector.
Used MaterialComponent's property inspector to edit a StandardPbr material instance. Confrimed that functors were correctly controlling property visibility by enabling and disabling things like emissive and clear coat.
Used MaterialComponent's property inspector to edit a MinimalMultilayerPbr material instance. Saw all the expected groups and properties show up. Confirmed that per-group functors were correctly controlling property visibility.
Used MaterialComponent's property inspector to export a material instance and confirmed the .material file included the expected properties.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
There were conflicts in MaterialDocument.cpp which I had resolve by just taking development. This will not compile. I will make additional fixes in another commit.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
This is needed to support deeply nested material property groups, it just makes the serialization code a lot simpler than trying to support nested groups in the .material file. It also makes the file more readable and easier to search all files for particular properties.
I also updated MaterialSourceData to hide the property values behind a clean API.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
* Added support for hardware queue class on passes. Compute pass data and copy pass data can now specify to run on their appropriate queue.
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
* addressed PR feedaback
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
* fixing python test failures on AR
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
* Changes to AttachmentImage related classes to have better support using render target as texture.
- Updated AttachmentImageAsset to support an unique name which can be used as AttachmentId.
- Functions in ImageSystemInterface to find an AttachmentImage by its unique name.
- Added InsertChild function to ParentPass class so it can insert a child pass at any location.
- Change to ImageAttachmentPreviewPass so it can preview cached pass attachment even the source pass was disabled.
Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com>
This wrapper used to be needed in order to bind the custom JsonMaterialPropertyValueSerializer back when property values were represented by AZStd::any. Now that property values have a custom MaterialPropertyValue type, the wrapper class is no longer needed.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
* PipelineLibrary (PSO Caching) support for Metal
- API changes to handle Metal drivers implictly doing save/load of PipelineLibrary data
- Fixed up code related to Metal device selection
- PipelineLibrary support for Mac and ios
Signed-off-by: moudgils <moudgils@amazon.com>
* Fix compile errors for Dx12, Vulkan backend + Unit tests
Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>
* Fixed errors related to M1 GPU
Signed-off-by: moudgils <moudgils@amazon.com>
* Fix a minor 'tab' validation issue
Signed-off-by: moudgils <moudgils@amazon.com>
* Addressed feedback
Signed-off-by: moudgils <moudgils@amazon.com>
* Minor feedback
Signed-off-by: moudgils <moudgils@amazon.com>
* Added a few asserts
Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>
* Fix a typo
Signed-off-by: moudgils <moudgils@amazon.com>
Shaders can now specify a top-level field "Definitions" which
accepts an array of string values. Each string will be appended
to the set of preprocessor definitions defined globally and forwarded
to the MCPP preprocessor on shader build. The shader-reload soak test
was modified to accept a new shader to test this feature in the ASV.
Signed-off-by: Jeremy Ong <jcong@amazon.com>
Fixed the MaterialBuilder to report source dependencies on imported JSON files, so the material type will rebuild when you edit an imported file that contains shared property data.
Fixed a spot in LuaMaterialFunctorSourceData where it was only applying the old "prefix" feature and not the new name context.
Updated a couple built-in material functors to take advantage of the name context (they were using RuntimeContext::GetShaderResourceGroupLayout instead of the RuntimeContext::FindShaderInputConstantIndex wrapper utility function).
Fixed an issue with EnumeratePropertyGroups where it wasn't passing the right name context, so Material Editor wasn't able to load some material types.
Reordered the parameters in the MaterialTypeSourceData enumerate callback functions, I felt this order was more natural.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
The main addition here is the MaterialNameContext class which represents the concept of a namespace for properties, shader options, and SRG fields. This concept was already somewhat supported in LuaMaterialFunctor through bespoke "prefix" fields, but I have generalized it be available for all material functors. Note that I have not yet updated the other material functor types to ensure they take advantage of this feature, that will be in another commit.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
Added new utility functions for easily creating the value set for a ShaderOptionDescriptor.
Made ShaderOptionDescriptor default value optional, picking the first available value as the default ... by default.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
I also noticed that JsonFileLoadContext was no longer used (see https://github.com/o3de/o3de/pull/7010) so I was able to remove all that code.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
Function Culling.cpp::ProcessWorklist has couple variable which are unsused when compiling profile causing
a -Werror compile error. Fixes is to move variables and code increment them under debugging ifdef.
Signed-off-by: Jackerty <contact.jackerty@gmail.com>
Made PropertyDefinition::m_name private.
Moved code around for a cleaner diff in MaterialTypeSourceData.h.
Added API comments.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
* Updated all array_view uses with the C++20 span.
The updates were done in the following order
1. `AZStd::array_view<([^>].+)\* ?>` -> `AZStd::span<\1 const>`
2. `AZStd::array_view<(?:const )(.+)>` -> `AZStd::span<const \1>`
3. `AZStd::array_view` -> `AZStd::span`
Removed the implementation of array_view.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Added missing whitespace between `const` and the typename for spans.
Updated the ShaderTest comparison of the ShaderResourceGroupLayout span
to compare the sizes as well
Updated comments on some of the methods that stated that they return "an
array" to mention they return "a span".
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
I removed support for property rename version updates in MaterialTypeSourceData (i.e. ApplyPropertyRenames) because MaterialSourceData serialization no longer loads material property definitions from the .materialtype file, per a recent change on the development branch. The unit tests were broken and it wasn't worth updating them since we don't need this functionality anymore. Material property renames and other version updates are now exclusively applied by the MaterialAsset class.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>