You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Gems/Atom/Feature/Common/Code/Source
Chris Santora 36abde95a9 Added a new registry setting that disables automatic conversion of materials from model files like FBX.
By default, processing of model files (like FBX) automatically convert the included materials to Atom materials, using StandardPBR. This adds a job dependency on StandardPBR.materialtype, which propagates to any related azsl files as well. Thus any change to azsl code will cause all model files in the project to rebuild.

Some game teams have no interest in using the auto-converted materials; they always use a Material Component to apply material overrides for every mesh. This new setting allows teams to disable material auto-conversion for the entire project, thus removing the job dependency on StandardPBR.materialtype. Instead, every mesh will be assigned the same default material. Any change to azsl code will cause that one default material to rebuild, but this will not trigger any models to rebuild.

Details:
- Added /O3DE/SceneAPI/MaterialConverter registry settings for configuring the scene material converter. It includes an enable flag, and a default material to use when conversion is disabled.
- Added SceneBuilderDependencyRequests::AddFingerprintInfo which allows ScenePI components to modify the scene builder analysis fingerprint. We use this to reprocess scene files when the material converter settings change.
- Updated SceneAPI's material asset builder to skip the StandardPBR dependency when material conversion is disabled.
- Added some code to MaterialComponentController to handle an edge case that may when disabling material conversion on an existing project, and assigned materials disappear.

Testing:
- Changing the registery setting does trigger a rebuild of the fbx files.
- When material conversion is disabled, changing an azsl file does not cause fbx files to rebuild, but the shader still reloads as expected.
- Made a test level using multiple models with multiple meshes, made various adjustments to the material slots for each mesh, and tried switcihng the material conversion registry setting from true to false. (Details below)
- TODO: Will merge this change to a customer's fork and test on their existing content.

Details about my test level:
- Made a new test level AtomTest project
- Added two entities, both using multi-mat_mesh-groups_1m_cubes.fbx
- Added a material component to both entities
  - Entity 1 material assignments
    - Blue_Zaxis: left as-is
    - Green_Yaxis: exported the material
    - Red_Xaxis: exported the material, and changed the material instance color to pink
    - StingrayPBS1: exported the material, scaled the UVs in the exported material source, and changed the material instance color to green.
    - With_Texture: selected an existing brick material, changed the material instance color to red.
  - Entity 2 material assignments
    - Default Material: set to an existing brick material
    - Blue_Zaxis: manually assigned built-in material that was converted from fbx
    - Green_Yaxis: manually assigned built-in material that was converted from fbx, and changed the material instance color to orange

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
..
ACES Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
AuxGeom Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Builders Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Checkerboard Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
CoreLights Promote IndexedDataVector to public Feature/Utils header 4 years ago
Decals Promote IndexedDataVector to public Feature/Utils header 4 years ago
DiffuseGlobalIllumination Moved render checks to a ShouldRender() helper function. 4 years ago
DisplayMapper Add missing display mapper operation type bindings 4 years ago
ImGui Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
ImageBasedLights Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
LookupTable Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
LuxCore Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Material Added a new registry setting that disables automatic conversion of materials from model files like FBX. 4 years ago
Math Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Mesh Fixed a bug where a new entity using a mesh that was already loaded would not be able to correctly initialize a material component. 4 years ago
MorphTargets Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
OcclusionCullingPlane Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Platform Merge branch 'development' into cmake/SPEC-7179 4 years ago
PostProcess Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
PostProcessing Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
RayTracing Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
ReflectionProbe Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
ReflectionScreenSpace Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
ScreenSpace Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Shadows Promote IndexedDataVector to public Feature/Utils header 4 years ago
SkinnedMesh 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. 4 years ago
SkyBox Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
TransformService Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
Utils Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
CommonModule.cpp Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
CommonSystemComponent.cpp Promote IndexedDataVector to public Feature/Utils header 4 years ago
CommonSystemComponent.h Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
EditorCommonSystemComponent.cpp Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
EditorCommonSystemComponent.h Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
FrameCaptureSystemComponent.cpp Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
FrameCaptureSystemComponent.h Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
ProfilingCaptureSystemComponent.cpp Move benchmark data aggregation from ASV into ly_test_tools module. (#2335) 4 years ago
ProfilingCaptureSystemComponent.h Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
RenderCommon.h Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago