From 78cadfd1d07c97e2b002aec258587fc1bb42021b Mon Sep 17 00:00:00 2001 From: shiranj Date: Tue, 13 Apr 2021 11:24:31 -0700 Subject: [PATCH 1/5] Convert daily metrics pipeline script to use BlueOcean API --- .../build/tools/jenkins_pipeline_metrics.py | 159 ++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 scripts/build/tools/jenkins_pipeline_metrics.py diff --git a/scripts/build/tools/jenkins_pipeline_metrics.py b/scripts/build/tools/jenkins_pipeline_metrics.py new file mode 100644 index 0000000000..b84f55a8a0 --- /dev/null +++ b/scripts/build/tools/jenkins_pipeline_metrics.py @@ -0,0 +1,159 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +import os +import json +import requests +import traceback +import csv +import sys +from datetime import datetime, timezone +from requests.auth import HTTPBasicAuth + +cur_dir = os.path.dirname(os.path.abspath(__file__)) +sys.path.append(os.path.join(os.path.dirname(cur_dir), 'package')) +from util import * + + +class JenkinsAPIClient: + def __init__(self, jenkins_base_url, jenkins_username, jenkins_api_token): + self.jenkins_base_url = jenkins_base_url.rstrip('/') + self.jenkins_username = jenkins_username + self.jenkins_api_token = jenkins_api_token + self.blueocean_api_path = '/blue/rest/organizations/jenkins/pipelines' + + def get_request(self, url): + try: + response = requests.get(url, auth=HTTPBasicAuth(self.jenkins_username, self.jenkins_api_token)) + if response.ok: + return response.json() + except Exception: + traceback.print_exc() + error(f'Get request {url} failed, see exception for more details.') + + def get_builds(self, pipeline_name, branch_name=''): + url = self.jenkins_base_url + self.blueocean_api_path + f'/{pipeline_name}/{branch_name}/runs' + return self.get_request(url) + + def get_stages(self, build_number, pipeline_name, branch_name=''): + url = self.jenkins_base_url + self.blueocean_api_path + f'/{pipeline_name}/{branch_name}/runs/{build_number}/nodes' + return self.get_request(url) + + +def generate_build_metrics_csv(env, target_date): + output = [] + jenkins_client = JenkinsAPIClient(env['JENKINS_URL'], env['JENKINS_USERNAME'], env['JENKINS_API_TOKEN']) + pipeline_name = env['PIPELINE_NAME'] + builds = jenkins_client.get_builds(pipeline_name) + days_to_collect = env['DAYS_TO_COLLECT'] + for build in builds: + build_time = datetime.strptime(build['startTime'], '%Y-%m-%dT%H:%M:%S.%f%z') + # Convert startTime to local timezone to compare, because Jenkins server may use a different timezone. + build_date = build_time.astimezone().date() + date_diff = target_date - build_date + # Only collect build result of past {days_to_collect} days. + if date_diff.days > int(days_to_collect): + break + stages = jenkins_client.get_stages(build['id'], pipeline_name) + stage_dict = {} + parallel_stages = [] + # Build stage_dict and find all parallel stages + for stage in stages: + stage_dict[stage['id']] = stage + if stage['type'] == 'PARALLEL': + parallel_stages.append(stage) + # Calculate build metrics grouped by parallel stage + def stage_duration_sum(stage): + duration_sum = stage['durationInMillis'] + for edge in stage['edges']: + downstream_stage = stage_dict[edge['id']] + duration_sum += stage_duration_sum(downstream_stage) + return duration_sum + for parallel_stage in parallel_stages: + try: + build_info = { + 'job_name': parallel_stage['displayName'], + 'view_name': env['BRANCH_NAME'] + } + # UTC datetime is required by BI team + build_info['build_time'] = datetime.fromtimestamp(build_time.timestamp(), timezone.utc) + build_info['build_number'] = build['id'] + build_info['job_duration'] = stage_duration_sum(parallel_stage) / 1000 / 60 + build_info['status'] = parallel_stage['result'] + build_info['clean_build'] = 'True' + print(build_info) + output.append(build_info) + except Exception: + traceback.print_exc() + + if output: + with open('spectra_build_metrics.csv', 'w', newline='') as csvfile: + fieldnames = list(output[0].keys()) + writer = csv.DictWriter(csvfile, fieldnames=fieldnames) + writer.writeheader() + writer.writerows(output) + + +def generate_build_metrics_manifest(csv_s3_location): + data = { + "entries": [ + { + "url": csv_s3_location + } + ] + } + with open('spectra_build_metrics.manifest', 'w') as manifest: + json.dump(data, manifest) + + +def upload_files_to_s3(env, formatted_date): + csv_s3_prefix = f"{env['CSV_PREFIX'].rstrip('/')}/{formatted_date}" + manifest_s3_prefix = f"{env['MANIFEST_PREFIX'].rstrip('/')}/{formatted_date}" + upload_to_s3_script_path = os.path.join(cur_dir, 'upload_to_s3.py') + engine_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) + if sys.platform == 'win32': + python = os.path.join(engine_root, 'python', 'python.cmd') + else: + python = os.path.join(engine_root, 'python', 'python.sh') + upload_csv_cmd = [python, upload_to_s3_script_path, '--base_dir', cur_dir, '--file_regex', env['CSV_REGEX'], '--bucket', env['BUCKET'], '--key_prefix', csv_s3_prefix] + execute_system_call(upload_csv_cmd) + upload_manifest_cmd = [python, upload_to_s3_script_path, '--base_dir', cur_dir, '--file_regex', env['MANIFEST_REGEX'], '--bucket', env['BUCKET'], '--key_prefix', manifest_s3_prefix] + execute_system_call(upload_manifest_cmd) + + +def get_required_env(env, keys): + success = True + for key in keys: + try: + env[key] = os.environ[key].strip() + except KeyError: + error(f'{key} is not set in environment variable') + success = False + return success + + +def main(): + env = {} + required_env_list = ['JENKINS_URL', 'PIPELINE_NAME', 'BRANCH_NAME', 'JENKINS_USERNAME', 'JENKINS_API_TOKEN', 'BUCKET', 'CSV_REGEX', 'CSV_PREFIX', 'MANIFEST_REGEX', 'MANIFEST_PREFIX', 'DAYS_TO_COLLECT'] + if not get_required_env(env, required_env_list): + error('Required environment variable is not set, see log for more details.') + + target_date = datetime.today().date() + formatted_date = f'{target_date.year}/{target_date:%m}/{target_date:%d}' + csv_s3_location = f"s3://{env['BUCKET']}/{env['CSV_PREFIX'].rstrip('/')}/{formatted_date}/spectra_build_metrics.csv" + + generate_build_metrics_csv(env, target_date) + generate_build_metrics_manifest(csv_s3_location) + upload_files_to_s3(env, formatted_date) + + +if __name__ == "__main__": + main() From f3d0666a632760b68858391698f8253b2072249b Mon Sep 17 00:00:00 2001 From: shiranj Date: Tue, 13 Apr 2021 11:52:42 -0700 Subject: [PATCH 2/5] Add retry to get request --- .../build/tools/jenkins_pipeline_metrics.py | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/scripts/build/tools/jenkins_pipeline_metrics.py b/scripts/build/tools/jenkins_pipeline_metrics.py index b84f55a8a0..c40cd33d18 100644 --- a/scripts/build/tools/jenkins_pipeline_metrics.py +++ b/scripts/build/tools/jenkins_pipeline_metrics.py @@ -30,22 +30,24 @@ class JenkinsAPIClient: self.jenkins_api_token = jenkins_api_token self.blueocean_api_path = '/blue/rest/organizations/jenkins/pipelines' - def get_request(self, url): - try: - response = requests.get(url, auth=HTTPBasicAuth(self.jenkins_username, self.jenkins_api_token)) - if response.ok: - return response.json() - except Exception: - traceback.print_exc() - error(f'Get request {url} failed, see exception for more details.') + def get_request(self, url, retry=1): + for i in range(retry): + try: + response = requests.get(url, auth=HTTPBasicAuth(self.jenkins_username, self.jenkins_api_token)) + if response.ok: + return response.json() + except Exception: + traceback.print_exc() + print(f'WARN: Get request {url} failed, retying....') + error(f'Get request {url} failed, see exception for more details.') def get_builds(self, pipeline_name, branch_name=''): url = self.jenkins_base_url + self.blueocean_api_path + f'/{pipeline_name}/{branch_name}/runs' - return self.get_request(url) + return self.get_request(url, retry=3) def get_stages(self, build_number, pipeline_name, branch_name=''): url = self.jenkins_base_url + self.blueocean_api_path + f'/{pipeline_name}/{branch_name}/runs/{build_number}/nodes' - return self.get_request(url) + return self.get_request(url, retry=3) def generate_build_metrics_csv(env, target_date): From d399d0d8f16b599889e1a1213e13ad8f3ecc1ed0 Mon Sep 17 00:00:00 2001 From: shiranj Date: Tue, 13 Apr 2021 12:15:51 -0700 Subject: [PATCH 3/5] Move jenkins_pipeline_metrics.py to ascripts/build/Jenkins/tools --- scripts/build/{ => Jenkins}/tools/jenkins_pipeline_metrics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename scripts/build/{ => Jenkins}/tools/jenkins_pipeline_metrics.py (97%) diff --git a/scripts/build/tools/jenkins_pipeline_metrics.py b/scripts/build/Jenkins/tools/jenkins_pipeline_metrics.py similarity index 97% rename from scripts/build/tools/jenkins_pipeline_metrics.py rename to scripts/build/Jenkins/tools/jenkins_pipeline_metrics.py index c40cd33d18..80ab3fc60f 100644 --- a/scripts/build/tools/jenkins_pipeline_metrics.py +++ b/scripts/build/Jenkins/tools/jenkins_pipeline_metrics.py @@ -19,7 +19,7 @@ from datetime import datetime, timezone from requests.auth import HTTPBasicAuth cur_dir = os.path.dirname(os.path.abspath(__file__)) -sys.path.append(os.path.join(os.path.dirname(cur_dir), 'package')) +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(cur_dir)), 'package')) from util import * @@ -120,7 +120,7 @@ def upload_files_to_s3(env, formatted_date): csv_s3_prefix = f"{env['CSV_PREFIX'].rstrip('/')}/{formatted_date}" manifest_s3_prefix = f"{env['MANIFEST_PREFIX'].rstrip('/')}/{formatted_date}" upload_to_s3_script_path = os.path.join(cur_dir, 'upload_to_s3.py') - engine_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) + engine_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))) if sys.platform == 'win32': python = os.path.join(engine_root, 'python', 'python.cmd') else: From 8469c9ca0a0b63202d526a6f8ba8d19d50381239 Mon Sep 17 00:00:00 2001 From: alexpete Date: Tue, 13 Apr 2021 17:18:57 -0700 Subject: [PATCH 4/5] Integrating github/staging through commit 5f214be --- .../AssetProcessorGamePlatformConfig.setreg | 14 + .../ap_external_project_setup_fixture.py | 2 +- .../ap_fast_scan_setting_backup_fixture.py | 4 +- .../ap_fixtures/ap_idle_fixture.py | 2 +- .../ap_missing_dependency_fixture.py | 2 +- .../ap_fixtures/ap_setup_fixture.py | 2 +- .../ap_fixtures/asset_processor_fixture.py | 4 +- .../bundler_batch_setup_fixture.py | 4 +- .../ap_fixtures/clear_moveoutput_fixture.py | 2 +- .../asset_builder_tests.py | 4 +- .../asset_bundler_batch_tests.py | 4 +- .../asset_processor_batch_dependency_tests.py | 4 +- ...asset_processor_batch_dependency_tests2.py | 4 +- .../asset_processor_batch_tests.py | 6 +- .../asset_processor_batch_tests_2.py | 8 +- .../asset_processor_gui_tests.py | 6 +- .../asset_processor_gui_tests_2.py | 4 +- .../asset_relocator_tests.py | 6 +- .../missing_dependency_tests.py | 6 +- .../auxiliary_content_tests.py | 2 +- .../assetpipeline/fbx_tests/fbx_tests.py | 6 +- .../asset_database_utils.py | 2 +- .../automatedtesting_shared/asset_utils.py | 2 +- .../automatedtesting_shared/base.py | 2 +- .../editor_entity_utils.py | 2 +- .../editor_test_helper.py | 2 +- .../hydra_editor_utils.py | 6 +- .../platform_setting.py | 2 +- .../AssetBrowser_SearchFiltering.py | 2 +- .../AssetBrowser_TreeNavigation.py | 2 +- .../ComponentCRUD_Add_Delete_Components.py | 2 +- .../InputBindings_Add_Remove_Input_Events.py | 2 +- ...rides_InstancesPlantAtSpecifiedAltitude.py | 2 +- ...ample_InstancesPlantAtSpecifiedAltitude.py | 2 +- ...binedDescriptorsExpressInConfiguredArea.py | 2 +- ...tSelector_InstancesExpressBasedOnWeight.py | 2 +- ...errides_InstancesPlantAtSpecifiedRadius.py | 2 +- ...nFilter_InstancesPlantAtSpecifiedRadius.py | 2 +- ...ynamicSliceInstanceSpawner_Embedded_E2E.py | 2 +- ...ynamicSliceInstanceSpawner_External_E2E.py | 2 +- ...anceSpawnerPriority_LayerAndSubPriority.py | 2 +- .../EditorScripts/LayerBlender_E2E_Editor.py | 2 +- ...locker_InstancesBlockedInConfiguredArea.py | 2 +- ...faceTagEmitter_DependentOnMeshComponent.py | 2 +- ...mitter_SurfaceTagsAddRemoveSuccessfully.py | 2 +- ...PositionModifier_AutoSnapToSurfaceWorks.py | 2 +- ...rrides_InstancesPlantAtSpecifiedOffsets.py | 2 +- ...ionFilter_InstancesPlantInAssignedShape.py | 2 +- ...AndOverrides_InstancesPlantOnValidSlope.py | 2 +- ...tipleDescriptorOverridesPlantAsExpected.py | 2 +- ...ClearingPinnedEntitySetsPreviewToOrigin.py | 2 +- ...GradientReferencesAddRemoveSuccessfully.py | 2 +- ...mitter_SurfaceTagsAddRemoveSuccessfully.py | 2 +- ...ponentIncompatibleWithExpectedGradients.py | 2 +- ...sform_ComponentIncompatibleWithSpawners.py | 2 +- ..._FrequencyZoomCanBeSetBeyondSliderRange.py | 2 +- ...ient_ProcessedImageAssignedSuccessfully.py | 2 +- .../C12712452_ScriptCanvas_CollisionEvents.py | 2 +- ...54_ScriptCanvas_OverlapNodeVerification.py | 2 +- ...2455_ScriptCanvas_ShapeCastVerification.py | 2 +- ...eRegion_DirectionHasNoAffectOnMagnitude.py | 2 +- ...580_ForceRegion_SplineModifiedTransform.py | 2 +- ...12905527_ForceRegion_MagnitudeDeviation.py | 2 +- ...5528_ForceRegion_WithNonTriggerCollider.py | 2 +- .../C13351703_COM_NotIncludeTriggerShapes.py | 2 +- .../physics/C13895144_Ragdoll_ChangeLevel.py | 2 +- .../C14195074_ScriptCanvas_PostUpdateEvent.py | 2 +- .../C14654882_Ragdoll_ragdollAPTest.py | 2 +- .../C14861500_DefaultSetting_ColliderShape.py | 4 +- ...01_PhysXCollider_RenderMeshAutoAssigned.py | 2 +- ...4861502_PhysXCollider_AssetAutoAssigned.py | 4 +- ...C14861504_RenderMeshAsset_WithNoPxAsset.py | 4 +- .../C14902097_ScriptCanvas_PreUpdateEvent.py | 2 +- ...14902098_ScriptCanvas_PostPhysicsUpdate.py | 2 +- .../C14976307_Gravity_SetGravityWorks.py | 2 +- ...criptCanvas_SetKinematicTargetTransform.py | 2 +- ...DefaultLibraryUpdatedAcrossLevels_after.py | 2 +- ...efaultLibraryUpdatedAcrossLevels_before.py | 2 +- ...735_Materials_DefaultLibraryConsistency.py | 2 +- ...096740_Material_LibraryUpdatedCorrectly.py | 4 +- .../physics/C15308217_NoCrash_LevelSwitch.py | 2 +- ...21_Material_ComponentsInSyncWithLibrary.py | 2 +- ...935_Material_LibraryUpdatedAcrossLevels.py | 2 +- ...al_AddModifyDeleteOnCharacterController.py | 2 +- ...5879_ForceRegion_HighLinearDampingForce.py | 2 +- .../C17411467_AddPhysxRagdollComponent.py | 2 +- ...18243580_Joints_Fixed2BodiesConstrained.py | 2 +- .../C18243581_Joints_FixedBreakable.py | 2 +- ...8243582_Joints_FixedLeadFollowerCollide.py | 2 +- ...18243583_Joints_Hinge2BodiesConstrained.py | 2 +- ...43584_Joints_HingeSoftLimitsConstrained.py | 2 +- ...8243585_Joints_HingeNoLimitsConstrained.py | 2 +- ...8243586_Joints_HingeLeadFollowerCollide.py | 2 +- .../C18243587_Joints_HingeBreakable.py | 2 +- ...C18243588_Joints_Ball2BodiesConstrained.py | 2 +- ...243589_Joints_BallSoftLimitsConstrained.py | 2 +- ...18243590_Joints_BallNoLimitsConstrained.py | 2 +- ...18243591_Joints_BallLeadFollowerCollide.py | 2 +- .../physics/C18243592_Joints_BallBreakable.py | 2 +- ...C18243593_Joints_GlobalFrameConstrained.py | 2 +- ...977601_Material_FrictionCombinePriority.py | 2 +- ...526_Material_RestitutionCombinePriority.py | 2 +- .../C19536274_GetCollisionName_PrintsName.py | 2 +- ...19536277_GetCollisionName_PrintsNothing.py | 2 +- ...78018_ShapeColliderWithNoShapeComponent.py | 4 +- .../C19578021_ShapeCollider_CanBeAdded.py | 4 +- ...19723164_ShapeColliders_WontCrashEditor.py | 4 +- .../C3510642_Terrain_NotCollideWithTerrain.py | 2 +- .../C3510644_Collider_CollisionGroups.py | 2 +- ...044455_Material_libraryChangesInstantly.py | 2 +- .../C4044456_Material_FrictionCombine.py | 2 +- .../C4044457_Material_RestitutionCombine.py | 2 +- .../C4044459_Material_DynamicFriction.py | 2 +- .../C4044460_Material_StaticFriction.py | 2 +- .../physics/C4044461_Material_Restitution.py | 2 +- ...044694_Material_EmptyLibraryUsesDefault.py | 2 +- ...695_PhysXCollider_AddMultipleSurfaceFbx.py | 2 +- ...4697_Material_PerfaceMaterialValidation.py | 2 +- ...8315_Material_AddModifyDeleteOnCollider.py | 2 +- ...577_Materials_MaterialAssignedToTerrain.py | 2 +- ...25579_Material_AddModifyDeleteOnTerrain.py | 2 +- .../C4925580_Material_RagdollBonesMaterial.py | 2 +- ..._Material_AddModifyDeleteOnRagdollBones.py | 2 +- ...4976194_RigidBody_PhysXComponentIsValid.py | 2 +- ...76195_RigidBodies_InitialLinearVelocity.py | 2 +- ...6197_RigidBodies_InitialAngularVelocity.py | 2 +- .../C4976201_RigidBody_MassIsAssigned.py | 2 +- ...igidBody_StopsWhenBelowKineticThreshold.py | 2 +- .../C4976204_Verify_Start_Asleep_Condition.py | 2 +- ...976206_RigidBodies_GravityEnabledActive.py | 2 +- ...6207_PhysXRigidBodies_KinematicBehavior.py | 2 +- .../physics/C4976209_RigidBody_ComputesCOM.py | 2 +- .../physics/C4976210_COM_ManualSetting.py | 2 +- .../physics/C4976227_Collider_NewGroup.py | 2 +- .../C4976236_AddPhysxColliderComponent.py | 2 +- ...on_SameCollisionlayerSameCollisiongroup.py | 2 +- ...n_SameCollisionGroupDiffCollisionLayers.py | 2 +- ...44_Collider_SameGroupSameLayerCollision.py | 2 +- ...976245_PhysXCollider_CollisionLayerTest.py | 2 +- ...982593_PhysXCollider_CollisionLayerTest.py | 2 +- ...82595_Collider_TriggerDisablesCollision.py | 2 +- .../C4982797_Collider_ColliderOffset.py | 2 +- ...4982798_Collider_ColliderRotationOffset.py | 2 +- ...982800_PhysXColliderShape_CanBeSelected.py | 4 +- ...982801_PhysXColliderShape_CanBeSelected.py | 4 +- ...982802_PhysXColliderShape_CanBeSelected.py | 4 +- .../physics/C4982803_Enable_PxMesh_Option.py | 4 +- ...5340400_RigidBody_ManualMomentOfInertia.py | 2 +- ...ysxterrain_AddPhysxterrainNoEditorCrash.py | 2 +- ..._MultipleTerrains_CheckWarningInConsole.py | 2 +- ...89528_Terrain_MultipleTerrainComponents.py | 2 +- ..._Verify_Terrain_RigidBody_Collider_Mesh.py | 2 +- ...31_Warning_TerrainSliceTerrainComponent.py | 2 +- ...932040_ForceRegion_CubeExertsWorldForce.py | 2 +- ...orceRegion_LocalSpaceForceOnRigidBodies.py | 2 +- ...C5932042_PhysXForceRegion_LinearDamping.py | 2 +- ...32044_ForceRegion_PointForceOnRigidBody.py | 2 +- .../physics/C5932045_ForceRegion_Spline.py | 2 +- ...760_PhysXForceRegion_PointForceExertion.py | 2 +- ...1_ForceRegion_PhysAssetExertsPointForce.py | 2 +- ...0_ForceRegion_ForceRegionCombinesForces.py | 2 +- ...5968760_ForceRegion_CheckNetForceChange.py | 2 +- ...032082_Terrain_MultipleResolutionsValid.py | 2 +- ...90546_ForceRegion_SliceFileInstantiates.py | 2 +- ...547_ForceRegion_ParentChildForceRegions.py | 2 +- ...550_ForceRegion_WorldSpaceForceNegative.py | 2 +- ...551_ForceRegion_LocalSpaceForceNegative.py | 2 +- ...90552_ForceRegion_LinearDampingNegative.py | 2 +- ...orceRegion_SimpleDragForceOnRigidBodies.py | 2 +- ...C6090554_ForceRegion_PointForceNegative.py | 2 +- ...5_ForceRegion_SplineFollowOnRigidBodies.py | 2 +- ...6131473_StaticSlice_OnDynamicSliceSpawn.py | 2 +- .../C6224408_ScriptCanvas_EntitySpawn.py | 2 +- .../C6274125_ScriptCanvas_TriggerEvents.py | 2 +- .../C6321601_Force_HighValuesDirectionAxes.py | 2 +- .../physics/Physmaterial_Editor.py | 4 +- .../physics/UtilTest_Physmaterial_Editor.py | 2 +- .../Gem/PythonTests/scripting/Docking_Pane.py | 4 +- .../scripting/Opening_Closing_Pane.py | 4 +- .../PythonTests/scripting/Resizing_Pane.py | 4 +- .../benchmark/asset_load_benchmark_test.py | 2 +- CMakeLists.txt | 25 +- Code/CryEngine/Cry3DEngine/3dEngine.cpp | 4 +- Code/CryEngine/Cry3DEngine/CZBufferCuller.cpp | 6 +- Code/CryEngine/Cry3DEngine/CZBufferCuller.h | 20 +- .../CryEngine/Cry3DEngine/MaterialHelpers.cpp | 1 - Code/CryEngine/Cry3DEngine/TimeOfDay.cpp | 2 +- Code/CryEngine/CryCommon/CryAssert_impl.h | 2 +- .../CryCommon/EngineSettingsBackendWin32.cpp | 4 +- Code/CryEngine/CryCommon/HMDBus.h | 2 +- Code/CryEngine/CryCommon/ISystem.h | 2 +- Code/CryEngine/CryFont/FFont.cpp | 5 +- Code/CryEngine/CrySystem/CrashHandler.rc | 2 +- Code/CryEngine/CrySystem/CryDLMalloc.c | 16 + Code/CryEngine/CrySystem/IDebugCallStack.cpp | 2 +- Code/CryEngine/CrySystem/MemoryManager.cpp | 20 +- Code/CryEngine/CrySystem/System.cpp | 12 +- Code/CryEngine/CrySystem/SystemInit.cpp | 10 +- Code/CryEngine/CrySystem/SystemRender.cpp | 2 +- Code/CryEngine/CrySystem/SystemWin32.cpp | 2 +- Code/CryEngine/CrySystem/XML/ReadXMLSink.cpp | 24 +- .../RenderDll/Common/RenderThread.cpp | 2 + .../CryEngine/RenderDll/Common/RendererDefs.h | 2 +- .../RenderDll/Common/Shaders/ShaderCache.cpp | 3 - .../Common/Shaders/ShaderTemplate.cpp | 1 - .../RenderDll/XRenderD3D9/CryRenderD3D11.rc | 2 +- .../RenderDll/XRenderD3D9/CryRenderGL.rc | 2 +- .../RenderDll/XRenderD3D9/D3DFXPipeline.cpp | 1 - .../DXGL/Implementation/GLContext.cpp | 4 +- .../DXGL/Implementation/GLDevice.cpp | 12 +- .../RenderDll/XRenderD3D9/DriverD3D.cpp | 10 +- .../RenderDll/XRenderD3D9/GPUTimer.cpp | 5 +- .../XRenderD3D9/MultiLayerAlphaBlendPass.cpp | 2 +- .../RenderDll/XRenderNULL/CryRenderNULL.rc | 2 +- .../AzCore/AzCore/Android/APKFileHandler.cpp | 19 +- .../Framework/AzCore/AzCore/Android/Utils.cpp | 23 +- Code/Framework/AzCore/AzCore/Android/Utils.h | 5 +- .../AzCore/Asset/AssetJsonSerializer.cpp | 5 +- .../AzCore/AzCore/Component/Component.h | 6 +- .../AzCore/Component/ComponentApplication.cpp | 107 +- .../AzCore/Component/ComponentApplication.h | 7 +- .../AzCore/AzCore/Component/Entity.h | 2 +- Code/Framework/AzCore/AzCore/EBus/BusImpl.h | 2 +- Code/Framework/AzCore/AzCore/EBus/EBus.h | 10 +- Code/Framework/AzCore/AzCore/IO/Path/Path.h | 22 +- .../AzCore/AzCore/IO/Streamer/BlockCache.cpp | 17 +- .../AzCore/IO/Streamer/DedicatedCache.cpp | 17 +- .../AzCore/IO/Streamer/StorageDrive.cpp | 25 +- .../AzCore/AzCore/Math/Matrix3x4.cpp | 4 +- .../AzCore/AzCore/Math/Matrix4x4.cpp | 2 +- Code/Framework/AzCore/AzCore/Math/Obb.cpp | 2 +- .../AzCore/AzCore/Math/Transform.cpp | 4 +- .../AzCore/AzCore/Memory/PoolSchema.cpp | 2 +- .../AzCore/AzCore/Script/ScriptContext.cpp | 4 +- .../Serialization/EditContextConstants.inl | 2 +- .../Serialization/Json/BaseJsonSerializer.cpp | 23 +- .../Serialization/Json/BaseJsonSerializer.h | 16 +- .../AzCore/Serialization/Json/JsonMerger.cpp | 28 +- .../AzCore/Serialization/Json/JsonMerger.h | 28 +- .../Serialization/Json/JsonSerialization.cpp | 90 +- .../Serialization/Json/JsonSerialization.h | 190 +++- .../Json/JsonSerializationMetadata.h | 10 +- .../Json/JsonSerializationMetadata.inl | 26 +- .../Settings/SettingsRegistryMergeUtils.cpp | 40 +- .../Settings/SettingsRegistryMergeUtils.h | 18 + .../AzCore/AzCore/Slice/SliceComponent.cpp | 2 +- .../AzCore/AzCore/StringFunc/StringFunc.h | 4 +- .../AzCore/AzCore/UnitTest/UnitTest.h | 2 +- .../Android/AzCore/AzCore_Traits_Android.h | 1 - .../Android/AzCore/IO/SystemFile_Android.cpp | 2 +- .../Linux/AzCore/AzCore_Traits_Linux.h | 1 - .../Platform/Mac/AzCore/AzCore_Traits_Mac.h | 1 - .../Windows/AzCore/AzCore_Traits_Windows.h | 1 - .../Platform/iOS/AzCore/AzCore_Traits_iOS.h | 1 - .../Framework/AzCore/Tests/AZStd/Optional.cpp | 2 +- Code/Framework/AzCore/Tests/Components.cpp | 6 +- .../AzCore/Tests/IO/Path/PathTests.cpp | 18 +- Code/Framework/AzCore/Tests/Math/ObbTests.cpp | 10 + .../Json/JsonSerializationMetadataTests.cpp | 6 +- .../Tests/SettingsRegistryMergeUtilsTests.cpp | 10 + .../AzFramework/Application/Application.cpp | 55 +- .../AzFramework/Archive/MissingFileReport.cpp | 2 +- .../AzFramework/Asset/AssetBundleManifest.h | 2 +- .../AzFramework/IO/LocalFileIO.cpp | 6 +- .../AzFramework/IO/RemoteStorageDrive.cpp | 25 +- .../AzFramework/Physics/Material.h | 2 +- .../AzFramework/Physics/RigidBody.h | 238 +++++ .../EntityVisibilityBoundsUnionSystem.cpp | 4 +- .../Visibility/EntityVisibilityQuery.cpp | 4 +- .../Visibility/IVisibilitySystem.h | 49 +- .../Visibility/OctreeSystemComponent.cpp | 263 +++-- .../Visibility/OctreeSystemComponent.h | 117 ++- .../AzFramework/IO/LocalFileIO_Android.cpp | 7 +- .../TargetManagementComponent_Windows.cpp | 2 +- .../Windowing/NativeWindow_Windows.cpp | 2 +- .../Devices/Motion/InputDeviceMotion_iOS.mm | 2 +- .../Application/GameApplication.cpp | 8 +- .../Application/GameApplication.h | 2 +- .../AzQtComponents/AzQtComponentsAPI.h | 12 +- .../Components/FilteredSearchWidget.cpp | 2 +- ...umberyardStylesheet.h => O3DEStylesheet.h} | 4 +- .../AzQtComponents/Components/Style.h | 2 +- .../AzQtComponents/Components/StyleManager.h | 2 +- .../Components/Widgets/ColorPicker/Palette.h | 2 +- .../Widgets/Internal/OverlayWidgetLayer.cpp | 4 +- .../Components/Widgets/MessageBox.h | 2 +- .../Components/WindowDecorationWrapper.cpp | 2 +- .../Gallery/AssetBrowserFolderPage.cpp | 2 +- .../Gallery/BreadCrumbsPage.cpp | 4 +- .../AzQtComponents/Gallery/BrowseEditPage.cpp | 2 +- .../AzQtComponents/Gallery/ButtonPage.cpp | 4 +- .../AzQtComponents/Gallery/CardPage.cpp | 2 +- .../AzQtComponents/Gallery/CheckBoxPage.cpp | 4 +- .../AzQtComponents/Gallery/ColorLabelPage.cpp | 2 +- .../Gallery/ColorPickerPage.cpp | 2 +- .../AzQtComponents/Gallery/ComboBoxPage.cpp | 2 +- .../Gallery/ComponentDemoWidget.cpp | 2 +- .../Gallery/DragAndDropPage.cpp | 2 +- .../Gallery/FilteredSearchWidgetPage.cpp | 2 +- .../AzQtComponents/Gallery/Gallery.ico | 3 + .../AzQtComponents/Gallery/Gallery.rc | 1 + .../Gallery/GradientSliderPage.cpp | 2 +- .../AzQtComponents/Gallery/HyperlinkPage.cpp | 2 +- .../AzQtComponents/Gallery/LineEditPage.cpp | 2 +- .../AzQtComponents/Gallery/MenuPage.cpp | 4 +- .../Gallery/ProgressIndicatorPage.cpp | 4 +- .../Gallery/RadioButtonPage.cpp | 4 +- .../Gallery/ReflectedPropertyEditorPage.cpp | 2 +- .../AzQtComponents/Gallery/ScrollBarPage.cpp | 2 +- .../Gallery/SegmentControlPage.cpp | 2 +- .../Gallery/SliderComboPage.cpp | 2 +- .../AzQtComponents/Gallery/SliderPage.cpp | 4 +- .../AzQtComponents/Gallery/SpinBoxPage.cpp | 2 +- .../AzQtComponents/Gallery/SplitterPage.cpp | 2 +- .../AzQtComponents/Gallery/StyleSheetPage.cpp | 2 +- .../Gallery/StyledDockWidgetPage.cpp | 2 +- .../AzQtComponents/Gallery/SvgLabelPage.cpp | 4 +- .../AzQtComponents/Gallery/TabWidgetPage.cpp | 2 +- .../AzQtComponents/Gallery/TableViewPage.cpp | 2 +- .../AzQtComponents/Gallery/TitleBarPage.cpp | 2 +- .../Gallery/ToggleSwitchPage.cpp | 4 +- .../AzQtComponents/Gallery/ToolBarPage.cpp | 2 +- .../AzQtComponents/Gallery/TreeViewPage.cpp | 2 +- .../AzQtComponents/Gallery/TypographyPage.cpp | 4 +- .../AzQtComponents/Gallery/main.cpp | 4 +- .../PropertyEditorStandalone/main.cpp | 2 +- .../StyleGallery/DeploymentsWidget.h | 2 +- .../StyleGallery/ViewportTitleDlg.cpp | 2 +- .../AzQtComponents/StyleGallery/main.cpp | 6 +- .../StyleGallery/mainwidget.cpp | 2 +- .../Utilities/ScreenGrabber_win.cpp | 2 +- .../AzQtComponents/azqtcomponents_files.cmake | 2 +- .../azqtcomponents_gallery_files.cmake | 1 + .../API/ToolsApplicationAPI.h | 2 +- .../Application/ToolsApplication.cpp | 2 +- .../Application/ToolsApplication.h | 2 +- .../AssetPicker/AssetPickerDialog.cpp | 2 +- .../AssetBrowser/Previewer/EmptyPreviewer.cpp | 4 +- .../AssetBrowser/Search/FilterByWidget.cpp | 4 +- .../Search/SearchAssetTypeSelectorWidget.cpp | 4 +- .../Search/SearchParametersWidget.cpp | 4 +- .../AssetBrowser/Views/AssetBrowserTreeView.h | 2 +- .../AssetEditor/AssetEditorWidget.cpp | 4 +- .../Entity/EditorEntityModel.cpp | 2 +- .../Manipulators/ManipulatorManager.h | 2 +- .../Prefab/Instance/InstanceEntityScrubber.h | 2 +- .../Prefab/Instance/InstanceSerializer.cpp | 7 +- .../Prefab/PrefabDomUtils.cpp | 21 +- .../AzToolsFramework/Slice/SliceUtilities.cpp | 6 +- .../SourceControl/PerforceComponent.cpp | 2 +- .../ToolsComponents/ComponentMimeData.cpp | 4 +- .../ToolsComponents/EditorComponentBase.h | 4 +- .../ToolsComponents/EditorLayerComponent.cpp | 5 +- .../ToolsComponents/EditorLayerComponent.h | 4 +- .../Core/EditorFrameworkApplication.cpp | 1 - .../UI/Logging/NewLogTabDialog.cpp | 4 +- .../UI/Outliner/EntityOutlinerWidget.cpp | 2 +- .../UI/Prefab/PrefabIntegrationManager.cpp | 2 +- .../PropertyEditor/EntityPropertyEditor.cpp | 2 +- .../PropertyEditor/EntityPropertyEditor.hxx | 2 +- .../ReflectedPropertyEditor.hxx | 2 +- .../SliceOverridesNotificationWindow.cpp | 2 +- .../UI/UICore/OverwritePromptDialog.cpp | 4 +- .../UI/UICore/ProgressShield.cpp | 4 +- .../UI/UICore/SaveChangesDialog.cpp | 4 +- .../UnitTest/AzToolsFrameworkTestHelpers.cpp | 2 +- .../AzToolsFramework/Viewport/ViewportTypes.h | 8 +- .../GridMate/GridMate/Replica/DataSet.h | 2 +- .../Tests/OctreePerformanceTests.cpp | 41 +- Code/Framework/Tests/OctreeTests.cpp | 208 ++-- Code/LauncherUnified/CMakeLists.txt | 177 +--- .../FindLauncherGenerator.cmake | 14 + Code/LauncherUnified/Game.cpp | 2 +- Code/LauncherUnified/Launcher.cpp | 128 +-- Code/LauncherUnified/Launcher.h | 4 +- Code/LauncherUnified/LauncherProject.cpp | 2 +- .../Platform/Android/Launcher_Android.cpp | 2 +- .../Platform/Common/Apple/Launcher_Apple.h | 2 +- .../Platform/Common/Apple/Launcher_Apple.mm | 2 +- .../Common/UnixLike/Launcher_UnixLike.cpp | 2 +- .../Common/UnixLike/Launcher_UnixLike.h | 2 +- .../Platform/Linux/Launcher_Linux.cpp | 2 +- .../Platform/Mac/Launcher_Mac.mm | 12 +- ..._Mac.mm => O3DEApplicationDelegate_Mac.mm} | 6 +- ...pplication_Mac.h => O3DEApplication_Mac.h} | 8 +- ...Delegate_Mac.mm => O3DEApplication_Mac.mm} | 6 +- .../Platform/Mac/platform_mac_files.cmake | 6 +- .../Platform/Windows/Launcher_Windows.cpp | 2 +- .../Windows/launcher_project_windows.cmake | 2 +- .../Platform/iOS/Launcher_iOS.mm | 4 +- Code/LauncherUnified/Server.cpp | 2 +- .../Tests/LauncherUnifiedTests.cpp | 6 +- Code/LauncherUnified/Tests/Test.cpp | 2 +- Code/LauncherUnified/launcher_generator.cmake | 190 ++++ Code/Sandbox/Editor/AboutDialog.cpp | 2 +- Code/Sandbox/Editor/AboutDialog.ui | 4 +- .../Editor/Alembic/AlembicCompiler.cpp | 2 +- .../AzAssetBrowserRequestHandler.cpp | 8 +- Code/Sandbox/Editor/CMakeLists.txt | 2 +- .../Editor/Controls/ColorGradientCtrl.cpp | 4 - .../ReflectedPropertyCtrl.cpp | 1 - .../Editor/Core/LevelEditorMenuHandler.cpp | 12 +- .../Editor/Core/QtEditorApplication.cpp | 12 +- .../Sandbox/Editor/Core/QtEditorApplication.h | 4 +- Code/Sandbox/Editor/CryEdit.cpp | 34 +- Code/Sandbox/Editor/CryEdit.h | 2 +- Code/Sandbox/Editor/DatabaseFrameWnd.cpp | 8 +- Code/Sandbox/Editor/EditorCryEdit.rc | 2 +- Code/Sandbox/Editor/EditorPanelUtils.cpp | 4 +- .../Editor/EditorPreferencesPageGeneral.cpp | 4 +- .../Editor/FeedbackDialog/FeedbackDialog.cpp | 6 +- .../Sandbox/Editor/GraphicsSettingsDialog.cpp | 8 +- Code/Sandbox/Editor/IEditorImpl.cpp | 8 +- .../Editor/KeyboardCustomizationSettings.cpp | 10 +- .../LensFlareEditor/LensFlareAtomicList.cpp | 4 +- .../LensFlareEditor/LensFlareEditor.cpp | 6 +- .../LensFlareEditor/LensFlareElementTree.cpp | 14 +- Code/Sandbox/Editor/MainWindow.cpp | 8 +- Code/Sandbox/Editor/MainWindow.qrc | 2 +- .../Editor/Material/MaterialManager.cpp | 2 +- .../Editor/Material/MaterialPythonFuncs.cpp | 2 - Code/Sandbox/Editor/PluginManager.cpp | 2 +- Code/Sandbox/Editor/Resource.h | 2 +- Code/Sandbox/Editor/Settings.cpp | 2 +- Code/Sandbox/Editor/ShortcutDispatcher.h | 4 +- Code/Sandbox/Editor/StartupLogoDialog.cpp | 4 +- Code/Sandbox/Editor/ThumbnailGenerator.cpp | 41 +- Code/Sandbox/Editor/ToolbarManager.cpp | 2 +- .../Editor/TrackView/TrackViewDialog.cpp | 4 +- .../Editor/TrackView/TrackViewPythonFuncs.cpp | 2 - Code/Sandbox/Editor/Util/ImageUtil.cpp | 4 - Code/Sandbox/Editor/ViewportTitleDlg.cpp | 4 +- .../WelcomeScreen/WelcomeScreenDialog.ui | 2 +- Code/Sandbox/Editor/res/lyeditor.ico | 3 - Code/Sandbox/Editor/res/o3de_editor.ico | 3 + .../Objects/ComponentEntityObject.cpp | 39 +- .../AssetBrowserContextProvider.cpp | 2 +- .../AssetImporterPlugin.cpp | 6 + .../Plugins/EditorCommon/EditorCommon.rc | Bin 2536 -> 2552 bytes .../Sandbox/Plugins/FBXPlugin/FBXExporter.cpp | 10 +- .../PlatformSettings_Ios.h | 2 +- .../AWSNativeSDKInit/AWSNativeSDKInit.h | 4 +- .../assetbundlerbatch_exe_files.cmake | 1 + .../AssetBundler/source/AssetBundlerBatch.ico | 3 + .../AssetBundler/source/AssetBundlerBatch.rc | 1 + .../source/utils/applicationManager.cpp | 12 +- .../Tools/AssetBundler/source/utils/utils.cpp | 6 +- .../AssetBuilder/AssetBuilder.ico | 3 + .../AssetBuilder/AssetBuilder.rc | 1 + .../AssetBuilder/asset_builder_files.cmake | 1 + .../Linux/AssetProcessor_Traits_Linux.h | 4 +- .../Platform/Mac/AssetProcessor_Traits_Mac.h | 4 +- .../Platform/Windows/AssetProcessor.rc | 2 +- .../Platform/Windows/AssetProcessorBatch.ico | 3 + .../Platform/Windows/AssetProcessorBatch.rc | 1 + .../Windows/AssetProcessor_Traits_Windows.h | 4 +- .../assetprocessor_batch_files.cmake | 1 + .../native/AssetManager/FileStateCache.cpp | 5 +- .../AssetManager/assetProcessorManager.cpp | 98 +- .../AssetManager/assetProcessorManager.h | 8 +- .../native/resourcecompiler/RCBuilder.cpp | 10 +- .../tests/assetdatabase/AssetDatabaseTest.cpp | 8 +- .../AssetProcessorManagerTest.cpp | 125 +++ .../assetmanager/AssetProcessorManagerTest.h | 1 + .../native/ui/ProductAssetDetailsPanel.cpp | 2 +- .../native/ui/SourceAssetTreeModel.cpp | 2 +- .../native/ui/style/AssetProcessor.qrc | 2 +- .../native/ui/style/lyassetprocessor.ico | 3 - .../native/ui/style/lyassetprocessor.png | 3 - .../native/ui/style/o3de_assetprocessor.ico | 3 + .../native/ui/style/o3de_assetprocessor.png | 3 + .../AssetProcessingStateDataUnitTests.cpp | 26 +- .../utilities/GUIApplicationManager.cpp | 61 +- .../native/utilities/GUIApplicationManager.h | 1 - .../native/utilities/assetUtils.cpp | 20 +- Code/Tools/CrashHandler/Shared/CrashHandler.h | 4 +- .../CrashHandler/Tools/UI/submit_report.ui | 6 +- .../Tools/Uploader/ToolsCrashUploader.cpp | 4 +- .../Tools/Uploader/ToolsCrashUploader.h | 2 +- .../Tools/Uploader/platforms/win/main.cpp | 4 +- .../include/Uploader/BufferedDataStream.h | 2 +- .../Uploader/include/Uploader/CrashUploader.h | 2 +- .../include/Uploader/FileStreamDataSource.h | 2 +- .../Uploader/src/BufferedDataStream.cpp | 2 +- .../Uploader/src/CrashUploader.cpp | 2 +- .../Uploader/src/FileStreamDataSource.cpp | 2 +- .../Core/Server/CrySimpleSock.cpp | 2 +- Code/Tools/DeltaCataloger/CMakeLists.txt | 15 + .../deltacataloger_win_files.cmake | 14 + .../DeltaCataloger/source/DeltaCataloger.ico | 3 + .../DeltaCataloger/source/DeltaCataloger.rc | 1 + Code/Tools/HLSLCrossCompiler/include/hlslcc.h | 2 +- .../HLSLCrossCompilerMETAL/include/hlslcc.h | 2 +- .../Tools/News/NewsBuilder/Qt/NewsBuilder.cpp | 2 +- .../News/NewsShared/Qt/ArticleErrorView.ui | 2 +- Code/Tools/RC/ResourceCompiler/CMakeLists.txt | 1 - .../RC/ResourceCompiler/ResourceCompiler.cpp | 4 - .../RC/ResourceCompiler/ResourceCompiler.rc | 2 +- Code/Tools/RC/ResourceCompiler/main.cpp | 2 +- .../RC/ResourceCompilerPC/CMakeLists.txt | 1 - .../Common/MaterialExporter.cpp | 2 +- .../RC/ResourceCompilerXML/CMakeLists.txt | 1 - .../SceneAPI/FbxSDKWrapper/CMakeLists.txt | 2 + .../Importers/FbxMaterialImporter.cpp | 2 +- .../SceneAPI/SceneData/Groups/MeshGroup.cpp | 4 +- .../SceneData/Groups/SkeletonGroup.cpp | 2 +- .../SceneAPI/SceneData/Groups/SkinGroup.cpp | 4 +- .../SceneData/Rules/BlendShapeRule.cpp | 2 +- .../SceneAPI/SceneData/Rules/MaterialRule.cpp | 2 +- .../ShaderCacheGen/ShaderCacheGen.cpp | 13 +- .../Standalone/Source/Editor/hex_lua.ico | 4 +- .../Source/StandaloneToolsApplication.cpp | 2 +- .../Code/Source/Framework/AWSApiJob.cpp | 2 +- .../Code/Tests/AWSCoreSystemComponentTest.cpp | 2 +- .../Code/Source/IdentityProvider.cpp | 2 +- .../Code/Source/Converters/Cubemap.h | 2 +- .../Code/Source/ImageLoader/ImageLoaders.h | 2 +- .../Code/Source/Processing/DDSHeader.h | 2 +- Gems/Atom/Asset/Shader/Code/CMakeLists.txt | 6 - .../Code/Source/BootstrapSystemComponent.cpp | 19 +- .../Code/Source/BootstrapSystemComponent.h | 1 + .../Passes/EnvironmentCubeMapForwardMSAA.pass | 8 +- .../Passes/EnvironmentCubeMapPipeline.pass | 20 +- .../Feature/Common/Assets/Passes/Forward.pass | 8 +- .../Assets/Passes/ForwardCheckerboard.pass | 8 +- .../Common/Assets/Passes/ForwardMSAA.pass | 8 +- .../Common/Assets/Passes/MainPipeline.pass | 16 +- .../Common/Assets/Passes/OpaqueParent.pass | 12 +- .../Assets/Passes/PassTemplates.azasset | 4 +- ...adowmaps.pass => ProjectedShadowmaps.pass} | 4 +- .../Common/Assets/Passes/ShadowParent.pass | 24 +- .../Common/Assets/Passes/Transparent.pass | 8 +- .../Assets/Passes/TransparentParent.pass | 12 +- .../LightCulling/LightCullingShared.azsli | 4 +- .../MorphTargets/MorphTargetCompression.azsli | 18 + .../Atom/Features/PBR/ForwardPassSrg.azsli | 4 +- .../Atom/Features/PBR/Lights/DiskLight.azsli | 88 +- .../Atom/Features/PBR/Lights/Lights.azsli | 8 +- .../PBR/Lights/SimplePointLight.azsli | 55 ++ .../Features/PBR/Lights/SimpleSpotLight.azsli | 76 ++ .../Atom/Features/PBR/Lights/SpotLight.azsli | 152 --- .../Features/PBR/TransparentPassSrg.azsli | 4 +- .../Shadow/DirectionalLightShadow.azsli | 61 +- ...ightShadow.azsli => ProjectedShadow.azsli} | 148 +-- .../CoreLights/ViewSrg.azsli | 66 +- .../RayTracingSceneSrg.azsli | 32 +- .../Shaders/LightCulling/LightCulling.azsl | 174 ++-- .../Shaders/MorphTargets/MorphTargetCS.azsl | 17 +- .../Shaders/MorphTargets/MorphTargetSRG.azsli | 4 +- .../Shaders/SkinnedMesh/LinearSkinningCS.azsl | 38 + .../SkinnedMesh/LinearSkinningPassSRG.azsli | 18 + .../atom_feature_common_asset_files.cmake | 5 +- Gems/Atom/Feature/Common/Code/CMakeLists.txt | 1 - .../Feature/CoreLights/CoreLightsConstants.h | 4 +- ...irectionalLightFeatureProcessorInterface.h | 3 + .../DiskLightFeatureProcessorInterface.h | 52 +- .../Atom/Feature/CoreLights/ShadowConstants.h | 2 +- ...implePointLightFeatureProcessorInterface.h | 49 + ...SimpleSpotLightFeatureProcessorInterface.h | 53 + .../SpotLightFeatureProcessorInterface.h | 110 --- .../MorphTargets/MorphTargetInputBuffers.h | 2 + .../Feature/ParamMacros/ParamMacrosHowTo.inl | 2 +- ...ProjectedShadowFeatureProcessorInterface.h | 72 ++ .../SkinnedMesh/SkinnedMeshInputBuffers.h | 23 +- .../SkinnedMesh/SkinnedMeshShaderOptions.h | 1 + .../SkinnedMesh/SkinnedMeshVertexStreams.h | 6 + .../Atom/Feature/Utils/MultiSparseVector.h | 166 ++++ .../Include/Atom/Feature/Utils/SparseVector.h | 126 +++ .../Code/Source/CommonSystemComponent.cpp | 15 +- .../CoreLights/CoreLightsSystemComponent.cpp | 13 +- .../DirectionalLightFeatureProcessor.cpp | 10 + .../DirectionalLightFeatureProcessor.h | 6 +- .../CoreLights/DiskLightFeatureProcessor.cpp | 218 +++- .../CoreLights/DiskLightFeatureProcessor.h | 30 +- .../Source/CoreLights/EsmShadowmapsPass.cpp | 4 +- .../Source/CoreLights/IndexedDataVector.h | 3 +- .../Source/CoreLights/IndexedDataVector.inl | 6 + .../Source/CoreLights/LightCullingPass.cpp | 41 +- .../Code/Source/CoreLights/LightCullingPass.h | 3 +- .../Source/CoreLights/LightCullingRemap.cpp | 1 - ...psPass.cpp => ProjectedShadowmapsPass.cpp} | 40 +- ...owmapsPass.h => ProjectedShadowmapsPass.h} | 22 +- .../Common/Code/Source/CoreLights/Shadow.h | 2 +- .../SimplePointLightFeatureProcessor.cpp | 173 ++++ .../SimplePointLightFeatureProcessor.h | 74 ++ .../SimpleSpotLightFeatureProcessor.cpp | 189 ++++ .../SimpleSpotLightFeatureProcessor.h | 78 ++ .../CoreLights/SpotLightFeatureProcessor.cpp | 929 ------------------ .../CoreLights/SpotLightFeatureProcessor.h | 158 --- .../Source/Decals/DecalFeatureProcessor.cpp | 2 +- .../DiffuseProbeGrid/DiffuseProbeGrid.cpp | 4 +- .../Code/Source/Mesh/MeshFeatureProcessor.cpp | 4 +- .../MorphTargets/MorphTargetDispatchItem.cpp | 44 +- .../MorphTargets/MorphTargetDispatchItem.h | 2 + .../RayTracing/RayTracingFeatureProcessor.cpp | 9 - .../ReflectionProbe/ReflectionProbe.cpp | 4 +- .../ProjectedShadowFeatureProcessor.cpp | 632 ++++++++++++ .../Shadows/ProjectedShadowFeatureProcessor.h | 141 +++ .../SkinnedMesh/SkinnedMeshDispatchItem.cpp | 24 +- .../SkinnedMesh/SkinnedMeshInputBuffers.cpp | 130 ++- .../SkinnedMeshShaderOptionsCache.cpp | 13 + .../SkinnedMeshShaderOptionsCache.h | 4 + .../SkinnedMeshVertexStreamProperties.cpp | 25 + .../Common/Code/Tests/SparseVectorTests.cpp | 292 ++++++ .../Code/atom_feature_common_files.cmake | 22 +- .../atom_feature_common_public_files.cmake | 4 +- .../atom_feature_common_tests_files.cmake | 1 + .../RHI/Vulkan/3rdParty/Findglad_vulkan.cmake | 2 +- .../Code/Include/Atom/RPI.Public/Culling.h | 27 +- .../Atom/RPI.Public/FeatureProcessor.h | 2 +- .../RPI/Code/Include/Atom/RPI.Public/Scene.h | 8 +- .../Atom/RPI.Reflect/Model/MorphTargetDelta.h | 27 +- .../RPI.Reflect/Model/MorphTargetMetaAsset.h | 3 + .../Model/ModelAssetBuilderComponent.cpp | 59 +- .../Model/ModelAssetBuilderComponent.h | 7 + .../Model/MorphTargetExporter.cpp | 28 +- .../RPI/Code/Source/RPI.Public/Culling.cpp | 63 +- .../Source/RPI.Public/Pass/RasterPass.cpp | 7 +- .../Atom/RPI/Code/Source/RPI.Public/Scene.cpp | 20 +- .../Shader/ShaderVariantAsyncLoader.cpp | 1 - .../RPI.Reflect/Model/MorphTargetDelta.cpp | 14 +- .../Model/MorphTargetMetaAsset.cpp | 1 + Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp | 1 + .../Atom/RPI/Code/Tests/System/SceneTests.cpp | 22 + .../Code/Source/Inspector/InspectorWidget.cpp | 2 +- .../Code/Source/MaterialEditor.ico | 3 - .../Platform/Windows/MaterialEditor.ico | 3 + .../{ => Platform/Windows}/MaterialEditor.rc | 0 .../Windows/platform_windows_files.cmake | 1 + .../Viewport/MaterialViewportRenderer.cpp | 5 + .../CreateMaterialDialog.h | 2 +- .../PresetBrowserDialog.h | 2 +- .../Window/ToolBar/MaterialEditorToolBar.cpp | 80 +- .../Window/ToolBar/MaterialEditorToolBar.h | 12 + .../ViewportSettingsInspector.cpp | 4 +- .../Tools/MaterialEditor/Code/Source/main.cpp | 2 +- .../Windows/ShaderManagementConsole.ico | 3 + .../Windows}/ShaderManagementConsole.rc | 0 .../Windows/platform_windows_files.cmake | 1 + .../Code/Source/ShaderManagementConsole.ico | 3 - .../Code/Source/main.cpp | 2 +- .../Include/Atom/Utils/ImGuiCullingDebug.inl | 4 +- .../Atom/Utils/ImGuiFrameVisualizer.inl | 1 - .../AtomImGuiTools/Code/CMakeLists.txt | 4 - .../CommonFeatures/CoreLights/AreaLightBus.h | 66 ++ .../CoreLights/AreaLightComponentConfig.h | 62 +- .../CoreLights/CoreLightsConstants.h | 4 - .../CoreLights/DirectionalLightBus.h | 7 + .../DirectionalLightComponentConfig.h | 3 + .../CommonFeatures/CoreLights/PointLightBus.h | 130 --- .../CoreLights/PointLightComponentConfig.h | 113 --- .../CommonFeatures/CoreLights/SpotLightBus.h | 172 ---- .../CoreLights/SpotLightComponentConfig.h | 62 -- .../CoreLights/AreaLightComponentConfig.cpp | 97 +- .../AreaLightComponentController.cpp | 650 ++++++++---- .../CoreLights/AreaLightComponentController.h | 28 +- .../DirectionalLightComponentConfig.cpp | 15 +- .../DirectionalLightComponentController.cpp | 16 +- .../DirectionalLightComponentController.h | 2 + .../Source/CoreLights/DiskLightDelegate.cpp | 133 ++- .../Source/CoreLights/DiskLightDelegate.h | 14 +- .../CoreLights/EditorAreaLightComponent.cpp | 286 +++++- .../CoreLights/EditorAreaLightComponent.h | 6 +- .../EditorDirectionalLightComponent.cpp | 16 +- .../CoreLights/EditorPointLightComponent.cpp | 206 ---- .../CoreLights/EditorPointLightComponent.h | 74 -- .../CoreLights/EditorSpotLightComponent.cpp | 261 ----- .../CoreLights/EditorSpotLightComponent.h | 49 - .../Source/CoreLights/LightDelegateBase.h | 36 +- .../Source/CoreLights/LightDelegateBase.inl | 23 +- .../CoreLights/LightDelegateInterface.h | 26 + .../Source/CoreLights/PointLightComponent.cpp | 44 - .../Source/CoreLights/PointLightComponent.h | 38 - .../PointLightComponentController.cpp | 286 ------ .../PointLightComponentController.h | 87 -- .../CoreLights/SimplePointLightDelegate.cpp | 56 ++ .../CoreLights/SimplePointLightDelegate.h | 44 + .../CoreLights/SimpleSpotLightDelegate.cpp | 58 ++ .../CoreLights/SimpleSpotLightDelegate.h | 44 + .../Source/CoreLights/SpotLightComponent.cpp | 44 - .../Source/CoreLights/SpotLightComponent.h | 37 - .../CoreLights/SpotLightComponentConfig.cpp | 83 -- .../SpotLightComponentController.cpp | 434 -------- .../CoreLights/SpotLightComponentController.h | 102 -- .../EditorMaterialComponentExporter.cpp | 8 +- .../CommonFeatures/Code/Source/Module.cpp | 8 - ...egration_commonfeatures_editor_files.cmake | 4 - ...omlyintegration_commonfeatures_files.cmake | 13 +- ...egration_commonfeatures_public_files.cmake | 4 - .../EMotionFXAtom/Code/CMakeLists.txt | 6 - .../EMotionFXAtom/Code/Source/ActorAsset.cpp | 142 +-- .../Code/Source/AtomActorInstance.cpp | 7 +- .../ImguiAtom/Code/CMakeLists.txt | 4 - .../ImguiAtom/Code/Source/DebugConsole.cpp | 12 +- .../ImguiAtom/Code/Source/DebugConsole.h | 20 +- .../Code/Source/Engine/FileIOHandler_wwise.h | 4 +- Gems/Blast/Code/Include/Blast/BlastMaterial.h | 2 +- .../CrashReporting/GameCrashUploader.h | 2 +- .../Windows/GameCrashUploader_windows.cpp | 2 +- .../Code/Platform/Windows/main_windows.cpp | 4 +- .../Code/Source/GameCrashUploader.cpp | 4 +- Gems/CustomAssetExample/Code/CMakeLists.txt | 4 - Gems/EMotionFX/Code/CMakeLists.txt | 10 +- .../EMotionFX/Code/EMotionFX/Source/Actor.cpp | 3 + .../EMotionFX/Source/EMotionFXManager.cpp | 4 +- .../EMStudioSDK/Source/LayoutManager.cpp | 3 +- .../EMStudioSDK/Source/MainWindow.cpp | 12 +- .../Source/RenderPlugin/RenderPlugin.cpp | 6 +- .../OpenGLRender/OpenGLRenderPlugin.cpp | 3 +- .../Source/AnimGraph/GameControllerWindow.cpp | 4 +- .../Attachments/AttachmentNodesWindow.cpp | 8 +- .../Source/Attachments/AttachmentsWindow.cpp | 12 +- .../Source/CommandBar/CommandBarPlugin.cpp | 10 +- .../PhonemeSelectionWindow.cpp | 12 +- .../MotionEvents/MotionEventPresetsWidget.cpp | 6 +- .../MotionSetManagementWindow.cpp | 6 +- .../MotionSetsWindow/MotionSetWindow.cpp | 10 +- .../MotionWindow/MotionWindowPlugin.cpp | 4 +- .../NodeGroups/NodeGroupManagementWidget.cpp | 8 +- .../Source/NodeGroups/NodeGroupWidget.cpp | 8 +- .../Source/SceneManager/ActorsWindow.cpp | 6 +- .../Source/SceneManager/MirrorSetupWindow.cpp | 25 +- .../Source/TimeView/PlaybackControlsGroup.cpp | 10 +- .../Source/TimeView/PlaybackOptionsGroup.cpp | 12 +- .../Source/TimeView/RecorderGroup.cpp | 8 +- .../Source/TimeView/TimeViewPlugin.cpp | 5 +- .../Source/TimeView/TrackDataHeaderWidget.cpp | 5 +- .../Source/TimeView/TrackHeaderWidget.cpp | 2 +- .../Editor/Platform/Mac/platform_mac.cmake | 4 +- .../Code/MysticQt/Source/MysticQtManager.cpp | 4 +- .../PropertyWidgets/ActorGoalNodeHandler.cpp | 4 +- .../PropertyWidgets/ActorJointHandler.cpp | 2 +- .../ActorMorphTargetHandler.cpp | 2 +- .../AnimGraphParameterHandler.cpp | 4 +- .../AnimGraphTransitionHandler.cpp | 2 +- .../BlendSpaceMotionContainerHandler.cpp | 2 +- .../MotionSetMotionIdHandler.cpp | 2 +- .../SimulatedObjectSelectionHandler.cpp | 2 +- .../TransitionStateFilterLocalHandler.cpp | 4 +- .../Source/Editor/SimulatedObjectModel.cpp | 2 - .../Source/Integration/Assets/ActorAsset.h | 4 +- .../Integration/System/SystemComponent.cpp | 8 +- .../Code/Tests/UI/CanUseLayoutMenu.cpp | 2 +- .../Code/Source/PythonProxyBus.h | 2 +- .../Code/Source/Widgets/GraphCanvasLabel.cpp | 2 - .../StaticLib/GraphCanvas/Styling/Parser.cpp | 2 - Gems/ImGui/Code/Include/ImGuiContextScope.h | 11 +- Gems/ImGui/Code/Source/ImGuiManager.cpp | 144 +-- .../Source/LYCommonMenu/ImGuiLYCommonMenu.cpp | 6 +- .../BuilderSettings/BuilderSettingManager.h | 2 +- .../Code/Source/Converters/Cubemap.h | 2 +- .../Source/InAppPurchasesSystemComponent.cpp | 2 +- .../Common/Apple/InAppPurchasesApple.mm | 10 +- .../Common/Apple/InAppPurchasesDelegate.mm | 26 +- .../XmlBuilderWorker/XmlBuilderWorker.cpp | 2 +- .../MaterialBuilderComponent.cpp | 2 +- .../Source/Shape/CapsuleShapeComponent.cpp | 2 - .../Code/Source/Shape/DiskShapeComponent.cpp | 2 - .../Shape/EditorCapsuleShapeComponent.h | 1 - .../Source/Shape/EditorDiskShapeComponent.cpp | 1 - .../EditorPolygonPrismShapeComponent.cpp | 2 - .../Source/Shape/EditorQuadShapeComponent.cpp | 1 - .../Source/Shape/EditorSphereShapeComponent.h | 1 - .../Code/Source/Shape/QuadShapeComponent.cpp | 2 - .../Source/Shape/SphereShapeComponent.cpp | 2 - .../Animation/UiAVCustomizeTrackColorsDlg.cpp | 2 +- .../Editor/Animation/UiAVEventsDialog.cpp | 2 +- .../Editor/Animation/UiAVSequenceProps.cpp | 2 +- .../Animation/UiAnimViewCurveEditor.cpp | 2 +- .../Editor/Animation/UiAnimViewDialog.cpp | 6 +- .../Editor/Animation/UiAnimViewFindDlg.cpp | 2 +- .../Animation/UiAnimViewKeyPropertiesDlg.cpp | 2 +- .../Animation/UiAnimViewNewSequenceDialog.cpp | 2 +- .../Code/Editor/Animation/UiAnimViewNodes.cpp | 2 +- Gems/LyShine/Code/Editor/EditorCommon.h | 4 +- .../Editor/LyShineEditorSystemComponent.cpp | 2 +- .../Tests/internal/test_UiTextComponent.cpp | 2 +- .../Code/Source/UiCanvasFileObject.cpp | 10 - .../Code/Source/MaestroSystemComponent.cpp | 2 +- Gems/Multiplayer/Code/CMakeLists.txt | 4 - .../ServerToClientReplicationWindow.cpp | 2 +- .../Code/CMakeLists.txt | 4 - .../Code/Platform/Windows/PAL_windows.cmake | 2 - .../Code/Source/System/SystemComponent.cpp | 4 +- Gems/PhysX/Code/CMakeLists.txt | 3 - .../PhysX/Code/Source/System/PhysXAllocator.h | 2 +- .../Code/Source/System/PhysXCpuDispatcher.h | 4 +- Gems/PhysX/Code/Source/System/PhysXJob.h | 2 +- .../Code/Source/System/PhysXSdkCallbacks.h | 2 +- Gems/PhysX/Code/Source/SystemComponent.h | 2 +- Gems/PhysXDebug/Code/Source/SystemComponent.h | 2 +- .../PrefabBuilder/PrefabBuilderTests.cpp | 3 + .../Prefab/PrefabBuilder/PrefabBuilderTests.h | 42 +- .../PythonBuilderRequestBus.h | 2 +- .../Code/Include/QtForPython/QtForPythonBus.h | 2 +- Gems/SaveData/Code/Tests/SaveDataTest.cpp | 2 +- Gems/SceneLoggingExample/Code/CMakeLists.txt | 4 - Gems/SceneLoggingExample/ReadMe.txt | 4 +- .../SceneProcessingConfigSystemComponent.cpp | 2 +- .../Code/Editor/Components/EditorGraph.cpp | 6 +- .../Code/Editor/SystemComponent.cpp | 2 +- .../VariablePanel/GraphVariablesTableView.h | 2 +- .../Include/ScriptCanvas/Utils/NodeUtils.cpp | 2 - Gems/ScriptCanvasTesting/Code/CMakeLists.txt | 2 - Gems/TestAssetBuilder/Code/CMakeLists.txt | 4 - Gems/Twitch/Code/Source/TwitchReflection.cpp | 802 +++++++-------- .../Windows/platform_windows_tools.cmake | 2 - Tests/ly_shared/PlatformSetting.py | 2 +- .../bin/windows/vs2019/Debug_x64/base.lib | 3 + .../bin/windows/vs2019/Debug_x64/base_cc.pdb | 3 + .../vs2019/Debug_x64/crashpad_client.lib | 3 + .../vs2019/Debug_x64/crashpad_client_cc.pdb | 3 + .../vs2019/Debug_x64/crashpad_compat.lib | 3 + .../vs2019/Debug_x64/crashpad_compat_cc.pdb | 3 + .../vs2019/Debug_x64/crashpad_context.lib | 3 + .../vs2019/Debug_x64/crashpad_context_cc.pdb | 3 + .../vs2019/Debug_x64/crashpad_handler.lib | 3 + .../vs2019/Debug_x64/crashpad_handler_cc.pdb | 3 + .../vs2019/Debug_x64/crashpad_minidump.lib | 3 + .../vs2019/Debug_x64/crashpad_minidump_cc.pdb | 3 + .../vs2019/Debug_x64/crashpad_snapshot.lib | 3 + .../vs2019/Debug_x64/crashpad_snapshot_cc.pdb | 3 + .../Debug_x64/crashpad_tool_support.lib | 3 + .../Debug_x64/crashpad_tool_support_cc.pdb | 3 + .../vs2019/Debug_x64/crashpad_util.lib | 3 + .../vs2019/Debug_x64/crashpad_util_cc.pdb | 3 + .../Debug_x64/third_party/getopt.cc.pdb | 3 + .../vs2019/Debug_x64/third_party/getopt.lib | 3 + .../vs2019/Debug_x64/third_party/zlib.c.pdb | 3 + .../vs2019/Debug_x64/third_party/zlib.lib | 3 + .../bin/windows/vs2019/Release_x64/base.lib | 3 + .../windows/vs2019/Release_x64/base_cc.pdb | 3 + .../vs2019/Release_x64/crashpad_client.lib | 3 + .../vs2019/Release_x64/crashpad_client_cc.pdb | 3 + .../vs2019/Release_x64/crashpad_compat.lib | 3 + .../vs2019/Release_x64/crashpad_compat_cc.pdb | 3 + .../vs2019/Release_x64/crashpad_context.lib | 3 + .../Release_x64/crashpad_context_cc.pdb | 3 + .../vs2019/Release_x64/crashpad_handler.lib | 3 + .../Release_x64/crashpad_handler_cc.pdb | 3 + .../vs2019/Release_x64/crashpad_minidump.lib | 3 + .../Release_x64/crashpad_minidump_cc.pdb | 3 + .../vs2019/Release_x64/crashpad_snapshot.lib | 3 + .../Release_x64/crashpad_snapshot_cc.pdb | 3 + .../Release_x64/crashpad_tool_support.lib | 3 + .../Release_x64/crashpad_tool_support_cc.pdb | 3 + .../vs2019/Release_x64/crashpad_util.lib | 3 + .../vs2019/Release_x64/crashpad_util_cc.pdb | 3 + .../Release_x64/third_party/getopt.cc.pdb | 3 + .../vs2019/Release_x64/third_party/getopt.lib | 3 + .../vs2019/Release_x64/third_party/zlib.c.pdb | 3 + .../vs2019/Release_x64/third_party/zlib.lib | 3 + .../handler/src/crash_report_upload_thread.cc | 8 +- .../Crashpad/include/client/crashpad_client.h | 5 +- Tools/LyTestTools/README.txt | 4 +- .../_internal/managers/workspace.py | 12 +- .../ly_test_tools/log/log_monitor.py | 2 +- .../{lumberyard => o3de}/__init__.py | 0 .../{lumberyard => o3de}/ap_log_parser.py | 0 .../{lumberyard => o3de}/asset_processor.py | 4 +- .../asset_processor_config_util.py | 4 +- .../asset_processor_utils.py | 0 .../ini_configuration_util.py | 0 .../{lumberyard => o3de}/pipeline_utils.py | 2 +- .../{lumberyard => o3de}/settings.py | 0 .../{lumberyard => o3de}/shader_compiler.py | 0 .../tests/unit/test_asset_processor.py | 38 +- .../tests/unit/test_launcher_android.py | 2 +- Tools/LyTestTools/tests/unit/test_settings.py | 32 +- .../tests/unit/test_shader_compiler.py | 34 +- .../build/Platform/Mac/build_config.json | 10 + cmake/3rdParty.cmake | 20 + .../Linux/BuiltInPackages_linux.cmake | 2 + .../Platform/Mac/BuiltInPackages_mac.cmake | 2 + .../Windows/BuiltInPackages_windows.cmake | 4 + .../Platform/Windows/Crashpad_windows.cmake | 5 +- cmake/3rdPartyPackages.cmake | 2 +- cmake/FindTargetTemplate.cmake | 45 + cmake/Findo3deTemplate.cmake | 35 + cmake/Install.cmake | 13 + cmake/LYWrappers.cmake | 82 +- cmake/LyAutoGen.cmake | 3 +- cmake/Platform/Android/Install_android.cmake | 12 + .../Android/platform_android_files.cmake | 2 + cmake/Platform/Common/Install_common.cmake | 284 ++++++ .../Common/MSVC/Configurations_msvc.cmake | 3 +- cmake/Platform/Linux/Install_linux.cmake | 12 + .../Platform/Linux/platform_linux_files.cmake | 2 + cmake/Platform/Mac/Install_mac.cmake | 21 + cmake/Platform/Mac/platform_mac_files.cmake | 1 + cmake/Platform/Windows/Install_windows.cmake | 12 + .../Windows/platform_windows_files.cmake | 2 + cmake/Platform/iOS/Install_ios.cmake | 21 + cmake/Platform/iOS/platform_ios_files.cmake | 1 + cmake/SettingsRegistry.cmake | 2 +- .../Tools/Platform/Android/android_support.py | 6 +- .../Android/generate_android_project.py | 2 +- cmake/UnitTest.cmake | 2 +- cmake/Version.cmake | 6 +- cmake/cmake_files.cmake | 1 + engine.json | 4 +- .../3rdParty/package_filelists/3rdParty.json | 2 +- .../package/Platform/Mac/package_env.json | 14 +- .../Mac/package_filelists/3rdParty.json | 82 ++ 904 files changed, 9299 insertions(+), 7167 deletions(-) create mode 100644 AutomatedTesting/AssetProcessorGamePlatformConfig.setreg create mode 100644 Code/Framework/AzFramework/AzFramework/Physics/RigidBody.h rename Code/Framework/AzQtComponents/AzQtComponents/Components/{LumberyardStylesheet.h => O3DEStylesheet.h} (85%) create mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Gallery/Gallery.ico create mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Gallery/Gallery.rc create mode 100644 Code/LauncherUnified/FindLauncherGenerator.cmake rename Code/LauncherUnified/Platform/Mac/{LumberyardApplication_Mac.mm => O3DEApplicationDelegate_Mac.mm} (80%) rename Code/LauncherUnified/Platform/Mac/{LumberyardApplication_Mac.h => O3DEApplication_Mac.h} (71%) rename Code/LauncherUnified/Platform/Mac/{LumberyardApplicationDelegate_Mac.mm => O3DEApplication_Mac.mm} (79%) create mode 100644 Code/LauncherUnified/launcher_generator.cmake delete mode 100644 Code/Sandbox/Editor/res/lyeditor.ico create mode 100644 Code/Sandbox/Editor/res/o3de_editor.ico create mode 100644 Code/Tools/AssetBundler/source/AssetBundlerBatch.ico create mode 100644 Code/Tools/AssetBundler/source/AssetBundlerBatch.rc create mode 100644 Code/Tools/AssetProcessor/AssetBuilder/AssetBuilder.ico create mode 100644 Code/Tools/AssetProcessor/AssetBuilder/AssetBuilder.rc create mode 100644 Code/Tools/AssetProcessor/Platform/Windows/AssetProcessorBatch.ico create mode 100644 Code/Tools/AssetProcessor/Platform/Windows/AssetProcessorBatch.rc delete mode 100644 Code/Tools/AssetProcessor/native/ui/style/lyassetprocessor.ico delete mode 100644 Code/Tools/AssetProcessor/native/ui/style/lyassetprocessor.png create mode 100644 Code/Tools/AssetProcessor/native/ui/style/o3de_assetprocessor.ico create mode 100644 Code/Tools/AssetProcessor/native/ui/style/o3de_assetprocessor.png create mode 100644 Code/Tools/DeltaCataloger/deltacataloger_win_files.cmake create mode 100644 Code/Tools/DeltaCataloger/source/DeltaCataloger.ico create mode 100644 Code/Tools/DeltaCataloger/source/DeltaCataloger.rc rename Gems/Atom/Feature/Common/Assets/Passes/{SpotLightShadowmaps.pass => ProjectedShadowmaps.pass} (91%) create mode 100644 Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/SimplePointLight.azsli create mode 100644 Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/SimpleSpotLight.azsli delete mode 100644 Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/SpotLight.azsli rename Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/{SpotLightShadow.azsli => ProjectedShadow.azsli} (73%) create mode 100644 Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/SimplePointLightFeatureProcessorInterface.h create mode 100644 Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/SimpleSpotLightFeatureProcessorInterface.h delete mode 100644 Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/SpotLightFeatureProcessorInterface.h create mode 100644 Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Shadows/ProjectedShadowFeatureProcessorInterface.h create mode 100644 Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/MultiSparseVector.h create mode 100644 Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/SparseVector.h rename Gems/Atom/Feature/Common/Code/Source/CoreLights/{SpotLightShadowmapsPass.cpp => ProjectedShadowmapsPass.cpp} (87%) rename Gems/Atom/Feature/Common/Code/Source/CoreLights/{SpotLightShadowmapsPass.h => ProjectedShadowmapsPass.h} (82%) create mode 100644 Gems/Atom/Feature/Common/Code/Source/CoreLights/SimplePointLightFeatureProcessor.cpp create mode 100644 Gems/Atom/Feature/Common/Code/Source/CoreLights/SimplePointLightFeatureProcessor.h create mode 100644 Gems/Atom/Feature/Common/Code/Source/CoreLights/SimpleSpotLightFeatureProcessor.cpp create mode 100644 Gems/Atom/Feature/Common/Code/Source/CoreLights/SimpleSpotLightFeatureProcessor.h delete mode 100644 Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightFeatureProcessor.cpp delete mode 100644 Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightFeatureProcessor.h create mode 100644 Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.cpp create mode 100644 Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.h create mode 100644 Gems/Atom/Feature/Common/Code/Tests/SparseVectorTests.cpp delete mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditor.ico create mode 100644 Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/MaterialEditor.ico rename Gems/Atom/Tools/MaterialEditor/Code/Source/{ => Platform/Windows}/MaterialEditor.rc (100%) create mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/ShaderManagementConsole.ico rename Gems/Atom/Tools/ShaderManagementConsole/Code/Source/{ => Platform/Windows}/ShaderManagementConsole.rc (100%) delete mode 100644 Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsole.ico delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/PointLightBus.h delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/PointLightComponentConfig.h delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/SpotLightBus.h delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/SpotLightComponentConfig.h delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorPointLightComponent.cpp delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorPointLightComponent.h delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorSpotLightComponent.cpp delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorSpotLightComponent.h delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponent.cpp delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponent.h delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponentController.cpp delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponentController.h create mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.cpp create mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.h create mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimpleSpotLightDelegate.cpp create mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimpleSpotLightDelegate.h delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponent.cpp delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponent.h delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponentConfig.cpp delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponentController.cpp delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponentController.h create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/base.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/base_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_client.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_client_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_compat.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_compat_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_context.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_context_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_handler.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_handler_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_minidump.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_minidump_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_snapshot.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_snapshot_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_tool_support.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_tool_support_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_util.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_util_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/getopt.cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/getopt.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/zlib.c.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/zlib.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/base.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/base_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_client.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_client_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_compat.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_compat_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_context.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_context_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_handler.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_handler_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_minidump.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_minidump_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_snapshot.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_snapshot_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_tool_support.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_tool_support_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_util.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_util_cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/getopt.cc.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/getopt.lib create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/zlib.c.pdb create mode 100644 Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/zlib.lib rename Tools/LyTestTools/ly_test_tools/{lumberyard => o3de}/__init__.py (100%) mode change 100755 => 100644 rename Tools/LyTestTools/ly_test_tools/{lumberyard => o3de}/ap_log_parser.py (100%) mode change 100755 => 100644 rename Tools/LyTestTools/ly_test_tools/{lumberyard => o3de}/asset_processor.py (99%) mode change 100755 => 100644 rename Tools/LyTestTools/ly_test_tools/{lumberyard => o3de}/asset_processor_config_util.py (98%) mode change 100755 => 100644 rename Tools/LyTestTools/ly_test_tools/{lumberyard => o3de}/asset_processor_utils.py (100%) mode change 100755 => 100644 rename Tools/LyTestTools/ly_test_tools/{lumberyard => o3de}/ini_configuration_util.py (100%) mode change 100755 => 100644 rename Tools/LyTestTools/ly_test_tools/{lumberyard => o3de}/pipeline_utils.py (99%) mode change 100755 => 100644 rename Tools/LyTestTools/ly_test_tools/{lumberyard => o3de}/settings.py (100%) mode change 100755 => 100644 rename Tools/LyTestTools/ly_test_tools/{lumberyard => o3de}/shader_compiler.py (100%) mode change 100755 => 100644 create mode 100644 cmake/FindTargetTemplate.cmake create mode 100644 cmake/Findo3deTemplate.cmake create mode 100644 cmake/Install.cmake create mode 100644 cmake/Platform/Android/Install_android.cmake create mode 100644 cmake/Platform/Common/Install_common.cmake create mode 100644 cmake/Platform/Linux/Install_linux.cmake create mode 100644 cmake/Platform/Mac/Install_mac.cmake create mode 100644 cmake/Platform/Windows/Install_windows.cmake create mode 100644 cmake/Platform/iOS/Install_ios.cmake create mode 100644 scripts/build/package/Platform/Mac/package_filelists/3rdParty.json diff --git a/AutomatedTesting/AssetProcessorGamePlatformConfig.setreg b/AutomatedTesting/AssetProcessorGamePlatformConfig.setreg new file mode 100644 index 0000000000..c9876cb1f9 --- /dev/null +++ b/AutomatedTesting/AssetProcessorGamePlatformConfig.setreg @@ -0,0 +1,14 @@ +{ + "Amazon": { + "AssetProcessor": { + "Settings": { + "RC cgf": { + "ignore": true + }, + "RC fbx": { + "ignore": true + } + } + } + } +} diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_external_project_setup_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_external_project_setup_fixture.py index 553427dd17..3297942775 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_external_project_setup_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_external_project_setup_fixture.py @@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Pytest fixture for standardizing key external project file locations. Houses a mock workspace for the external project. Only has enough information -to satisfy a ly_test_tools.lumberyard.asset_processor.AssetProcessor object. +to satisfy a ly_test_tools.o3de.asset_processor.AssetProcessor object. """ diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_fast_scan_setting_backup_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_fast_scan_setting_backup_fixture.py index c6f89f7cfa..91b68c99f2 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_fast_scan_setting_backup_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_fast_scan_setting_backup_fixture.py @@ -19,8 +19,8 @@ import logging # ly-shared import from automatedtesting_shared.platform_setting import PlatformSetting -from ly_test_tools.lumberyard.pipeline_utils import AP_FASTSCAN_KEY as fast_scan_key -from ly_test_tools.lumberyard.pipeline_utils import AP_FASTSCAN_SUBKEY as fast_scan_subkey +from ly_test_tools.o3de.pipeline_utils import AP_FASTSCAN_KEY as fast_scan_key +from ly_test_tools.o3de.pipeline_utils import AP_FASTSCAN_SUBKEY as fast_scan_subkey logger = logging.getLogger(__name__) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_idle_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_idle_fixture.py index aa90185d19..580cb025a7 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_idle_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_idle_fixture.py @@ -21,7 +21,7 @@ from . import ap_setup_fixture # Import LyTestTools import ly_test_tools.environment.waiter as waiter -from ly_test_tools.lumberyard.ap_log_parser import APLogParser +from ly_test_tools.o3de.ap_log_parser import APLogParser @pytest.mark.usefixtures("test_assets") diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_missing_dependency_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_missing_dependency_fixture.py index 091355ad4a..47bc2f4ec2 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_missing_dependency_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_missing_dependency_fixture.py @@ -21,7 +21,7 @@ from typing import Dict, List, Tuple, Any, Set from ly_test_tools.environment.file_system import create_backup, restore_backup, unlock_file from automatedtesting_shared import asset_database_utils as db_utils -from ly_test_tools.lumberyard.ap_log_parser import APLogParser +from ly_test_tools.o3de.ap_log_parser import APLogParser from . import ap_setup_fixture as ap_setup_fixture diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_setup_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_setup_fixture.py index 0b33a4a23b..aa233c517f 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_setup_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_setup_fixture.py @@ -16,7 +16,7 @@ import os import time import pytest from typing import Dict -from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP +from ly_test_tools.o3de.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP @pytest.fixture def ap_setup_fixture(request, workspace) -> Dict: diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/asset_processor_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/asset_processor_fixture.py index 36c724a269..fdccbae96d 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/asset_processor_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/asset_processor_fixture.py @@ -18,7 +18,7 @@ import pytest import logging # Import LyTestTools -import ly_test_tools.lumberyard.asset_processor as asset_processor_commands +import ly_test_tools.o3de.asset_processor as asset_processor_commands logger = logging.getLogger(__name__) @@ -28,7 +28,7 @@ def asset_processor(request: pytest.fixture, workspace: pytest.fixture) -> asset """ Sets up usage of the asset proc :param request: - :return: ly_test_tools.lumberyard.asset_processor.AssetProcessor + :return: ly_test_tools.03de.asset_processor.AssetProcessor """ # Initialize the Asset Processor diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py index 84b343710c..580816e7b5 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py @@ -26,8 +26,8 @@ from . import timeout_option_fixture as timeout from . import ap_config_backup_fixture as config_backup import ly_test_tools.environment.file_system as fs -import ly_test_tools.lumberyard.pipeline_utils as utils -from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP +import ly_test_tools.o3de.pipeline_utils as utils +from ly_test_tools.o3de.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP logger = logging.getLogger(__name__) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py index 7482911548..22288d0645 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/clear_moveoutput_fixture.py @@ -15,7 +15,7 @@ Fixture for clearing out 'MoveOutput' folders from \dev and \dev\PROJECT import pytest # Import ly_shared -import ly_test_tools.lumberyard.pipeline_utils as pipeline_utils +import ly_test_tools.o3de.pipeline_utils as pipeline_utils @pytest.fixture diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_builder_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_builder_tests.py index 6cdb955b9c..e3d52e8260 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_builder_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_builder_tests.py @@ -25,8 +25,8 @@ from ..ap_fixtures.asset_processor_fixture import asset_processor as asset_proce from ..ap_fixtures.ap_setup_fixture import ap_setup_fixture as ap_setup_fixture # Import LyShared -import ly_test_tools.lumberyard.pipeline_utils as utils -from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP +import ly_test_tools.o3de.pipeline_utils as utils +from ly_test_tools.o3de.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP # Use the following logging pattern to hook all test logging together: logger = logging.getLogger(__name__) # Configuring the logging is done in ly_test_tools at the following location: diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py index 98d364ee1c..d236e87aa2 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_bundler_batch_tests.py @@ -36,8 +36,8 @@ from ..ap_fixtures.bundler_batch_setup_fixture \ from ..ap_fixtures.ap_config_backup_fixture import ap_config_backup_fixture as config_backup # Import LyShared -import ly_test_tools.lumberyard.pipeline_utils as utils -from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP +import ly_test_tools.o3de.pipeline_utils as utils +from ly_test_tools.o3de.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP win_and_mac_platforms = [ASSET_PROCESSOR_PLATFORM_MAP['windows'], ASSET_PROCESSOR_PLATFORM_MAP['mac']] diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_dependency_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_dependency_tests.py index ba5b65e33d..cfd088adc0 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_dependency_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_dependency_tests.py @@ -24,8 +24,8 @@ from ..ap_fixtures.ap_setup_fixture import ap_setup_fixture as ap_setup_fixture # Import LyShared from automatedtesting_shared import file_utils as file_utils -from ly_test_tools.lumberyard.ap_log_parser import APLogParser, APOutputParser -import ly_test_tools.lumberyard.pipeline_utils as utils +from ly_test_tools.o3de.ap_log_parser import APLogParser, APOutputParser +import ly_test_tools.o3de.pipeline_utils as utils # Use the following logging pattern to hook all test logging together: logger = logging.getLogger(__name__) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_dependency_tests2.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_dependency_tests2.py index b5e21ec0f8..4f33e0df4e 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_dependency_tests2.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_dependency_tests2.py @@ -24,8 +24,8 @@ from ..ap_fixtures.ap_setup_fixture import ap_setup_fixture as ap_setup_fixture # Import LyShared from automatedtesting_shared import file_utils as file_utils -from ly_test_tools.lumberyard.ap_log_parser import APLogParser, APOutputParser -import ly_test_tools.lumberyard.pipeline_utils as utils +from ly_test_tools.o3de.ap_log_parser import APLogParser, APOutputParser +import ly_test_tools.o3de.pipeline_utils as utils # Use the following logging pattern to hook all test logging together: logger = logging.getLogger(__name__) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests.py index b98853a699..50b3af1438 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests.py @@ -18,7 +18,7 @@ import os import stat # Import LyTestTools -from ly_test_tools.lumberyard import asset_processor as asset_processor_utils +from ly_test_tools.o3de import asset_processor as asset_processor_utils # Import fixtures from ..ap_fixtures.asset_processor_fixture import asset_processor as asset_processor @@ -26,8 +26,8 @@ from ..ap_fixtures.ap_setup_fixture import ap_setup_fixture as ap_setup_fixture # Import LyShared -from ly_test_tools.lumberyard.ap_log_parser import APLogParser, APOutputParser -import ly_test_tools.lumberyard.pipeline_utils as utils +from ly_test_tools.o3de.ap_log_parser import APLogParser, APOutputParser +import ly_test_tools.o3de.pipeline_utils as utils # Use the following logging pattern to hook all test logging together: logger = logging.getLogger(__name__) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests_2.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests_2.py index 79ad23de92..5c42af2139 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests_2.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests_2.py @@ -19,8 +19,8 @@ import subprocess # Import LyTestTools -from ly_test_tools.lumberyard.asset_processor import AssetProcessor -from ly_test_tools.lumberyard import asset_processor as asset_processor_utils +from ly_test_tools.o3de.asset_processor import AssetProcessor +from ly_test_tools.o3de import asset_processor as asset_processor_utils import ly_test_tools.environment.file_system as fs # Import fixtures @@ -29,8 +29,8 @@ from ..ap_fixtures.ap_setup_fixture import ap_setup_fixture as ap_setup_fixture # Import LyShared -from ly_test_tools.lumberyard.ap_log_parser import APLogParser, APOutputParser -import ly_test_tools.lumberyard.pipeline_utils as utils +from ly_test_tools.o3de.ap_log_parser import APLogParser, APOutputParser +import ly_test_tools.o3de.pipeline_utils as utils # Use the following logging pattern to hook all test logging together: logger = logging.getLogger(__name__) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_gui_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_gui_tests.py index aecb1ac657..ed5651755c 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_gui_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_gui_tests.py @@ -25,8 +25,8 @@ import ly_test_tools.environment.waiter as waiter import ly_test_tools.environment.file_system as fs import ly_test_tools.environment.process_utils as process_utils import ly_test_tools.launchers.launcher_helper as launcher_helper -from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP -from ly_test_tools.lumberyard.asset_processor import AssetProcessorError +from ly_test_tools.o3de.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP +from ly_test_tools.o3de.asset_processor import AssetProcessorError # Import fixtures from ..ap_fixtures.asset_processor_fixture import asset_processor as asset_processor @@ -38,7 +38,7 @@ from ..ap_fixtures.ap_fast_scan_setting_backup_fixture import ( # Import LyShared -import ly_test_tools.lumberyard.pipeline_utils as utils +import ly_test_tools.o3de.pipeline_utils as utils # Use the following logging pattern to hook all test logging together: logger = logging.getLogger(__name__) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_gui_tests_2.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_gui_tests_2.py index 47dfaa6e8a..7c7b6b2452 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_gui_tests_2.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_gui_tests_2.py @@ -25,7 +25,7 @@ import ly_test_tools.environment.waiter as waiter import ly_test_tools.environment.file_system as fs import ly_test_tools.environment.process_utils as process_utils import ly_test_tools.launchers.launcher_helper as launcher_helper -from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP, ASSET_PROCESSOR_SETTINGS_ROOT_KEY +from ly_test_tools.o3de.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP, ASSET_PROCESSOR_SETTINGS_ROOT_KEY # Import fixtures from ..ap_fixtures.asset_processor_fixture import asset_processor as asset_processor @@ -37,7 +37,7 @@ from ..ap_fixtures.ap_fast_scan_setting_backup_fixture import ( # Import LyShared -import ly_test_tools.lumberyard.pipeline_utils as utils +import ly_test_tools.o3de.pipeline_utils as utils # Use the following logging pattern to hook all test logging together: logger = logging.getLogger(__name__) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_relocator_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_relocator_tests.py index 350885d7b5..2d3872bf31 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_relocator_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_relocator_tests.py @@ -26,8 +26,8 @@ from typing import List import ly_test_tools.builtin.helpers as helpers import ly_test_tools.environment.file_system as fs import ly_test_tools.environment.process_utils as process_utils -from ly_test_tools.lumberyard import asset_processor as asset_processor_utils -from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP +from ly_test_tools.o3de import asset_processor as asset_processor_utils +from ly_test_tools.o3de.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP # Import fixtures from ..ap_fixtures.asset_processor_fixture import asset_processor as asset_processor @@ -37,7 +37,7 @@ from ..ap_fixtures.clear_moveoutput_fixture import clear_moveoutput_fixture as c from ..ap_fixtures.clear_testingAssets_dir import clear_testingAssets_dir as clear_testingAssets_dir # Import LyShared -import ly_test_tools.lumberyard.pipeline_utils as utils +import ly_test_tools.o3de.pipeline_utils as utils # Use the following logging pattern to hook all test logging together: logger = logging.getLogger(__name__) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/missing_dependency_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/missing_dependency_tests.py index bc77458ce1..6cc3484d96 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/missing_dependency_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/missing_dependency_tests.py @@ -20,8 +20,8 @@ from typing import List, Tuple from ..ap_fixtures.asset_processor_fixture import asset_processor from ..ap_fixtures.ap_setup_fixture import ap_setup_fixture -from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP -from ly_test_tools.lumberyard import asset_processor as asset_processor_utils +from ly_test_tools.o3de.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP +from ly_test_tools.o3de import asset_processor as asset_processor_utils # fmt:off from ..ap_fixtures.ap_missing_dependency_fixture \ @@ -32,7 +32,7 @@ from ..ap_fixtures.ap_missing_dependency_fixture \ import ly_test_tools.builtin.helpers as helpers # Import LyShared -import ly_test_tools.lumberyard.pipeline_utils as utils +import ly_test_tools.o3de.pipeline_utils as utils from automatedtesting_shared import asset_database_utils as db_utils # Use the following logging pattern to hook all test logging together: diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/auxiliary_content_tests/auxiliary_content_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/auxiliary_content_tests/auxiliary_content_tests.py index 8dca973285..7e9f65de60 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/auxiliary_content_tests/auxiliary_content_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/auxiliary_content_tests/auxiliary_content_tests.py @@ -19,7 +19,7 @@ import subprocess import glob from ly_test_tools.builtin.helpers import * from ly_test_tools.environment.process_utils import * -from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP +from ly_test_tools.o3de.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP logger = logging.getLogger(__name__) diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/fbx_tests/fbx_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/fbx_tests/fbx_tests.py index 594827ee76..b66984666b 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/fbx_tests/fbx_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/fbx_tests/fbx_tests.py @@ -18,8 +18,8 @@ from typing import List # Import LyTestTools import ly_test_tools.builtin.helpers as helpers -from ly_test_tools.lumberyard import asset_processor as asset_processor_utils -from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP +from ly_test_tools.o3de import asset_processor as asset_processor_utils +from ly_test_tools.o3de.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP # Import fixtures from ..ap_fixtures.asset_processor_fixture import asset_processor as asset_processor @@ -29,7 +29,7 @@ from ..ap_fixtures.ap_config_default_platform_fixture import ap_config_default_p # Import LyShared -import ly_test_tools.lumberyard.pipeline_utils as utils +import ly_test_tools.o3de.pipeline_utils as utils from automatedtesting_shared import asset_database_utils as asset_db_utils logger = logging.getLogger(__name__) diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/asset_database_utils.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/asset_database_utils.py index 190fdc711e..75df510db1 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/asset_database_utils.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/asset_database_utils.py @@ -16,7 +16,7 @@ import sqlite3 import os from typing import List -import ly_test_tools.lumberyard.pipeline_utils as pipeline_utils +import ly_test_tools.o3de.pipeline_utils as pipeline_utils # Index for ProductID in Products table in DB PRODUCT_ID_INDEX = 0 diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/asset_utils.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/asset_utils.py index 722b0aa0be..1fe2771370 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/asset_utils.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/asset_utils.py @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # Built-in Imports from __future__ import annotations -# Lumberyard Imports +# Open 3D Engine Imports import azlmbr.bus as bus import azlmbr.asset as azasset import azlmbr.math as math diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py index e3ef1a3ab4..1887d5736e 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py @@ -20,7 +20,7 @@ import ly_test_tools.environment.file_system as file_system import ly_test_tools.environment.process_utils as process_utils import ly_test_tools.environment.waiter as waiter -from ly_test_tools.lumberyard.asset_processor import AssetProcessor +from ly_test_tools.o3de.asset_processor import AssetProcessor from ly_test_tools.launchers.exceptions import WaitTimeoutError from ly_test_tools.log.log_monitor import LogMonitor, LogMonitorException diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/editor_entity_utils.py index cd78409b72..3e009563b8 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/editor_entity_utils.py @@ -16,7 +16,7 @@ from typing import List, Tuple, Union # Helper file Imports import utils -# Lumberyard Imports +# Open 3D Engine Imports import azlmbr import azlmbr.bus as bus import azlmbr.editor as editor diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/editor_test_helper.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/editor_test_helper.py index 16acac0808..64a19aafdf 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/editor_test_helper.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/editor_test_helper.py @@ -17,7 +17,7 @@ import time from typing import Sequence from .report import Report -# Lumberyard specific imports +# Open 3D Engine specific imports import azlmbr.legacy.general as general import azlmbr.legacy.settings as settings diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/hydra_editor_utils.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/hydra_editor_utils.py index 77236797c7..05614296b1 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/hydra_editor_utils.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/hydra_editor_utils.py @@ -296,8 +296,8 @@ def get_set_test(entity: object, component_index: int, path: str, value: object) def get_set_property_test(ly_object: object, attribute_name: str, value: object, expected_result: object = None) -> bool: """ - Used to set and validate BehaviorContext property changes in Lumberyard objects - :param ly_object: The lumberyard object to test + Used to set and validate BehaviorContext property changes in Open 3D Engine objects + :param ly_object: The Open 3D Engine object to test :param attribute_name: property (attribute) name in the BehaviorContext :param value: new value for the variable being changed in the component :param expected_result: (optional) check the result against a specific expected value other than the one set @@ -410,7 +410,7 @@ def set_editor_settings_by_path(path, value, is_bool = False): def get_component_type_id_map(component_name_list): """ Given a list of component names, returns a map of component name -> component type id - :param component_name_list: The lumberyard object to test + :param component_name_list: The Open 3D Engine object to test :return: Dictionary of component name -> component type id pairs """ # Remove any duplicates so we don't have to query for the same TypeId diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/platform_setting.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/platform_setting.py index a0eccde29a..c5596d280b 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/platform_setting.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/platform_setting.py @@ -16,7 +16,7 @@ import pytest import logging from typing import Optional, Any -import ly_test_tools.lumberyard.pipeline_utils as utils +import ly_test_tools.o3de.pipeline_utils as utils logger = logging.getLogger(__name__) diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py index 3186eac245..6dc59d9be0 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py @@ -57,7 +57,7 @@ class AssetBrowserSearchFilteringTest(EditorTestHelper): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py index 0a9ec689bd..dc0565d100 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py @@ -49,7 +49,7 @@ class AssetBrowserTreeNavigationTest(EditorTestHelper): 6) Verify if the ScrollBar appears after expanding the tree Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py index f5c61d10f4..cdc204043e 100755 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/ComponentCRUD_Add_Delete_Components.py @@ -58,7 +58,7 @@ class AddDeleteComponentsTest(EditorTestHelper): 7) Undo deletion of component Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py index 7393153f45..d6d284664a 100755 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/InputBindings_Add_Remove_Input_Events.py @@ -58,7 +58,7 @@ class AddRemoveInputEventsTest(EditorTestHelper): 10) Close Asset Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude.py index cac5cdd42b..673e473390 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ComponentAndOverrides_InstancesPlantAtSpecifiedAltitude.py @@ -55,7 +55,7 @@ class TestAltitudeFilterComponentAndOverrides(EditorTestHelper): 8) Instance counts post-filter are verified. Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude.py index 7325a75d72..7e76a80cc4 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_ShapeSample_InstancesPlantAtSpecifiedAltitude.py @@ -48,7 +48,7 @@ class TestAltitudeFilterShapeSample(EditorTestHelper): 6) Instance counts post-filter are verified. Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea.py index 96338a9ab2..786348bcc6 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetListCombiner_CombinedDescriptorsExpressInConfiguredArea.py @@ -57,7 +57,7 @@ class TestAssetListCombiner(EditorTestHelper): Combiner component to force a refresh, and validate instance count Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetWeightSelector_InstancesExpressBasedOnWeight.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetWeightSelector_InstancesExpressBasedOnWeight.py index a1369706f6..85d4edfe6d 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetWeightSelector_InstancesExpressBasedOnWeight.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AssetWeightSelector_InstancesExpressBasedOnWeight.py @@ -52,7 +52,7 @@ class TestAssetWeightSelectorSortByWeight(EditorTestHelper): 8) Change sort values and validate instance count Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius.py index 9212cf4f9b..82b2fc8407 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilterOverrides_InstancesPlantAtSpecifiedRadius.py @@ -44,7 +44,7 @@ class TestDistanceBetweenFilterComponentOverrides(EditorTestHelper): expected instance counts with a few different Radius values Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius.py index ce2869bf8a..9f15215358 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DistanceBetweenFilter_InstancesPlantAtSpecifiedRadius.py @@ -42,7 +42,7 @@ class TestDistanceBetweenFilterComponent(EditorTestHelper): 5-8) Add the Distance Between Filter, and validate expected instance counts with a few different Radius values Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py index b9940eab87..f25fbb2b6d 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py @@ -49,7 +49,7 @@ class TestDynamicSliceInstanceSpawnerEmbeddedEditor(EditorTestHelper): 6) Save and export to engine Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py index e87a341cca..8af75f2d17 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py @@ -49,7 +49,7 @@ class TestDynamicSliceInstanceSpawnerExternalEditor(EditorTestHelper): 6) Save and export to engine Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/InstanceSpawnerPriority_LayerAndSubPriority.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/InstanceSpawnerPriority_LayerAndSubPriority.py index 583801f83c..507d8f505e 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/InstanceSpawnerPriority_LayerAndSubPriority.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/InstanceSpawnerPriority_LayerAndSubPriority.py @@ -49,7 +49,7 @@ class TestInstanceSpawnerPriority(EditorTestHelper): 6) Validate instance counts in the spawner area Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py index 5a290782cc..2e6992d7e2 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py @@ -59,7 +59,7 @@ class TestVegLayerBlenderCreated(EditorTestHelper): 7) Export to engine Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlocker_InstancesBlockedInConfiguredArea.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlocker_InstancesBlockedInConfiguredArea.py index c542d6a4a2..53c29344e1 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlocker_InstancesBlockedInConfiguredArea.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlocker_InstancesBlockedInConfiguredArea.py @@ -48,7 +48,7 @@ class TestLayerBlocker(EditorTestHelper): 7. Post-blocker instance counts are validated Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_DependentOnMeshComponent.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_DependentOnMeshComponent.py index 0495b9f428..a5d04a3b6a 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_DependentOnMeshComponent.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_DependentOnMeshComponent.py @@ -45,7 +45,7 @@ class TestMeshSurfaceTagEmitter(EditorTestHelper): 5) Make sure Mesh Surface Tag Emitter is enabled after adding Mesh Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py index 26aaf2d1f2..e0011ea28f 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py @@ -42,7 +42,7 @@ class TestMeshSurfaceTagEmitter(EditorTestHelper): 3) Add/ remove Surface Tags Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_AutoSnapToSurfaceWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_AutoSnapToSurfaceWorks.py index 5d8a070fff..d2d112907a 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_AutoSnapToSurfaceWorks.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_AutoSnapToSurfaceWorks.py @@ -50,7 +50,7 @@ class TestPositionModifierAutoSnapToSurface(EditorTestHelper): 8) Validate instance counts on top of and inside the sphere mesh with Auto Snap to Surface disabled Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets.py index 144d1484ed..bd2a2df16f 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/PositionModifier_ComponentAndOverrides_InstancesPlantAtSpecifiedOffsets.py @@ -52,7 +52,7 @@ class TestPositionModifierComponentAndOverrides(EditorTestHelper): are validated Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_InstancesPlantInAssignedShape.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_InstancesPlantInAssignedShape.py index 1837d533a4..4d904e9623 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_InstancesPlantInAssignedShape.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/ShapeIntersectionFilter_InstancesPlantInAssignedShape.py @@ -52,7 +52,7 @@ class TestShapeIntersectionFilter(EditorTestHelper): 7) Remove the shape reference on the Intersection Filter and validate instance counts Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope.py index 1f2b0dbdb6..6f3b1d5629 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlope.py @@ -55,7 +55,7 @@ class TestSlopeFilterComponentAndOverrides(EditorTestHelper): 9) Instance counts are validated Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected.py index 3e03b0b585..b164d34973 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilterOverrides_MultipleDescriptorOverridesPlantAsExpected.py @@ -51,7 +51,7 @@ class TestSurfaceMaskFilterMultipleOverrides(EditorTestHelper): 7) Test 3 setup and validation: Inclusion tag matching surface c is set on a single descriptor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py index 8e36e1aa1d..868d9d08e3 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py @@ -65,7 +65,7 @@ class TestGradientPreviewSettings(EditorTestHelper): 10) Create entity with Perlin Noise Gradient and verify gradient position after clearing pinned entity Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSampling_GradientReferencesAddRemoveSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSampling_GradientReferencesAddRemoveSuccessfully.py index 5581bb32e4..d94c197fea 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSampling_GradientReferencesAddRemoveSuccessfully.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSampling_GradientReferencesAddRemoveSuccessfully.py @@ -42,7 +42,7 @@ class TestGradientSampling(EditorTestHelper): field in Gradient Modifier Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py index b82dbe7ab8..a37ae97361 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py @@ -42,7 +42,7 @@ class TestGradientSurfaceTagEmitter(EditorTestHelper): 3) Add/ remove Surface Tags Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithExpectedGradients.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithExpectedGradients.py index a55fd7a843..31f0ee2693 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithExpectedGradients.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithExpectedGradients.py @@ -48,7 +48,7 @@ class TestGradientTransform_ComponentIncompatibleWithExpectedGradients(EditorTes 5) Make sure all newly added components are disabled Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithSpawners.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithSpawners.py index 9c2fd3b9b9..0542e5e1b4 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithSpawners.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_ComponentIncompatibleWithSpawners.py @@ -46,7 +46,7 @@ class TestGradientTransform_ComponentIncompatibleWithSpawners(EditorTestHelper): 5) Make sure newly added component is disabled Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py index b53a328c52..22518e61be 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py @@ -48,7 +48,7 @@ class TestGradientTransformFrequencyZoom(EditorTestHelper): 5) Verify if the frequency value is set to higher value Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_ProcessedImageAssignedSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_ProcessedImageAssignedSuccessfully.py index 337f412719..6b4a8bf17c 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_ProcessedImageAssignedSuccessfully.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_ProcessedImageAssignedSuccessfully.py @@ -45,7 +45,7 @@ class TestImageGradient(EditorTestHelper): 3) Assign the newly processed gradient image as Image asset. Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12712452_ScriptCanvas_CollisionEvents.py b/AutomatedTesting/Gem/PythonTests/physics/C12712452_ScriptCanvas_CollisionEvents.py index c32acf1daa..e5cee76415 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C12712452_ScriptCanvas_CollisionEvents.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C12712452_ScriptCanvas_CollisionEvents.py @@ -62,7 +62,7 @@ def C12712452_ScriptCanvas_CollisionEvents(): 8) Exit game mode and close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py b/AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py index eccde91046..808f1e4c31 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C12712454_ScriptCanvas_OverlapNodeVerification.py @@ -93,7 +93,7 @@ def C12712454_ScriptCanvas_OverlapNodeVerification(): 13) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12712455_ScriptCanvas_ShapeCastVerification.py b/AutomatedTesting/Gem/PythonTests/physics/C12712455_ScriptCanvas_ShapeCastVerification.py index 1092c94cc5..a5c827edb9 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C12712455_ScriptCanvas_ShapeCastVerification.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C12712455_ScriptCanvas_ShapeCastVerification.py @@ -63,7 +63,7 @@ def C12712455_ScriptCanvas_ShapeCastVerification(): 8) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py b/AutomatedTesting/Gem/PythonTests/physics/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py index 22f63ab582..b84adcd246 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude.py @@ -82,7 +82,7 @@ def C12868578_ForceRegion_DirectionHasNoAffectOnMagnitude(): 8) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12868580_ForceRegion_SplineModifiedTransform.py b/AutomatedTesting/Gem/PythonTests/physics/C12868580_ForceRegion_SplineModifiedTransform.py index b27aaf09db..481c1fa43c 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C12868580_ForceRegion_SplineModifiedTransform.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C12868580_ForceRegion_SplineModifiedTransform.py @@ -69,7 +69,7 @@ def C12868580_ForceRegion_SplineModifiedTransform(): 7) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12905527_ForceRegion_MagnitudeDeviation.py b/AutomatedTesting/Gem/PythonTests/physics/C12905527_ForceRegion_MagnitudeDeviation.py index d8fb9a67e0..a9fb92b4fa 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C12905527_ForceRegion_MagnitudeDeviation.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C12905527_ForceRegion_MagnitudeDeviation.py @@ -49,7 +49,7 @@ def C12905527_ForceRegion_MagnitudeDeviation(): 7) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C12905528_ForceRegion_WithNonTriggerCollider.py b/AutomatedTesting/Gem/PythonTests/physics/C12905528_ForceRegion_WithNonTriggerCollider.py index a555176381..d3fe35b1cd 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C12905528_ForceRegion_WithNonTriggerCollider.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C12905528_ForceRegion_WithNonTriggerCollider.py @@ -41,7 +41,7 @@ def run(): 6) Verify there is warning in the logs Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C13351703_COM_NotIncludeTriggerShapes.py b/AutomatedTesting/Gem/PythonTests/physics/C13351703_COM_NotIncludeTriggerShapes.py index adfbce0ebf..d4bbdca52f 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C13351703_COM_NotIncludeTriggerShapes.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C13351703_COM_NotIncludeTriggerShapes.py @@ -50,7 +50,7 @@ def C13351703_COM_NotIncludeTriggerShapes(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test critical_results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C13895144_Ragdoll_ChangeLevel.py b/AutomatedTesting/Gem/PythonTests/physics/C13895144_Ragdoll_ChangeLevel.py index 729cc9c9cc..db497dabc6 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C13895144_Ragdoll_ChangeLevel.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C13895144_Ragdoll_ChangeLevel.py @@ -54,7 +54,7 @@ def C13895144_Ragdoll_ChangeLevel(): 9) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14195074_ScriptCanvas_PostUpdateEvent.py b/AutomatedTesting/Gem/PythonTests/physics/C14195074_ScriptCanvas_PostUpdateEvent.py index 4beca8845d..4837de3538 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C14195074_ScriptCanvas_PostUpdateEvent.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C14195074_ScriptCanvas_PostUpdateEvent.py @@ -57,7 +57,7 @@ def C14195074_ScriptCanvas_PostUpdateEvent(): 11) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14654882_Ragdoll_ragdollAPTest.py b/AutomatedTesting/Gem/PythonTests/physics/C14654882_Ragdoll_ragdollAPTest.py index 97d83dae62..2bc620e0c1 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C14654882_Ragdoll_ragdollAPTest.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C14654882_Ragdoll_ragdollAPTest.py @@ -65,7 +65,7 @@ def C14654882_Ragdoll_ragdollAPTest(): 5.3) Search the recorded lines for an Unexpected Line Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861500_DefaultSetting_ColliderShape.py b/AutomatedTesting/Gem/PythonTests/physics/C14861500_DefaultSetting_ColliderShape.py index 5c6c4c219d..43d4d0e905 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C14861500_DefaultSetting_ColliderShape.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C14861500_DefaultSetting_ColliderShape.py @@ -37,7 +37,7 @@ def C14861500_DefaultSetting_ColliderShape(): 4) Check value of Shape property on PhysX Collider Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -51,7 +51,7 @@ def C14861500_DefaultSetting_ColliderShape(): from utils import TestHelper as helper from editor_entity_utils import EditorEntity as Entity - # Lumberyard Imports + # Open 3D Engine Imports import azlmbr.legacy.general as general PHYSICS_ASSET_INDEX = 7 # Hardcoded enum index value for Shape property diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861501_PhysXCollider_RenderMeshAutoAssigned.py b/AutomatedTesting/Gem/PythonTests/physics/C14861501_PhysXCollider_RenderMeshAutoAssigned.py index faa7618e7b..a7fc5cf3b5 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C14861501_PhysXCollider_RenderMeshAutoAssigned.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C14861501_PhysXCollider_RenderMeshAutoAssigned.py @@ -42,7 +42,7 @@ def run(): 6) The physics asset in PhysX Collider component is auto-assigned. Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861502_PhysXCollider_AssetAutoAssigned.py b/AutomatedTesting/Gem/PythonTests/physics/C14861502_PhysXCollider_AssetAutoAssigned.py index b4d92e3691..94c1d8e404 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C14861502_PhysXCollider_AssetAutoAssigned.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C14861502_PhysXCollider_AssetAutoAssigned.py @@ -41,7 +41,7 @@ def C14861502_PhysXCollider_AssetAutoAssigned(): 6) The physics asset in PhysX Collider component is auto-assigned. Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -59,7 +59,7 @@ def C14861502_PhysXCollider_AssetAutoAssigned(): from editor_entity_utils import EditorEntity as Entity from asset_utils import Asset - # Lumberyard Imports + # Open 3D Engine Imports import azlmbr.legacy.general as general MESH_ASSET_PATH = os.path.join("Objects", "SphereBot", "r0-b_body.cgf") diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14861504_RenderMeshAsset_WithNoPxAsset.py b/AutomatedTesting/Gem/PythonTests/physics/C14861504_RenderMeshAsset_WithNoPxAsset.py index aa2fff43cf..0a6962a31c 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C14861504_RenderMeshAsset_WithNoPxAsset.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C14861504_RenderMeshAsset_WithNoPxAsset.py @@ -46,7 +46,7 @@ def run(): 7) Enter GameMode and check for warnings Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -65,7 +65,7 @@ def run(): from editor_entity_utils import EditorEntity as Entity from asset_utils import Asset - # Lumberyard Imports + # Open 3D Engine Imports import azlmbr.asset as azasset # Asset paths diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14902097_ScriptCanvas_PreUpdateEvent.py b/AutomatedTesting/Gem/PythonTests/physics/C14902097_ScriptCanvas_PreUpdateEvent.py index 4c9c7de263..ea62be9768 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C14902097_ScriptCanvas_PreUpdateEvent.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C14902097_ScriptCanvas_PreUpdateEvent.py @@ -59,7 +59,7 @@ def C14902097_ScriptCanvas_PreUpdateEvent(): 11) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14902098_ScriptCanvas_PostPhysicsUpdate.py b/AutomatedTesting/Gem/PythonTests/physics/C14902098_ScriptCanvas_PostPhysicsUpdate.py index 669ff3d84d..fc3ae2bc18 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C14902098_ScriptCanvas_PostPhysicsUpdate.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C14902098_ScriptCanvas_PostPhysicsUpdate.py @@ -70,7 +70,7 @@ def C14902098_ScriptCanvas_PostPhysicsUpdate(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14976307_Gravity_SetGravityWorks.py b/AutomatedTesting/Gem/PythonTests/physics/C14976307_Gravity_SetGravityWorks.py index b38dde5fc8..33a26d9433 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C14976307_Gravity_SetGravityWorks.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C14976307_Gravity_SetGravityWorks.py @@ -55,7 +55,7 @@ def C14976307_Gravity_SetGravityWorks(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C14976308_ScriptCanvas_SetKinematicTargetTransform.py b/AutomatedTesting/Gem/PythonTests/physics/C14976308_ScriptCanvas_SetKinematicTargetTransform.py index 9b065af7ce..ea01c71310 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C14976308_ScriptCanvas_SetKinematicTargetTransform.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C14976308_ScriptCanvas_SetKinematicTargetTransform.py @@ -86,7 +86,7 @@ def C14976308_ScriptCanvas_SetKinematicTargetTransform(): 13) Exit game mode and close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py b/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py index 29975456db..f637981b1d 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py @@ -95,7 +95,7 @@ def C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after(): 5) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py b/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py index ea77a083ff..fcbc0ff723 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before.py @@ -88,7 +88,7 @@ def C15096732_Material_DefaultLibraryUpdatedAcrossLevels_before(): 4) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096735_Materials_DefaultLibraryConsistency.py b/AutomatedTesting/Gem/PythonTests/physics/C15096735_Materials_DefaultLibraryConsistency.py index 757e598ed0..f393ddf527 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C15096735_Materials_DefaultLibraryConsistency.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C15096735_Materials_DefaultLibraryConsistency.py @@ -136,7 +136,7 @@ def C15096735_Materials_DefaultLibraryConsistency(): 4) Exit game mode / Close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15096740_Material_LibraryUpdatedCorrectly.py b/AutomatedTesting/Gem/PythonTests/physics/C15096740_Material_LibraryUpdatedCorrectly.py index 5ff8a8110b..c69b722e27 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C15096740_Material_LibraryUpdatedCorrectly.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C15096740_Material_LibraryUpdatedCorrectly.py @@ -44,7 +44,7 @@ def C15096740_Material_LibraryUpdatedCorrectly(): 6) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -63,7 +63,7 @@ def C15096740_Material_LibraryUpdatedCorrectly(): from editor_entity_utils import EditorEntity from asset_utils import Asset - # Lumberyard Imports + # Open 3D Engine Imports import azlmbr.asset as azasset # Constants diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15308217_NoCrash_LevelSwitch.py b/AutomatedTesting/Gem/PythonTests/physics/C15308217_NoCrash_LevelSwitch.py index 102d452076..998d21067b 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C15308217_NoCrash_LevelSwitch.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C15308217_NoCrash_LevelSwitch.py @@ -57,7 +57,7 @@ def C15308217_NoCrash_LevelSwitch(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15308221_Material_ComponentsInSyncWithLibrary.py b/AutomatedTesting/Gem/PythonTests/physics/C15308221_Material_ComponentsInSyncWithLibrary.py index 6364329ce0..a6ddb73438 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C15308221_Material_ComponentsInSyncWithLibrary.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C15308221_Material_ComponentsInSyncWithLibrary.py @@ -101,7 +101,7 @@ def C15308221_Material_ComponentsInSyncWithLibrary(): 7) Close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15425935_Material_LibraryUpdatedAcrossLevels.py b/AutomatedTesting/Gem/PythonTests/physics/C15425935_Material_LibraryUpdatedAcrossLevels.py index 5b6e803ade..d2db2239c2 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C15425935_Material_LibraryUpdatedAcrossLevels.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C15425935_Material_LibraryUpdatedAcrossLevels.py @@ -108,7 +108,7 @@ def C15425935_Material_LibraryUpdatedAcrossLevels(): 4) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15563573_Material_AddModifyDeleteOnCharacterController.py b/AutomatedTesting/Gem/PythonTests/physics/C15563573_Material_AddModifyDeleteOnCharacterController.py index 8aaac05f15..8b0fba05b1 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C15563573_Material_AddModifyDeleteOnCharacterController.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C15563573_Material_AddModifyDeleteOnCharacterController.py @@ -103,7 +103,7 @@ def C15563573_Material_AddModifyDeleteOnCharacterController(): to change in mesh surfaces, during the game mode. - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C15845879_ForceRegion_HighLinearDampingForce.py b/AutomatedTesting/Gem/PythonTests/physics/C15845879_ForceRegion_HighLinearDampingForce.py index 725dd0e136..2eb7759ead 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C15845879_ForceRegion_HighLinearDampingForce.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C15845879_ForceRegion_HighLinearDampingForce.py @@ -52,7 +52,7 @@ def C15845879_ForceRegion_HighLinearDampingForce(): 8) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C17411467_AddPhysxRagdollComponent.py b/AutomatedTesting/Gem/PythonTests/physics/C17411467_AddPhysxRagdollComponent.py index 8b5af5df99..a3115ceeab 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C17411467_AddPhysxRagdollComponent.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C17411467_AddPhysxRagdollComponent.py @@ -42,7 +42,7 @@ def run(): 6) Verify there are no errors/warnings in the entity outliner Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243580_Joints_Fixed2BodiesConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243580_Joints_Fixed2BodiesConstrained.py index ee3a819544..76b05a4ce9 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243580_Joints_Fixed2BodiesConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243580_Joints_Fixed2BodiesConstrained.py @@ -45,7 +45,7 @@ def C18243580_Joints_Fixed2BodiesConstrained(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243581_Joints_FixedBreakable.py b/AutomatedTesting/Gem/PythonTests/physics/C18243581_Joints_FixedBreakable.py index e99f8d7c82..ffc48f6e3c 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243581_Joints_FixedBreakable.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243581_Joints_FixedBreakable.py @@ -44,7 +44,7 @@ def C18243581_Joints_FixedBreakable(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243582_Joints_FixedLeadFollowerCollide.py b/AutomatedTesting/Gem/PythonTests/physics/C18243582_Joints_FixedLeadFollowerCollide.py index bbc10939fc..6c0f98b694 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243582_Joints_FixedLeadFollowerCollide.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243582_Joints_FixedLeadFollowerCollide.py @@ -46,7 +46,7 @@ def C18243582_Joints_FixedLeadFollowerCollide(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243583_Joints_Hinge2BodiesConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243583_Joints_Hinge2BodiesConstrained.py index 1baf75141f..fd1fb02557 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243583_Joints_Hinge2BodiesConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243583_Joints_Hinge2BodiesConstrained.py @@ -48,7 +48,7 @@ def C18243583_Joints_Hinge2BodiesConstrained(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243584_Joints_HingeSoftLimitsConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243584_Joints_HingeSoftLimitsConstrained.py index 45fc4ea475..c1ed3328a7 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243584_Joints_HingeSoftLimitsConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243584_Joints_HingeSoftLimitsConstrained.py @@ -48,7 +48,7 @@ def C18243584_Joints_HingeSoftLimitsConstrained(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243585_Joints_HingeNoLimitsConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243585_Joints_HingeNoLimitsConstrained.py index ed96432f8a..515c51eb0b 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243585_Joints_HingeNoLimitsConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243585_Joints_HingeNoLimitsConstrained.py @@ -48,7 +48,7 @@ def C18243585_Joints_HingeNoLimitsConstrained(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243586_Joints_HingeLeadFollowerCollide.py b/AutomatedTesting/Gem/PythonTests/physics/C18243586_Joints_HingeLeadFollowerCollide.py index 1ee1f97e2e..d673885ea1 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243586_Joints_HingeLeadFollowerCollide.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243586_Joints_HingeLeadFollowerCollide.py @@ -45,7 +45,7 @@ def C18243586_Joints_HingeLeadFollowerCollide(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243587_Joints_HingeBreakable.py b/AutomatedTesting/Gem/PythonTests/physics/C18243587_Joints_HingeBreakable.py index 46846793a0..d58d618b99 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243587_Joints_HingeBreakable.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243587_Joints_HingeBreakable.py @@ -46,7 +46,7 @@ def C18243587_Joints_HingeBreakable(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243588_Joints_Ball2BodiesConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243588_Joints_Ball2BodiesConstrained.py index f460e273cf..1ead30c65e 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243588_Joints_Ball2BodiesConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243588_Joints_Ball2BodiesConstrained.py @@ -47,7 +47,7 @@ def C18243588_Joints_Ball2BodiesConstrained(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243589_Joints_BallSoftLimitsConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243589_Joints_BallSoftLimitsConstrained.py index c9ca603f53..d29c472fcd 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243589_Joints_BallSoftLimitsConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243589_Joints_BallSoftLimitsConstrained.py @@ -49,7 +49,7 @@ def C18243589_Joints_BallSoftLimitsConstrained(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243590_Joints_BallNoLimitsConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243590_Joints_BallNoLimitsConstrained.py index 816cce1f0b..d3a0c8e82c 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243590_Joints_BallNoLimitsConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243590_Joints_BallNoLimitsConstrained.py @@ -50,7 +50,7 @@ def C18243590_Joints_BallNoLimitsConstrained(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243591_Joints_BallLeadFollowerCollide.py b/AutomatedTesting/Gem/PythonTests/physics/C18243591_Joints_BallLeadFollowerCollide.py index 1ac2fbebd9..ba8967acab 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243591_Joints_BallLeadFollowerCollide.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243591_Joints_BallLeadFollowerCollide.py @@ -45,7 +45,7 @@ def C18243591_Joints_BallLeadFollowerCollide(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243592_Joints_BallBreakable.py b/AutomatedTesting/Gem/PythonTests/physics/C18243592_Joints_BallBreakable.py index 6a2c1ab9cf..2b07d63a43 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243592_Joints_BallBreakable.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243592_Joints_BallBreakable.py @@ -45,7 +45,7 @@ def C18243592_Joints_BallBreakable(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18243593_Joints_GlobalFrameConstrained.py b/AutomatedTesting/Gem/PythonTests/physics/C18243593_Joints_GlobalFrameConstrained.py index c1c8793830..1ebdaf73b3 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18243593_Joints_GlobalFrameConstrained.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18243593_Joints_GlobalFrameConstrained.py @@ -49,7 +49,7 @@ def C18243593_Joints_GlobalFrameConstrained(): 7) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18977601_Material_FrictionCombinePriority.py b/AutomatedTesting/Gem/PythonTests/physics/C18977601_Material_FrictionCombinePriority.py index a2d8755a08..46f1535bf4 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18977601_Material_FrictionCombinePriority.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18977601_Material_FrictionCombinePriority.py @@ -122,7 +122,7 @@ def C18977601_Material_FrictionCombinePriority(): 9) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C18981526_Material_RestitutionCombinePriority.py b/AutomatedTesting/Gem/PythonTests/physics/C18981526_Material_RestitutionCombinePriority.py index 3d978e6fed..800ad38264 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C18981526_Material_RestitutionCombinePriority.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C18981526_Material_RestitutionCombinePriority.py @@ -122,7 +122,7 @@ def C18981526_Material_RestitutionCombinePriority(): 10) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19536274_GetCollisionName_PrintsName.py b/AutomatedTesting/Gem/PythonTests/physics/C19536274_GetCollisionName_PrintsName.py index 0d32daa320..8dbee3cd4e 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C19536274_GetCollisionName_PrintsName.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C19536274_GetCollisionName_PrintsName.py @@ -40,7 +40,7 @@ def run(): 3) Enter game mode Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19536277_GetCollisionName_PrintsNothing.py b/AutomatedTesting/Gem/PythonTests/physics/C19536277_GetCollisionName_PrintsNothing.py index d9eb6d3d64..141c9fb4db 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C19536277_GetCollisionName_PrintsNothing.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C19536277_GetCollisionName_PrintsNothing.py @@ -40,7 +40,7 @@ def run(): 3) Enter game mode Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19578018_ShapeColliderWithNoShapeComponent.py b/AutomatedTesting/Gem/PythonTests/physics/C19578018_ShapeColliderWithNoShapeComponent.py index 451f2f727b..8910a4ded4 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C19578018_ShapeColliderWithNoShapeComponent.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C19578018_ShapeColliderWithNoShapeComponent.py @@ -43,7 +43,7 @@ def C19578018_ShapeColliderWithNoShapeComponent(): 7) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -60,7 +60,7 @@ def C19578018_ShapeColliderWithNoShapeComponent(): from utils import TestHelper as helper from editor_entity_utils import EditorEntity - # Lumberyard Imports + # Open 3D Engine Imports import azlmbr.bus as bus import azlmbr.editor as editor diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19578021_ShapeCollider_CanBeAdded.py b/AutomatedTesting/Gem/PythonTests/physics/C19578021_ShapeCollider_CanBeAdded.py index 2d8b205019..5c940264ff 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C19578021_ShapeCollider_CanBeAdded.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C19578021_ShapeCollider_CanBeAdded.py @@ -41,7 +41,7 @@ def C19578021_ShapeCollider_CanBeAdded(): 6) Verify there are no warnings in the entity outliner Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -56,7 +56,7 @@ def C19578021_ShapeCollider_CanBeAdded(): from utils import Tracer from editor_entity_utils import EditorEntity as Entity - # Lumberyard Imports + # Open 3D Engine Imports import azlmbr.legacy.general as general helper.init_idle() diff --git a/AutomatedTesting/Gem/PythonTests/physics/C19723164_ShapeColliders_WontCrashEditor.py b/AutomatedTesting/Gem/PythonTests/physics/C19723164_ShapeColliders_WontCrashEditor.py index 355e7571a0..3296b32fc9 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C19723164_ShapeColliders_WontCrashEditor.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C19723164_ShapeColliders_WontCrashEditor.py @@ -37,7 +37,7 @@ def C19723164_ShapeColliders_WontCrashEditor(): 4) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -51,7 +51,7 @@ def C19723164_ShapeColliders_WontCrashEditor(): from utils import TestHelper as helper from editor_entity_utils import EditorEntity as Entity - # Lumberyard Imports + # Open 3D Engine Imports import azlmbr.legacy.general as general def idle_editor_for_check(): diff --git a/AutomatedTesting/Gem/PythonTests/physics/C3510642_Terrain_NotCollideWithTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/C3510642_Terrain_NotCollideWithTerrain.py index ef21ad8584..086f045eec 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C3510642_Terrain_NotCollideWithTerrain.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C3510642_Terrain_NotCollideWithTerrain.py @@ -60,7 +60,7 @@ def C3510642_Terrain_NotCollideWithTerrain(): 9) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C3510644_Collider_CollisionGroups.py b/AutomatedTesting/Gem/PythonTests/physics/C3510644_Collider_CollisionGroups.py index 5a517e98f6..765f7cbfe0 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C3510644_Collider_CollisionGroups.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C3510644_Collider_CollisionGroups.py @@ -84,7 +84,7 @@ def C3510644_Collider_CollisionGroups(): 6) close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. - The level for this test uses two PhysX Terrains and must be run with cmdline argument "-autotest_mode" diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044455_Material_libraryChangesInstantly.py b/AutomatedTesting/Gem/PythonTests/physics/C4044455_Material_libraryChangesInstantly.py index 0a1ab995a8..aae538527a 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044455_Material_libraryChangesInstantly.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4044455_Material_libraryChangesInstantly.py @@ -168,7 +168,7 @@ def C4044455_Material_libraryChangesInstantly(): 9) Exit game mode Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044456_Material_FrictionCombine.py b/AutomatedTesting/Gem/PythonTests/physics/C4044456_Material_FrictionCombine.py index aa1b3ad37d..80b7c6443f 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044456_Material_FrictionCombine.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4044456_Material_FrictionCombine.py @@ -87,7 +87,7 @@ def C4044456_Material_FrictionCombine(): 10) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044457_Material_RestitutionCombine.py b/AutomatedTesting/Gem/PythonTests/physics/C4044457_Material_RestitutionCombine.py index 7f33179bab..856a663fe6 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044457_Material_RestitutionCombine.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4044457_Material_RestitutionCombine.py @@ -92,7 +92,7 @@ def C4044457_Material_RestitutionCombine(): 11) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044459_Material_DynamicFriction.py b/AutomatedTesting/Gem/PythonTests/physics/C4044459_Material_DynamicFriction.py index e1f4c09977..ab4a8c1574 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044459_Material_DynamicFriction.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4044459_Material_DynamicFriction.py @@ -78,7 +78,7 @@ def C4044459_Material_DynamicFriction(): 9) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044460_Material_StaticFriction.py b/AutomatedTesting/Gem/PythonTests/physics/C4044460_Material_StaticFriction.py index b0d0f7fdad..9918c5fac6 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044460_Material_StaticFriction.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4044460_Material_StaticFriction.py @@ -76,7 +76,7 @@ def C4044460_Material_StaticFriction(): 9) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044461_Material_Restitution.py b/AutomatedTesting/Gem/PythonTests/physics/C4044461_Material_Restitution.py index 210fa40c1e..a11cfd47f6 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044461_Material_Restitution.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4044461_Material_Restitution.py @@ -83,7 +83,7 @@ def C4044461_Material_Restitution(): 11) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044694_Material_EmptyLibraryUsesDefault.py b/AutomatedTesting/Gem/PythonTests/physics/C4044694_Material_EmptyLibraryUsesDefault.py index 0513f62e0c..3c3b777a69 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044694_Material_EmptyLibraryUsesDefault.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4044694_Material_EmptyLibraryUsesDefault.py @@ -62,7 +62,7 @@ def C4044694_Material_EmptyLibraryUsesDefault(): 7) Exit game mode and close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py b/AutomatedTesting/Gem/PythonTests/physics/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py index 163f9f22a4..cc2caaf3b6 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4044695_PhysXCollider_AddMultipleSurfaceFbx.py @@ -47,7 +47,7 @@ def run(): 6) Check if multiple material slots show up under Materials section in the PhysX Collider component Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4044697_Material_PerfaceMaterialValidation.py b/AutomatedTesting/Gem/PythonTests/physics/C4044697_Material_PerfaceMaterialValidation.py index 9ae4122eef..46a6b04edf 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4044697_Material_PerfaceMaterialValidation.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4044697_Material_PerfaceMaterialValidation.py @@ -103,7 +103,7 @@ def C4044697_Material_PerfaceMaterialValidation(): 14) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4888315_Material_AddModifyDeleteOnCollider.py b/AutomatedTesting/Gem/PythonTests/physics/C4888315_Material_AddModifyDeleteOnCollider.py index d4c23a296b..49673da217 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4888315_Material_AddModifyDeleteOnCollider.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4888315_Material_AddModifyDeleteOnCollider.py @@ -86,7 +86,7 @@ def C4888315_Material_AddModifyDeleteOnCollider(): 5) Close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4925577_Materials_MaterialAssignedToTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/C4925577_Materials_MaterialAssignedToTerrain.py index 3f04f73cf6..80a83e0222 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4925577_Materials_MaterialAssignedToTerrain.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4925577_Materials_MaterialAssignedToTerrain.py @@ -72,7 +72,7 @@ def C4925577_Materials_MaterialAssignedToTerrain(): 11) Exit game mode and close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4925579_Material_AddModifyDeleteOnTerrain.py b/AutomatedTesting/Gem/PythonTests/physics/C4925579_Material_AddModifyDeleteOnTerrain.py index 609c989851..87f94c6dd4 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4925579_Material_AddModifyDeleteOnTerrain.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4925579_Material_AddModifyDeleteOnTerrain.py @@ -87,7 +87,7 @@ def C4925579_Material_AddModifyDeleteOnTerrain(): 5) Close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4925580_Material_RagdollBonesMaterial.py b/AutomatedTesting/Gem/PythonTests/physics/C4925580_Material_RagdollBonesMaterial.py index f8f33f5cff..abb97da143 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4925580_Material_RagdollBonesMaterial.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4925580_Material_RagdollBonesMaterial.py @@ -61,7 +61,7 @@ def C4925580_Material_RagdollBonesMaterial(): 8) Exit game mode and close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4925582_Material_AddModifyDeleteOnRagdollBones.py b/AutomatedTesting/Gem/PythonTests/physics/C4925582_Material_AddModifyDeleteOnRagdollBones.py index b4cf3c704a..0a309133a4 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4925582_Material_AddModifyDeleteOnRagdollBones.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4925582_Material_AddModifyDeleteOnRagdollBones.py @@ -88,7 +88,7 @@ def C4925582_Material_AddModifyDeleteOnRagdollBones(): 5) Close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976194_RigidBody_PhysXComponentIsValid.py b/AutomatedTesting/Gem/PythonTests/physics/C4976194_RigidBody_PhysXComponentIsValid.py index 3c19665dbb..90feb352b3 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976194_RigidBody_PhysXComponentIsValid.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976194_RigidBody_PhysXComponentIsValid.py @@ -49,7 +49,7 @@ def C4976194_RigidBody_PhysXComponentIsValid(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976195_RigidBodies_InitialLinearVelocity.py b/AutomatedTesting/Gem/PythonTests/physics/C4976195_RigidBodies_InitialLinearVelocity.py index 1dd9cfd45f..287bc75214 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976195_RigidBodies_InitialLinearVelocity.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976195_RigidBodies_InitialLinearVelocity.py @@ -53,7 +53,7 @@ def C4976195_RigidBodies_InitialLinearVelocity(): 9) Closes the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976197_RigidBodies_InitialAngularVelocity.py b/AutomatedTesting/Gem/PythonTests/physics/C4976197_RigidBodies_InitialAngularVelocity.py index 07c586c24e..82b8df29f7 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976197_RigidBodies_InitialAngularVelocity.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976197_RigidBodies_InitialAngularVelocity.py @@ -65,7 +65,7 @@ def C4976197_RigidBodies_InitialAngularVelocity(): 12) Closes the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976201_RigidBody_MassIsAssigned.py b/AutomatedTesting/Gem/PythonTests/physics/C4976201_RigidBody_MassIsAssigned.py index ed87276546..e8086e4965 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976201_RigidBody_MassIsAssigned.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976201_RigidBody_MassIsAssigned.py @@ -96,7 +96,7 @@ def C4976201_RigidBody_MassIsAssigned(): 11) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py b/AutomatedTesting/Gem/PythonTests/physics/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py index c982a96b2a..f74119dd28 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976202_RigidBody_StopsWhenBelowKineticThreshold.py @@ -119,7 +119,7 @@ def C4976202_RigidBody_StopsWhenBelowKineticThreshold(): 12) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976204_Verify_Start_Asleep_Condition.py b/AutomatedTesting/Gem/PythonTests/physics/C4976204_Verify_Start_Asleep_Condition.py index 3413d6f85b..fae8ea9a3a 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976204_Verify_Start_Asleep_Condition.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976204_Verify_Start_Asleep_Condition.py @@ -57,7 +57,7 @@ def C4976204_Verify_Start_Asleep_Condition(): 9) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976206_RigidBodies_GravityEnabledActive.py b/AutomatedTesting/Gem/PythonTests/physics/C4976206_RigidBodies_GravityEnabledActive.py index cbe997aff2..a8227b6b1f 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976206_RigidBodies_GravityEnabledActive.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976206_RigidBodies_GravityEnabledActive.py @@ -59,7 +59,7 @@ def C4976206_RigidBodies_GravityEnabledActive(): 8) Exit game mode and close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976207_PhysXRigidBodies_KinematicBehavior.py b/AutomatedTesting/Gem/PythonTests/physics/C4976207_PhysXRigidBodies_KinematicBehavior.py index e64ebfdea2..8003f495c8 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976207_PhysXRigidBodies_KinematicBehavior.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976207_PhysXRigidBodies_KinematicBehavior.py @@ -54,7 +54,7 @@ def C4976207_PhysXRigidBodies_KinematicBehavior(): 8) Exit game mode and close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976209_RigidBody_ComputesCOM.py b/AutomatedTesting/Gem/PythonTests/physics/C4976209_RigidBody_ComputesCOM.py index 241c9849f4..9f67751d67 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976209_RigidBody_ComputesCOM.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976209_RigidBody_ComputesCOM.py @@ -80,7 +80,7 @@ def C4976209_RigidBody_ComputesCOM(): 7) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. - Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976210_COM_ManualSetting.py b/AutomatedTesting/Gem/PythonTests/physics/C4976210_COM_ManualSetting.py index d15b3eb15c..7cda1bf6f0 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976210_COM_ManualSetting.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976210_COM_ManualSetting.py @@ -65,7 +65,7 @@ def C4976210_COM_ManualSetting(): 6) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976227_Collider_NewGroup.py b/AutomatedTesting/Gem/PythonTests/physics/C4976227_Collider_NewGroup.py index cc2d6abe1f..c9b9dfb89f 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976227_Collider_NewGroup.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976227_Collider_NewGroup.py @@ -46,7 +46,7 @@ def C4976227_Collider_NewGroup(): 5) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976236_AddPhysxColliderComponent.py b/AutomatedTesting/Gem/PythonTests/physics/C4976236_AddPhysxColliderComponent.py index 07d6b14400..8c1527fc89 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976236_AddPhysxColliderComponent.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976236_AddPhysxColliderComponent.py @@ -44,7 +44,7 @@ def C4976236_AddPhysxColliderComponent(): 9) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py b/AutomatedTesting/Gem/PythonTests/physics/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py index 1719b7108a..93d1981187 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976242_Collision_SameCollisionlayerSameCollisiongroup.py @@ -57,7 +57,7 @@ def C4976242_Collision_SameCollisionlayerSameCollisiongroup(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py b/AutomatedTesting/Gem/PythonTests/physics/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py index 931708a73c..a4a89fcdec 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976243_Collision_SameCollisionGroupDiffCollisionLayers.py @@ -61,7 +61,7 @@ def C4976243_Collision_SameCollisionGroupDiffCollisionLayers(): 8) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976244_Collider_SameGroupSameLayerCollision.py b/AutomatedTesting/Gem/PythonTests/physics/C4976244_Collider_SameGroupSameLayerCollision.py index de2455e779..2770b0142c 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976244_Collider_SameGroupSameLayerCollision.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976244_Collider_SameGroupSameLayerCollision.py @@ -57,7 +57,7 @@ def C4976244_Collider_SameGroupSameLayerCollision(): 9) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4976245_PhysXCollider_CollisionLayerTest.py b/AutomatedTesting/Gem/PythonTests/physics/C4976245_PhysXCollider_CollisionLayerTest.py index a32e57fe46..c70154f0be 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4976245_PhysXCollider_CollisionLayerTest.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4976245_PhysXCollider_CollisionLayerTest.py @@ -62,7 +62,7 @@ def C4976245_PhysXCollider_CollisionLayerTest(): 7) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982593_PhysXCollider_CollisionLayerTest.py b/AutomatedTesting/Gem/PythonTests/physics/C4982593_PhysXCollider_CollisionLayerTest.py index c9c12476b4..a05550ba90 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982593_PhysXCollider_CollisionLayerTest.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4982593_PhysXCollider_CollisionLayerTest.py @@ -62,7 +62,7 @@ def C4982593_PhysXCollider_CollisionLayerTest(): 6) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982595_Collider_TriggerDisablesCollision.py b/AutomatedTesting/Gem/PythonTests/physics/C4982595_Collider_TriggerDisablesCollision.py index 06d6b264ea..86d862d547 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982595_Collider_TriggerDisablesCollision.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4982595_Collider_TriggerDisablesCollision.py @@ -70,7 +70,7 @@ def C4982595_Collider_TriggerDisablesCollision(): 11) Exit game mode and close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982797_Collider_ColliderOffset.py b/AutomatedTesting/Gem/PythonTests/physics/C4982797_Collider_ColliderOffset.py index b116ea4b06..cbe8d7d47e 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982797_Collider_ColliderOffset.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4982797_Collider_ColliderOffset.py @@ -80,7 +80,7 @@ def C4982797_Collider_ColliderOffset(): 7) Exit game mode and editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982798_Collider_ColliderRotationOffset.py b/AutomatedTesting/Gem/PythonTests/physics/C4982798_Collider_ColliderRotationOffset.py index 72d976301e..f64d762b3b 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982798_Collider_ColliderRotationOffset.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4982798_Collider_ColliderRotationOffset.py @@ -83,7 +83,7 @@ def C4982798_Collider_ColliderRotationOffset(): 6) Exit game mode and editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982800_PhysXColliderShape_CanBeSelected.py b/AutomatedTesting/Gem/PythonTests/physics/C4982800_PhysXColliderShape_CanBeSelected.py index 9c0723e3ba..d38bf780d4 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982800_PhysXColliderShape_CanBeSelected.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4982800_PhysXColliderShape_CanBeSelected.py @@ -40,7 +40,7 @@ def C4982800_PhysXColliderShape_CanBeSelected(): 6) Verify they have been changed Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -54,7 +54,7 @@ def C4982800_PhysXColliderShape_CanBeSelected(): from utils import TestHelper as helper from editor_entity_utils import EditorEntity as Entity - # Lumberyard Imports + # Open 3D Engine Imports import azlmbr.math as math SPHERE_SHAPETYPE_ENUM = 0 diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982801_PhysXColliderShape_CanBeSelected.py b/AutomatedTesting/Gem/PythonTests/physics/C4982801_PhysXColliderShape_CanBeSelected.py index 2e7c774a05..940f774088 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982801_PhysXColliderShape_CanBeSelected.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4982801_PhysXColliderShape_CanBeSelected.py @@ -40,7 +40,7 @@ def C4982801_PhysXColliderShape_CanBeSelected(): 6) Verify they have been changed Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -54,7 +54,7 @@ def C4982801_PhysXColliderShape_CanBeSelected(): from utils import TestHelper as helper from editor_entity_utils import EditorEntity as Entity - # Lumberyard Imports + # Open 3D Engine Imports import azlmbr.math as math BOX_SHAPETYPE_ENUM = 1 diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982802_PhysXColliderShape_CanBeSelected.py b/AutomatedTesting/Gem/PythonTests/physics/C4982802_PhysXColliderShape_CanBeSelected.py index 92a1909c91..eba549abde 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982802_PhysXColliderShape_CanBeSelected.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4982802_PhysXColliderShape_CanBeSelected.py @@ -40,7 +40,7 @@ def C4982802_PhysXColliderShape_CanBeSelected(): 6) Verify they have been changed Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -54,7 +54,7 @@ def C4982802_PhysXColliderShape_CanBeSelected(): from utils import TestHelper as helper from editor_entity_utils import EditorEntity as Entity - # Lumberyard Imports + # Open 3D Engine Imports import azlmbr.math as math CAPSULE_SHAPETYPE_ENUM = 2 diff --git a/AutomatedTesting/Gem/PythonTests/physics/C4982803_Enable_PxMesh_Option.py b/AutomatedTesting/Gem/PythonTests/physics/C4982803_Enable_PxMesh_Option.py index 72d01658c7..da201ddeda 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C4982803_Enable_PxMesh_Option.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C4982803_Enable_PxMesh_Option.py @@ -49,7 +49,7 @@ def C4982803_Enable_PxMesh_Option(): 7) Verify that the entity falls on the ground and collides with the terrain. Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -69,7 +69,7 @@ def C4982803_Enable_PxMesh_Option(): from asset_utils import Asset import azlmbr.math as math - # Lumberyard Imports + # Open 3D Engine Imports import azlmbr import azlmbr.legacy.general as general diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5340400_RigidBody_ManualMomentOfInertia.py b/AutomatedTesting/Gem/PythonTests/physics/C5340400_RigidBody_ManualMomentOfInertia.py index a8b2065455..f012fe73c0 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5340400_RigidBody_ManualMomentOfInertia.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5340400_RigidBody_ManualMomentOfInertia.py @@ -62,7 +62,7 @@ def C5340400_RigidBody_ManualMomentOfInertia(): 9) Close editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py b/AutomatedTesting/Gem/PythonTests/physics/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py index aad12c9000..10ebcacdb7 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5689522_Physxterrain_AddPhysxterrainNoEditorCrash.py @@ -53,7 +53,7 @@ def C5689522_Physxterrain_AddPhysxterrainNoEditorCrash(): 7) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689524_MultipleTerrains_CheckWarningInConsole.py b/AutomatedTesting/Gem/PythonTests/physics/C5689524_MultipleTerrains_CheckWarningInConsole.py index f05c50c2b4..b00821343b 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5689524_MultipleTerrains_CheckWarningInConsole.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5689524_MultipleTerrains_CheckWarningInConsole.py @@ -55,7 +55,7 @@ def C5689524_MultipleTerrains_CheckWarningInConsole(): 6) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689528_Terrain_MultipleTerrainComponents.py b/AutomatedTesting/Gem/PythonTests/physics/C5689528_Terrain_MultipleTerrainComponents.py index 936d4235ab..f540cae081 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5689528_Terrain_MultipleTerrainComponents.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5689528_Terrain_MultipleTerrainComponents.py @@ -55,7 +55,7 @@ def C5689528_Terrain_MultipleTerrainComponents(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py b/AutomatedTesting/Gem/PythonTests/physics/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py index bba46c2cb6..2fbf21fb72 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5689529_Verify_Terrain_RigidBody_Collider_Mesh.py @@ -53,7 +53,7 @@ def C5689529_Verify_Terrain_RigidBody_Collider_Mesh(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5689531_Warning_TerrainSliceTerrainComponent.py b/AutomatedTesting/Gem/PythonTests/physics/C5689531_Warning_TerrainSliceTerrainComponent.py index 7ad0770548..c8e5d6873b 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5689531_Warning_TerrainSliceTerrainComponent.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5689531_Warning_TerrainSliceTerrainComponent.py @@ -60,7 +60,7 @@ def C5689531_Warning_TerrainSliceTerrainComponent(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932040_ForceRegion_CubeExertsWorldForce.py b/AutomatedTesting/Gem/PythonTests/physics/C5932040_ForceRegion_CubeExertsWorldForce.py index d32e47b965..87bc4812b2 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5932040_ForceRegion_CubeExertsWorldForce.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5932040_ForceRegion_CubeExertsWorldForce.py @@ -60,7 +60,7 @@ def C5932040_ForceRegion_CubeExertsWorldForce(): 11) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py b/AutomatedTesting/Gem/PythonTests/physics/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py index 2274739fba..d78f0f386a 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies.py @@ -61,7 +61,7 @@ def C5932041_PhysXForceRegion_LocalSpaceForceOnRigidBodies(): 9) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932042_PhysXForceRegion_LinearDamping.py b/AutomatedTesting/Gem/PythonTests/physics/C5932042_PhysXForceRegion_LinearDamping.py index d8fa95f636..a3f6de6a5f 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5932042_PhysXForceRegion_LinearDamping.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5932042_PhysXForceRegion_LinearDamping.py @@ -66,7 +66,7 @@ def C5932042_PhysXForceRegion_LinearDamping(): 6) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932044_ForceRegion_PointForceOnRigidBody.py b/AutomatedTesting/Gem/PythonTests/physics/C5932044_ForceRegion_PointForceOnRigidBody.py index e8000e9b33..4f8121e254 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5932044_ForceRegion_PointForceOnRigidBody.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5932044_ForceRegion_PointForceOnRigidBody.py @@ -60,7 +60,7 @@ def C5932044_ForceRegion_PointForceOnRigidBody(): 12) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5932045_ForceRegion_Spline.py b/AutomatedTesting/Gem/PythonTests/physics/C5932045_ForceRegion_Spline.py index bf12145f52..4cb71ab54c 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5932045_ForceRegion_Spline.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5932045_ForceRegion_Spline.py @@ -66,7 +66,7 @@ def C5932045_ForceRegion_Spline(): 8) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959760_PhysXForceRegion_PointForceExertion.py b/AutomatedTesting/Gem/PythonTests/physics/C5959760_PhysXForceRegion_PointForceExertion.py index df6e2d7f29..42020c78b7 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5959760_PhysXForceRegion_PointForceExertion.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5959760_PhysXForceRegion_PointForceExertion.py @@ -59,7 +59,7 @@ def C5959760_PhysXForceRegion_PointForceExertion(): 6) Closes the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959761_ForceRegion_PhysAssetExertsPointForce.py b/AutomatedTesting/Gem/PythonTests/physics/C5959761_ForceRegion_PhysAssetExertsPointForce.py index d6a0776090..af9af57363 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5959761_ForceRegion_PhysAssetExertsPointForce.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5959761_ForceRegion_PhysAssetExertsPointForce.py @@ -56,7 +56,7 @@ def C5959761_ForceRegion_PhysAssetExertsPointForce(): 9) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5959810_ForceRegion_ForceRegionCombinesForces.py b/AutomatedTesting/Gem/PythonTests/physics/C5959810_ForceRegion_ForceRegionCombinesForces.py index 8dddc8866d..e09b58ecdc 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5959810_ForceRegion_ForceRegionCombinesForces.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5959810_ForceRegion_ForceRegionCombinesForces.py @@ -60,7 +60,7 @@ def C5959810_ForceRegion_ForceRegionCombinesForces(): 9) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C5968760_ForceRegion_CheckNetForceChange.py b/AutomatedTesting/Gem/PythonTests/physics/C5968760_ForceRegion_CheckNetForceChange.py index 640424ff39..7c7c11f548 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C5968760_ForceRegion_CheckNetForceChange.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C5968760_ForceRegion_CheckNetForceChange.py @@ -56,7 +56,7 @@ def C5968760_ForceRegion_CheckNetForceChange(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6032082_Terrain_MultipleResolutionsValid.py b/AutomatedTesting/Gem/PythonTests/physics/C6032082_Terrain_MultipleResolutionsValid.py index e163cae4de..d79954d26f 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6032082_Terrain_MultipleResolutionsValid.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6032082_Terrain_MultipleResolutionsValid.py @@ -75,7 +75,7 @@ def C6032082_Terrain_MultipleResolutionsValid(): 2) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090546_ForceRegion_SliceFileInstantiates.py b/AutomatedTesting/Gem/PythonTests/physics/C6090546_ForceRegion_SliceFileInstantiates.py index 4f26ce9661..825b8287d1 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090546_ForceRegion_SliceFileInstantiates.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6090546_ForceRegion_SliceFileInstantiates.py @@ -58,7 +58,7 @@ def C6090546_ForceRegion_SliceFileInstantiates(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090547_ForceRegion_ParentChildForceRegions.py b/AutomatedTesting/Gem/PythonTests/physics/C6090547_ForceRegion_ParentChildForceRegions.py index 7dfeb7e846..a62a673b9f 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090547_ForceRegion_ParentChildForceRegions.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6090547_ForceRegion_ParentChildForceRegions.py @@ -67,7 +67,7 @@ def C6090547_ForceRegion_ParentChildForceRegions(): 10) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090550_ForceRegion_WorldSpaceForceNegative.py b/AutomatedTesting/Gem/PythonTests/physics/C6090550_ForceRegion_WorldSpaceForceNegative.py index d082f5e4eb..c85dc6a273 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090550_ForceRegion_WorldSpaceForceNegative.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6090550_ForceRegion_WorldSpaceForceNegative.py @@ -65,7 +65,7 @@ def C6090550_ForceRegion_WorldSpaceForceNegative(): 7) Exit game mode and close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090551_ForceRegion_LocalSpaceForceNegative.py b/AutomatedTesting/Gem/PythonTests/physics/C6090551_ForceRegion_LocalSpaceForceNegative.py index 7d71caada3..45f9b21522 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090551_ForceRegion_LocalSpaceForceNegative.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6090551_ForceRegion_LocalSpaceForceNegative.py @@ -65,7 +65,7 @@ def C6090551_ForceRegion_LocalSpaceForceNegative(): 7) Exit game mode and close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090552_ForceRegion_LinearDampingNegative.py b/AutomatedTesting/Gem/PythonTests/physics/C6090552_ForceRegion_LinearDampingNegative.py index e599f3d401..5751f55b0c 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090552_ForceRegion_LinearDampingNegative.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6090552_ForceRegion_LinearDampingNegative.py @@ -64,7 +64,7 @@ def C6090552_ForceRegion_LinearDampingNegative(): 7) Exit game mode and close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py b/AutomatedTesting/Gem/PythonTests/physics/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py index ec88d5ea67..3c995bca62 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6090553_ForceRegion_SimpleDragForceOnRigidBodies.py @@ -58,7 +58,7 @@ def C6090553_ForceRegion_SimpleDragForceOnRigidBodies(): 11) Exits game mode and editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090554_ForceRegion_PointForceNegative.py b/AutomatedTesting/Gem/PythonTests/physics/C6090554_ForceRegion_PointForceNegative.py index 9e87435801..0ea8ca2e4b 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090554_ForceRegion_PointForceNegative.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6090554_ForceRegion_PointForceNegative.py @@ -65,7 +65,7 @@ def C6090554_ForceRegion_PointForceNegative(): 7) Exit game mode and close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6090555_ForceRegion_SplineFollowOnRigidBodies.py b/AutomatedTesting/Gem/PythonTests/physics/C6090555_ForceRegion_SplineFollowOnRigidBodies.py index a5a1953d6a..dfa992bc21 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6090555_ForceRegion_SplineFollowOnRigidBodies.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6090555_ForceRegion_SplineFollowOnRigidBodies.py @@ -61,7 +61,7 @@ def C6090555_ForceRegion_SplineFollowOnRigidBodies(): 9) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6131473_StaticSlice_OnDynamicSliceSpawn.py b/AutomatedTesting/Gem/PythonTests/physics/C6131473_StaticSlice_OnDynamicSliceSpawn.py index 4db52684db..5e475a4c4c 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6131473_StaticSlice_OnDynamicSliceSpawn.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6131473_StaticSlice_OnDynamicSliceSpawn.py @@ -53,7 +53,7 @@ def C6131473_StaticSlice_OnDynamicSliceSpawn(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6224408_ScriptCanvas_EntitySpawn.py b/AutomatedTesting/Gem/PythonTests/physics/C6224408_ScriptCanvas_EntitySpawn.py index 9ac3b7facf..f88e07bf86 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6224408_ScriptCanvas_EntitySpawn.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6224408_ScriptCanvas_EntitySpawn.py @@ -56,7 +56,7 @@ def C6224408_ScriptCanvas_EntitySpawn(): 8) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6274125_ScriptCanvas_TriggerEvents.py b/AutomatedTesting/Gem/PythonTests/physics/C6274125_ScriptCanvas_TriggerEvents.py index af2321b853..64baa81140 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6274125_ScriptCanvas_TriggerEvents.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6274125_ScriptCanvas_TriggerEvents.py @@ -61,7 +61,7 @@ def C6274125_ScriptCanvas_TriggerEvents(): 6) Close the editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/C6321601_Force_HighValuesDirectionAxes.py b/AutomatedTesting/Gem/PythonTests/physics/C6321601_Force_HighValuesDirectionAxes.py index 9516f3366e..2b0168a2fe 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/C6321601_Force_HighValuesDirectionAxes.py +++ b/AutomatedTesting/Gem/PythonTests/physics/C6321601_Force_HighValuesDirectionAxes.py @@ -85,7 +85,7 @@ def C6321601_Force_HighValuesDirectionAxes(): Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Aed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/physics/Physmaterial_Editor.py b/AutomatedTesting/Gem/PythonTests/physics/Physmaterial_Editor.py index a23aa833d9..9eeb1ee1da 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/Physmaterial_Editor.py +++ b/AutomatedTesting/Gem/PythonTests/physics/Physmaterial_Editor.py @@ -16,7 +16,7 @@ from xml.etree import ElementTree class Physmaterial_Editor: """ - This class is used to adjust physmaterial files for use with Lumberyard. + This class is used to adjust physmaterial files for use with Open 3D Engine. NOTEWORTHY: - Must use save_changes() for library modifications to take affect @@ -177,7 +177,7 @@ class Physmaterial_Editor: @staticmethod def _get_combine_id(combine_name): # type: (str) -> int - # Maps the Combine mode to its enumerated value used by the Lumberyard Editor + # Maps the Combine mode to its enumerated value used by the Open 3D Engine Editor combine_dictionary = {"Average": "0", "Minimum": "1", "Maximum": "2", "Multiply": "3"} if combine_name not in combine_dictionary: raise ValueError("Invalid Combine Value given. {} is not in combine map".format(combine_name)) diff --git a/AutomatedTesting/Gem/PythonTests/physics/UtilTest_Physmaterial_Editor.py b/AutomatedTesting/Gem/PythonTests/physics/UtilTest_Physmaterial_Editor.py index c75a1121e7..666b4910a1 100755 --- a/AutomatedTesting/Gem/PythonTests/physics/UtilTest_Physmaterial_Editor.py +++ b/AutomatedTesting/Gem/PythonTests/physics/UtilTest_Physmaterial_Editor.py @@ -46,7 +46,7 @@ def run(): 6) Close Editor Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. diff --git a/AutomatedTesting/Gem/PythonTests/scripting/Docking_Pane.py b/AutomatedTesting/Gem/PythonTests/scripting/Docking_Pane.py index 9df8fd4fb1..3b54c0de72 100755 --- a/AutomatedTesting/Gem/PythonTests/scripting/Docking_Pane.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/Docking_Pane.py @@ -39,7 +39,7 @@ def Docking_Pane(): 5) Close Script Canvas window Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -55,7 +55,7 @@ def Docking_Pane(): from utils import TestHelper as helper import pyside_utils - # Lumberyard imports + # Open 3D Engine imports import azlmbr.legacy.general as general # Pyside imports diff --git a/AutomatedTesting/Gem/PythonTests/scripting/Opening_Closing_Pane.py b/AutomatedTesting/Gem/PythonTests/scripting/Opening_Closing_Pane.py index 5091e05c20..4ea4d791dd 100755 --- a/AutomatedTesting/Gem/PythonTests/scripting/Opening_Closing_Pane.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/Opening_Closing_Pane.py @@ -42,7 +42,7 @@ def Opening_Closing_Pane(): 7) Close Script Canvas window Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -58,7 +58,7 @@ def Opening_Closing_Pane(): from utils import TestHelper as helper import pyside_utils - # Lumberyard Imports + # Open 3D Engine Imports import azlmbr.legacy.general as general # Pyside imports diff --git a/AutomatedTesting/Gem/PythonTests/scripting/Resizing_Pane.py b/AutomatedTesting/Gem/PythonTests/scripting/Resizing_Pane.py index 9378ad8aa8..216ef4fb7d 100755 --- a/AutomatedTesting/Gem/PythonTests/scripting/Resizing_Pane.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/Resizing_Pane.py @@ -39,7 +39,7 @@ def Resizing_Pane(): 6) Close Script Canvas window Note: - - This test file must be called from the Lumberyard Editor command terminal + - This test file must be called from the Open 3D Engine Editor command terminal - Any passed and failed tests are written to the Editor.log file. Parsing the file or running a log_monitor are required to observe the test results. @@ -55,7 +55,7 @@ def Resizing_Pane(): from utils import TestHelper as helper import pyside_utils - # Lumberyard imports + # Open 3D Engine imports import azlmbr.legacy.general as general # Pyside imports diff --git a/AutomatedTesting/Gem/PythonTests/streaming/benchmark/asset_load_benchmark_test.py b/AutomatedTesting/Gem/PythonTests/streaming/benchmark/asset_load_benchmark_test.py index 96d8b00429..e92ec16b79 100755 --- a/AutomatedTesting/Gem/PythonTests/streaming/benchmark/asset_load_benchmark_test.py +++ b/AutomatedTesting/Gem/PythonTests/streaming/benchmark/asset_load_benchmark_test.py @@ -355,7 +355,7 @@ class TestBenchmarkAssetLoads(object): # Load 650 MB from a single root 10MB asset that has 64 dependent 10MB assets Benchmark('10mb_64x1', 1), # Load 650 MB from a single root 10MB asset where each asset has 1 dependent 10MB asset 64 levels deep - # (Currently removed because it crashes Lumberyard, re-enable once LY can handle it - SPEC-1314) + # (Currently removed because it crashes Open 3D Engine, re-enable once LY can handle it - SPEC-1314) #Benchmark('10mb_1x64', 1), # The second set of benchmarks measures the load time effects of different quantities of parallel asset loads. diff --git a/CMakeLists.txt b/CMakeLists.txt index dfc299e144..c09cfc9588 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# Cmake version 3.17 is the minimum version needed for all of lumberyard's supported platforms +# Cmake version 3.17 is the minimum version needed for all of Open 3D Engine's supported platforms cmake_minimum_required(VERSION 3.19) # CMP0111 introduced in 3.19 has a bug that produces the policy to warn every time there is an @@ -23,17 +23,22 @@ endif() include(cmake/Version.cmake) +set(INSTALLED_ENGINE TRUE) + if(NOT PROJECT_NAME) project(O3DE LANGUAGES C CXX VERSION ${LY_VERSION_STRING} ) + + set(INSTALLED_ENGINE FALSE) endif() include(cmake/Initialize.cmake) include(cmake/FileUtil.cmake) include(cmake/PAL.cmake) include(cmake/PALTools.cmake) +include(cmake/Install.cmake) include(cmake/Configurations.cmake) # Requires to be after PAL so we get platform variable definitions include(cmake/Dependencies.cmake) include(cmake/Deployment.cmake) @@ -54,9 +59,13 @@ include(cmake/CMakeFiles.cmake) # Add the projects first so the Launcher can find them include(cmake/Projects.cmake) -# Add the rest of the targets -add_subdirectory(Code) -add_subdirectory(Gems) +if(NOT INSTALLED_ENGINE) + # Add the rest of the targets + add_subdirectory(Code) + add_subdirectory(Gems) +else() + ly_find_o3de_packages() +endif() set(enabled_platforms ${PAL_PLATFORM_NAME} @@ -98,7 +107,7 @@ foreach(external_directory ${LY_EXTERNAL_SUBDIRS}) add_subdirectory(${external_directory} ${CMAKE_BINARY_DIR}/${directory_name}-${full_directory_hash}) endforeach() -# The following steps have to be done after all targets were registered: +# The following steps have to be done after all targets are registered: # 1. generate a settings registry .setreg file for all ly_add_project_dependencies() and ly_add_target_dependencies() calls # to provide applications with the filenames of gem modules to load # This must be done before ly_delayed_target_link_libraries() as that inserts BUILD_DEPENDENCIE as MANUALLY_ADDED_DEPENDENCIES @@ -115,4 +124,8 @@ endif() # the dependencies include(cmake/RuntimeDependencies.cmake) # 5. Perform test impact framework post steps once all of the targets have been enumerated -ly_test_impact_post_step() \ No newline at end of file +ly_test_impact_post_step() +# 6. Generate the O3DE find file and setup install locations for scripts, tools, assets etc., required by the engine +if(NOT INSTALLED_ENGINE) + ly_setup_o3de_install() +endif() \ No newline at end of file diff --git a/Code/CryEngine/Cry3DEngine/3dEngine.cpp b/Code/CryEngine/Cry3DEngine/3dEngine.cpp index 34472fa6b4..1050916423 100644 --- a/Code/CryEngine/Cry3DEngine/3dEngine.cpp +++ b/Code/CryEngine/Cry3DEngine/3dEngine.cpp @@ -1675,9 +1675,11 @@ bool C3DEngine::IsTessellationAllowedForShadowMap(const SRenderingPassInfo& pass default: return false; } -#endif //#ifdef MESH_TESSELLATION_ENGINE +#else return false; + +#endif //#ifdef MESH_TESSELLATION_ENGINE } void C3DEngine::SetPhysMaterialEnumerator(IPhysMaterialEnumerator* pPhysMaterialEnumerator) diff --git a/Code/CryEngine/Cry3DEngine/CZBufferCuller.cpp b/Code/CryEngine/Cry3DEngine/CZBufferCuller.cpp index 7aa7509ce3..381c6b8058 100644 --- a/Code/CryEngine/Cry3DEngine/CZBufferCuller.cpp +++ b/Code/CryEngine/Cry3DEngine/CZBufferCuller.cpp @@ -127,10 +127,6 @@ bool CZBufferCuller::IsBoxVisible(const AABB& objBox, [[maybe_unused]] uint32* c return Rasterize<2>(Verts, 8); } return Rasterize<0>(Verts, 8); - - ++m_ObjectsTestedAndRejected; - - return false; } static int sh = 8; @@ -197,4 +193,4 @@ void CZBufferCuller::GetMemoryUsage(ICrySizer* pSizer) const { SIZER_COMPONENT_NAME(pSizer, "CoverageBuffer"); pSizer->AddObject(m_ZBuffer, sizeof(TZBZexel) * m_SizeX * m_SizeY); -} \ No newline at end of file +} diff --git a/Code/CryEngine/Cry3DEngine/CZBufferCuller.h b/Code/CryEngine/Cry3DEngine/CZBufferCuller.h index 07ea23e893..f5e01abc68 100644 --- a/Code/CryEngine/Cry3DEngine/CZBufferCuller.h +++ b/Code/CryEngine/Cry3DEngine/CZBufferCuller.h @@ -97,7 +97,10 @@ protected: { return true; } - MinX = 0; + else + { + MinX = 0; + } } if (MaxX > m_SizeX) { @@ -105,7 +108,10 @@ protected: { return true; } - MaxX = m_SizeX; + else + { + MaxX = m_SizeX; + } } if (MinY < 0) { @@ -113,7 +119,10 @@ protected: { return true; } - MinY = 0; + else + { + MinY = 0; + } } if (MaxY > m_SizeY) { @@ -121,7 +130,10 @@ protected: { return true; } - MaxY = m_SizeY; + else + { + MaxY = m_SizeY; + } } if constexpr (ROTATE == 2) { diff --git a/Code/CryEngine/Cry3DEngine/MaterialHelpers.cpp b/Code/CryEngine/Cry3DEngine/MaterialHelpers.cpp index ceea4756e0..a9a2c90cb2 100644 --- a/Code/CryEngine/Cry3DEngine/MaterialHelpers.cpp +++ b/Code/CryEngine/Cry3DEngine/MaterialHelpers.cpp @@ -844,7 +844,6 @@ void MaterialHelpers::MigrateXmlLegacyData(SInputShaderResources& pShaderResourc CryWarning(VALIDATOR_MODULE_3DENGINE, VALIDATOR_WARNING, "Material %s has had legacy GlowAmount automatically converted to Emissive Intensity. The material parameters related to Emittance should be manually adjusted for this material.", materialName.c_str()); } - // In Lumberyard version 1.9 BlendLayer2Specular became a color instead of a single float, so it needs to be updated XmlNodeRef publicParamsNode = node->findChild("PublicParams"); if (publicParamsNode && publicParamsNode->haveAttr("BlendLayer2Specular")) { diff --git a/Code/CryEngine/Cry3DEngine/TimeOfDay.cpp b/Code/CryEngine/Cry3DEngine/TimeOfDay.cpp index 3cb5109836..067616899a 100644 --- a/Code/CryEngine/Cry3DEngine/TimeOfDay.cpp +++ b/Code/CryEngine/Cry3DEngine/TimeOfDay.cpp @@ -214,7 +214,7 @@ CTimeOfDay::CTimeOfDay() // fill local var list so, sandbox can access var list without level being loaded // Cryengine supports the notion of environment presets which are set in code that is currently not - // in lumberyard. Therefore, create a default preset here that is used as the only one. + // in Open 3D Engine. Therefore, create a default preset here that is used as the only one. m_defaultPreset = new CEnvironmentPreset; for (int i = 0; i < PARAM_TOTAL; ++i) { diff --git a/Code/CryEngine/CryCommon/CryAssert_impl.h b/Code/CryEngine/CryCommon/CryAssert_impl.h index 8b67a2d71e..ed55162f1a 100644 --- a/Code/CryEngine/CryCommon/CryAssert_impl.h +++ b/Code/CryEngine/CryCommon/CryAssert_impl.h @@ -323,7 +323,7 @@ void CryAssertTrace(const char* _pszFormat, ...) //----------------------------------------------------------------------------------------------------- -static const char* gs_strRegSubKey = "Software\\Amazon\\Lumberyard\\AssertWindow"; +static const char* gs_strRegSubKey = "Software\\O3DE\\AssertWindow"; static const char* gs_strRegXValue = "AssertInfoX"; static const char* gs_strRegYValue = "AssertInfoY"; diff --git a/Code/CryEngine/CryCommon/EngineSettingsBackendWin32.cpp b/Code/CryEngine/CryCommon/EngineSettingsBackendWin32.cpp index 8ec03cdfa9..c2e9a67d57 100644 --- a/Code/CryEngine/CryCommon/EngineSettingsBackendWin32.cpp +++ b/Code/CryEngine/CryCommon/EngineSettingsBackendWin32.cpp @@ -26,7 +26,7 @@ #define REG_SOFTWARE L"Software\\" #define REG_COMPANY_NAME L"Amazon\\" -#define REG_PRODUCT_NAME L"Lumberyard\\" +#define REG_PRODUCT_NAME L"Open 3D Engine\\" #define REG_SETTING L"Settings\\" #define REG_BASE_SETTING_KEY REG_SOFTWARE REG_COMPANY_NAME REG_PRODUCT_NAME REG_SETTING @@ -181,7 +181,7 @@ bool CEngineSettingsBackendWin32::SetModuleSpecificBoolEntry(const char* key, co bool CEngineSettingsBackendWin32::GetInstalledBuildRootPathUtf16(const int index, CWCharBuffer name, CWCharBuffer path) { - RegKey key(REG_BASE_SETTING_KEY L"LumberyardExport\\ProjectBuilds", false); + RegKey key(REG_BASE_SETTING_KEY L"O3DEExport\\ProjectBuilds", false); if (key.pKey) { DWORD type; diff --git a/Code/CryEngine/CryCommon/HMDBus.h b/Code/CryEngine/CryCommon/HMDBus.h index 07292f5d1e..f76405120d 100644 --- a/Code/CryEngine/CryCommon/HMDBus.h +++ b/Code/CryEngine/CryCommon/HMDBus.h @@ -61,7 +61,7 @@ namespace AZ /// /// Attempt to initialize this device. If initialization is initially successful (device exists and is able to startup) then this device should connect to the - /// HMDDeviceRequestBus in order to be used as an HMD from the main Lumberyard system. + /// HMDDeviceRequestBus in order to be used as an HMD from the main Open 3D Engine system. /// /// @return If true, initialization fully succeeded. /// diff --git a/Code/CryEngine/CryCommon/ISystem.h b/Code/CryEngine/CryCommon/ISystem.h index 2519aae1c3..9b1e817602 100644 --- a/Code/CryEngine/CryCommon/ISystem.h +++ b/Code/CryEngine/CryCommon/ISystem.h @@ -1470,7 +1470,7 @@ struct ISystem virtual int GetApplicationInstance() = 0; // Summary: - // Get log index of the currently running lumberyard application. (0 = first instance, 1 = second instance, etc) + // Get log index of the currently running Open 3D Engine application. (0 = first instance, 1 = second instance, etc) virtual int GetApplicationLogInstance(const char* logFilePath) = 0; // Summary: diff --git a/Code/CryEngine/CryFont/FFont.cpp b/Code/CryEngine/CryFont/FFont.cpp index 0441ef325f..c028a0827e 100644 --- a/Code/CryEngine/CryFont/FFont.cpp +++ b/Code/CryEngine/CryFont/FFont.cpp @@ -111,7 +111,10 @@ int32 CFFont::Release() m_pCryFont = nullptr; } - gEnv->pRenderer->DeleteFont(this); + if (gEnv->pRenderer) + { + gEnv->pRenderer->DeleteFont(this); + } return 0; } return nRef; diff --git a/Code/CryEngine/CrySystem/CrashHandler.rc b/Code/CryEngine/CrySystem/CrashHandler.rc index a3f9e37e18..01afa72550 100644 --- a/Code/CryEngine/CrySystem/CrashHandler.rc +++ b/Code/CryEngine/CrySystem/CrashHandler.rc @@ -85,7 +85,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN PUSHBUTTON "Save",IDB_CONFIRM_SAVE,4,96,68,20 PUSHBUTTON "Cancel",IDB_DONT_SAVE,206,96,68,20 - LTEXT "Lumberyard has encountered an error and needs to close.\n\nA backup has been saved to the '_savebackup' subfolder.\n\nIf you are unable to save your file, you can recover by copying the contents of the _savebackup folder over the broken files.",IDC_STATIC,60,8,210,61 + LTEXT "Open 3D Engine has encountered an error and needs to close.\n\nA backup has been saved to the '_savebackup' subfolder.\n\nIf you are unable to save your file, you can recover by copying the contents of the _savebackup folder over the broken files.",IDC_STATIC,60,8,210,61 LTEXT "Attempt save?",IDC_STATIC,60,72,180,21 CONTROL 128,IDC_STATIC,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_REALSIZEIMAGE,8,8,48,40 END diff --git a/Code/CryEngine/CrySystem/CryDLMalloc.c b/Code/CryEngine/CrySystem/CryDLMalloc.c index e7838cffcb..bcb835b0d5 100644 --- a/Code/CryEngine/CrySystem/CryDLMalloc.c +++ b/Code/CryEngine/CrySystem/CryDLMalloc.c @@ -4871,7 +4871,9 @@ static void* tmalloc_small(mstate m, size_t nb) } CORRUPTION_ERROR_ACTION(m); +#if PROCEED_ON_ERROR return 0; +#endif } /* --------------------------- realloc support --------------------------- */ @@ -4930,7 +4932,9 @@ static void* internal_realloc(mstate m, void* oldmem, size_t bytes) { USAGE_ERROR_ACTION(m, oldmem); POSTACTION(m); +#if PROCEED_ON_ERROR return 0; +#endif } #if DEBUG if (newp != 0) @@ -5884,7 +5888,9 @@ void* mspace_malloc(mspace msp, size_t bytes) if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms, ms); +#if PROCEED_ON_ERROR return 0; +#endif } if (!PREACTION(ms)) { @@ -6150,7 +6156,9 @@ void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms, ms); +#if PROCEED_ON_ERROR return 0; +#endif } if (n_elements != 0) { @@ -6193,7 +6201,9 @@ void* mspace_realloc(mspace msp, void* oldmem, size_t bytes) if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms, ms); +#if PROCEED_ON_ERROR return 0; +#endif } return internal_realloc(ms, oldmem, bytes); } @@ -6205,7 +6215,9 @@ void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms, ms); +#if PROCEED_ON_ERROR return 0; +#endif } return internal_memalign(ms, alignment, bytes); } @@ -6218,7 +6230,9 @@ void** mspace_independent_calloc(mspace msp, size_t n_elements, if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms, ms); +#if PROCEED_ON_ERROR return 0; +#endif } return ialloc(ms, n_elements, &sz, 3, chunks); } @@ -6230,7 +6244,9 @@ void** mspace_independent_comalloc(mspace msp, size_t n_elements, if (!ok_magic(ms)) { USAGE_ERROR_ACTION(ms, ms); +#if PROCEED_ON_ERROR return 0; +#endif } return ialloc(ms, n_elements, sizes, 0, chunks); } diff --git a/Code/CryEngine/CrySystem/IDebugCallStack.cpp b/Code/CryEngine/CrySystem/IDebugCallStack.cpp index 05f810f3c1..d73d70ab8b 100644 --- a/Code/CryEngine/CrySystem/IDebugCallStack.cpp +++ b/Code/CryEngine/CrySystem/IDebugCallStack.cpp @@ -226,7 +226,7 @@ void IDebugCallStack::FatalError(const char* description) bShowDebugScreen = bShowDebugScreen && gEnv->mMainThreadId == CryGetCurrentThreadId(); if (bShowDebugScreen) { - EBUS_EVENT(AZ::NativeUI::NativeUIRequestBus, DisplayOkDialog, "Lumberyard Fatal Error", description, false); + EBUS_EVENT(AZ::NativeUI::NativeUIRequestBus, DisplayOkDialog, "Open 3D Engine Fatal Error", description, false); } #endif diff --git a/Code/CryEngine/CrySystem/MemoryManager.cpp b/Code/CryEngine/CrySystem/MemoryManager.cpp index 40e1a9b11e..4704d2f5fe 100644 --- a/Code/CryEngine/CrySystem/MemoryManager.cpp +++ b/Code/CryEngine/CrySystem/MemoryManager.cpp @@ -98,14 +98,18 @@ bool CCryMemoryManager::GetProcessMemInfo(SProcessMemInfo& minfo) } return false; +#else #define AZ_RESTRICTED_SECTION_IMPLEMENTED -#elif defined(AZ_RESTRICTED_PLATFORM) -#define AZ_RESTRICTED_SECTION MEMORYMANAGER_CPP_SECTION_1 -#include AZ_RESTRICTED_FILE(MemoryManager_cpp) +#if defined(AZ_RESTRICTED_PLATFORM) + #define AZ_RESTRICTED_SECTION MEMORYMANAGER_CPP_SECTION_1 + #include AZ_RESTRICTED_FILE(MemoryManager_cpp) #endif + + bool retVal = true; + #if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED) -#undef AZ_RESTRICTED_SECTION_IMPLEMENTED + #undef AZ_RESTRICTED_SECTION_IMPLEMENTED #elif defined(LINUX) MEMORYSTATUS MemoryStatus; @@ -143,11 +147,15 @@ bool CCryMemoryManager::GetProcessMemInfo(SProcessMemInfo& minfo) return false; } minfo.WorkingSetSize = kTaskInfo.resident_size; + #else - return false; + + retVal = false; + #endif - return true; + return retVal; +#endif } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/CryEngine/CrySystem/System.cpp b/Code/CryEngine/CrySystem/System.cpp index af14060826..a48f63afdf 100644 --- a/Code/CryEngine/CrySystem/System.cpp +++ b/Code/CryEngine/CrySystem/System.cpp @@ -1451,20 +1451,12 @@ bool CSystem::UpdatePreTickBus(int updateFlags, int nPauseMode) //bool bPause = false; bool bNoUpdate = false; #ifndef EXCLUDE_UPDATE_ON_CONSOLE - //check what is the current process - IProcess* pProcess = GetIProcess(); - if (!pProcess) - { - return (true); //should never happen - } if (m_sysNoUpdate && m_sysNoUpdate->GetIVal()) { bNoUpdate = true; updateFlags = ESYSUPDATE_IGNORE_PHYSICS; } - //if ((pProcess->GetFlags() & PROC_MENU) || (m_sysNoUpdate && m_sysNoUpdate->GetIVal())) - // bPause = true; m_bNoUpdate = bNoUpdate; #endif //EXCLUDE_UPDATE_ON_CONSOLE @@ -1537,7 +1529,7 @@ bool CSystem::UpdatePreTickBus(int updateFlags, int nPauseMode) } ////////////////////////////////////////////////////////////////////////// - if (m_env.pRenderer->GetIStereoRenderer()->IsRenderingToHMD()) + if (m_env.pRenderer && m_env.pRenderer->GetIStereoRenderer()->IsRenderingToHMD()) { EBUS_EVENT(AZ::VR::HMDDeviceRequestBus, UpdateInternalState); } @@ -2860,8 +2852,6 @@ bool CSystem::HandleMessage([[maybe_unused]] HWND hWnd, UINT uMsg, WPARAM wParam default: return false; } - - return true; } #endif diff --git a/Code/CryEngine/CrySystem/SystemInit.cpp b/Code/CryEngine/CrySystem/SystemInit.cpp index 21eb0c538c..5e43d6a1df 100644 --- a/Code/CryEngine/CrySystem/SystemInit.cpp +++ b/Code/CryEngine/CrySystem/SystemInit.cpp @@ -248,7 +248,7 @@ CUNIXConsole* pUnixConsole; #define LOCALIZATION_TRANSLATIONS_LIST_FILE_NAME "Libs/Localization/localization.xml" #define LOAD_LEGACY_RENDERER_FOR_EDITOR true // If you set this to false you must for now also set 'ed_useAtomNativeViewport' to true (see /Code/Sandbox/Editor/ViewManager.cpp) -#define LOAD_LEGACY_RENDERER_FOR_LAUNCHER true +#define LOAD_LEGACY_RENDERER_FOR_LAUNCHER false ////////////////////////////////////////////////////////////////////////// // Where possible, these are defaults used to initialize cvars @@ -1256,7 +1256,7 @@ bool CSystem::OpenRenderLibrary(int type, const SSystemInitParams& initParams) if (allowPrompts) { AZ_Printf(AZ_TRACE_SYSTEM_WINDOW, "Asking user if they wish to continue..."); - const int mbRes = MessageBoxW(0, GetErrorStringUnsupportedGPU(gpuName, gpuVendorId, gpuDeviceId).c_str(), L"Lumberyard", MB_ICONWARNING | MB_OKCANCEL | MB_DEFBUTTON2 | MB_DEFAULT_DESKTOP_ONLY); + const int mbRes = MessageBoxW(0, GetErrorStringUnsupportedGPU(gpuName, gpuVendorId, gpuDeviceId).c_str(), L"Open 3D Engine", MB_ICONWARNING | MB_OKCANCEL | MB_DEFBUTTON2 | MB_DEFAULT_DESKTOP_ONLY); if (mbRes == IDCANCEL) { AZ_Printf(AZ_TRACE_SYSTEM_WINDOW, "User chose to cancel startup due to unsupported GPU."); @@ -2093,7 +2093,7 @@ static bool CheckCPURequirements([[maybe_unused]] CCpuFeatures* pCpu, [[maybe_un if (allowPrompts) { AZ_Printf(AZ_TRACE_SYSTEM_WINDOW, "Asking user if they wish to continue..."); - const int mbRes = MessageBoxW(0, GetErrorStringUnsupportedCPU().c_str(), L"Lumberyard", MB_ICONWARNING | MB_OKCANCEL | MB_DEFBUTTON2 | MB_DEFAULT_DESKTOP_ONLY); + const int mbRes = MessageBoxW(0, GetErrorStringUnsupportedCPU().c_str(), L"Open 3D Engine", MB_ICONWARNING | MB_OKCANCEL | MB_DEFBUTTON2 | MB_DEFAULT_DESKTOP_ONLY); if (mbRes == IDCANCEL) { AZ_Printf(AZ_TRACE_SYSTEM_WINDOW, "User chose to cancel startup."); @@ -2305,7 +2305,7 @@ AZ_POP_DISABLE_WARNING if (!bIsWindowsXPorLater) { - AZ_Error(AZ_TRACE_SYSTEM_WINDOW, false, "Lumberyard requires an OS version of Windows XP or later."); + AZ_Error(AZ_TRACE_SYSTEM_WINDOW, false, "Open 3D Engine requires an OS version of Windows XP or later."); return false; } } @@ -2420,7 +2420,7 @@ AZ_POP_DISABLE_WARNING azstrcpy( headerString, AZ_ARRAY_SIZE(headerString), - "Lumberyard - " + "Open 3D Engine - " #if defined(LINUX) "Linux " #elif defined(MAC) diff --git a/Code/CryEngine/CrySystem/SystemRender.cpp b/Code/CryEngine/CrySystem/SystemRender.cpp index 6e1a763759..01828175db 100644 --- a/Code/CryEngine/CrySystem/SystemRender.cpp +++ b/Code/CryEngine/CrySystem/SystemRender.cpp @@ -626,7 +626,7 @@ void CSystem::RenderStats() float nTextPosX = 101 - 20, nTextPosY = -2, nTextStepY = 3; m_env.p3DEngine->DisplayInfo(nTextPosX, nTextPosY, nTextStepY, iDisplayInfo != 1); - // Dump Lumberyard CPU and GPU memory statistics to screen + // Dump Open 3D Engine CPU and GPU memory statistics to screen m_env.p3DEngine->DisplayMemoryStatistics(); #if defined(ENABLE_LW_PROFILERS) diff --git a/Code/CryEngine/CrySystem/SystemWin32.cpp b/Code/CryEngine/CrySystem/SystemWin32.cpp index 5a81617bdd..a46f080106 100644 --- a/Code/CryEngine/CrySystem/SystemWin32.cpp +++ b/Code/CryEngine/CrySystem/SystemWin32.cpp @@ -1091,7 +1091,7 @@ void CSystem::FatalError(const char* format, ...) { ::ShowWindow((HWND)gEnv->pRenderer->GetHWND(), SW_MINIMIZE); } - ::MessageBox(NULL, szBuffer, "Lumberyard Error", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); + ::MessageBox(NULL, szBuffer, "Open 3D Engine Error", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); } // Dump callstack. diff --git a/Code/CryEngine/CrySystem/XML/ReadXMLSink.cpp b/Code/CryEngine/CrySystem/XML/ReadXMLSink.cpp index 8b2f6a1821..30d170435a 100644 --- a/Code/CryEngine/CrySystem/XML/ReadXMLSink.cpp +++ b/Code/CryEngine/CrySystem/XML/ReadXMLSink.cpp @@ -193,34 +193,12 @@ bool IsOptionalReadXML(const SParseParams& parseParams, XmlNodeRef& definition) return optional; } -bool CheckEnum([[maybe_unused]] const SParseParams& parseParams, const char* name, XmlNodeRef& definition, XmlNodeRef& data) +bool CheckEnum([[maybe_unused]] const SParseParams& parseParams, [[maybe_unused]] const char* name, XmlNodeRef& definition, [[maybe_unused]] XmlNodeRef& data) { if (XmlNodeRef enumNode = definition->findChild("Enum")) { // If strict mode is off, then no need to check the enum value return true; - - // if restrictive attribute set to false, check always succeeds - if (enumNode->haveAttr("restrictive")) - { - bool res = true; - enumNode->getAttr("restrictive", res); - if (!res) - { - return true; - } - } - - // else check enum values - const char* val = data->getAttr(name); - for (int i = 0; i < enumNode->getChildCount(); ++i) - { - if (0 == strcmp(enumNode->getChild(i)->getContent(), val)) - { - return true; - } - } - return false; } return true; } diff --git a/Code/CryEngine/RenderDll/Common/RenderThread.cpp b/Code/CryEngine/RenderDll/Common/RenderThread.cpp index dd52999c9b..f90c8e58b2 100644 --- a/Code/CryEngine/RenderDll/Common/RenderThread.cpp +++ b/Code/CryEngine/RenderDll/Common/RenderThread.cpp @@ -711,6 +711,7 @@ bool SRenderThread::RC_CreateDeviceTexture(CTexture* pTex, const byte* pData[6]) return pTex->RT_CreateDeviceTexture(pData); } +#if !defined(MULTITHREADED_RESOURCE_CREATION) if (pTex->IsAsyncDevTexCreation()) { return !IsFailed(); @@ -727,6 +728,7 @@ bool SRenderThread::RC_CreateDeviceTexture(CTexture* pTex, const byte* pData[6]) FlushAndWait(); return !IsFailed(); +#endif } void SRenderThread::RC_CopyDataToTexture( diff --git a/Code/CryEngine/RenderDll/Common/RendererDefs.h b/Code/CryEngine/RenderDll/Common/RendererDefs.h index 246726e743..9dad69f471 100644 --- a/Code/CryEngine/RenderDll/Common/RendererDefs.h +++ b/Code/CryEngine/RenderDll/Common/RendererDefs.h @@ -229,7 +229,7 @@ namespace detail #if defined(OPENGL) && (defined(DEBUG) || defined(_DEBUG)) #define LY_ENABLE_OPENGL_ERROR_CHECKING #endif -namespace Lumberyard +namespace O3de { namespace OpenGL { diff --git a/Code/CryEngine/RenderDll/Common/Shaders/ShaderCache.cpp b/Code/CryEngine/RenderDll/Common/Shaders/ShaderCache.cpp index a05c846c42..9963685743 100644 --- a/Code/CryEngine/RenderDll/Common/Shaders/ShaderCache.cpp +++ b/Code/CryEngine/RenderDll/Common/Shaders/ShaderCache.cpp @@ -776,9 +776,6 @@ static bool sIterateDL(DWORD& dwDL) else { return false; - nLights = 2; - nType[0] = SLMF_DIRECT; - nType[1] = SLMF_POINT; } break; case 2: diff --git a/Code/CryEngine/RenderDll/Common/Shaders/ShaderTemplate.cpp b/Code/CryEngine/RenderDll/Common/Shaders/ShaderTemplate.cpp index 77cc1f737a..79a74c35a9 100644 --- a/Code/CryEngine/RenderDll/Common/Shaders/ShaderTemplate.cpp +++ b/Code/CryEngine/RenderDll/Common/Shaders/ShaderTemplate.cpp @@ -771,7 +771,6 @@ const char* CShaderMan::mfTemplateTexIdToName(int Id) default: return "Unknown"; } - return "Unknown"; } CTexAnim* CShaderMan::mfReadTexSequence(const char* na, int Flags, [[maybe_unused]] bool bFindOnly) diff --git a/Code/CryEngine/RenderDll/XRenderD3D9/CryRenderD3D11.rc b/Code/CryEngine/RenderDll/XRenderD3D9/CryRenderD3D11.rc index 4a5d291af7..6f4202b3ea 100644 --- a/Code/CryEngine/RenderDll/XRenderD3D9/CryRenderD3D11.rc +++ b/Code/CryEngine/RenderDll/XRenderD3D9/CryRenderD3D11.rc @@ -47,7 +47,7 @@ BEGIN VALUE "FileVersion", "1, 0, 0, 1" VALUE "FileDescription", "CryRenderD3D11" VALUE "LegalCopyright", "Portions of this file Copyright (c) Amazon.com, Inc. or its affiliates. All Rights Reserved. Original file Copyright (c) Crytek GMBH. Used under license by Amazon.com, Inc. and its affiliates." - VALUE "ProductName", "Lumberyard" + VALUE "ProductName", "Open 3D Engine" VALUE "ProductVersion", "1, 0, 0, 1" END END diff --git a/Code/CryEngine/RenderDll/XRenderD3D9/CryRenderGL.rc b/Code/CryEngine/RenderDll/XRenderD3D9/CryRenderGL.rc index 48822ceada..9cbf98627e 100644 --- a/Code/CryEngine/RenderDll/XRenderD3D9/CryRenderGL.rc +++ b/Code/CryEngine/RenderDll/XRenderD3D9/CryRenderGL.rc @@ -47,7 +47,7 @@ BEGIN VALUE "FileVersion", "1, 0, 0, 1" VALUE "FileDescription", "CryRenderGL" VALUE "LegalCopyright", "Portions of this file Copyright (c) Amazon.com, Inc. or its affiliates. All Rights Reserved. Original file Copyright (c) Crytek GMBH. Used under license by Amazon.com, Inc. and its affiliates." - VALUE "ProductName", "Lumberyard" + VALUE "ProductName", "Open 3D Engine" VALUE "ProductVersion", "1, 0, 0, 1" END END diff --git a/Code/CryEngine/RenderDll/XRenderD3D9/D3DFXPipeline.cpp b/Code/CryEngine/RenderDll/XRenderD3D9/D3DFXPipeline.cpp index fa92c7c123..319a3ffe76 100644 --- a/Code/CryEngine/RenderDll/XRenderD3D9/D3DFXPipeline.cpp +++ b/Code/CryEngine/RenderDll/XRenderD3D9/D3DFXPipeline.cpp @@ -2909,7 +2909,6 @@ byte CD3D9Renderer::FX_StartQuery(SRendItem* pRI) return 0; } #endif - return 0; } void CD3D9Renderer::FX_EndQuery(SRendItem* pRI, byte bStartQ) diff --git a/Code/CryEngine/RenderDll/XRenderD3D9/DXGL/Implementation/GLContext.cpp b/Code/CryEngine/RenderDll/XRenderD3D9/DXGL/Implementation/GLContext.cpp index 535b3cac26..d23935fe18 100644 --- a/Code/CryEngine/RenderDll/XRenderD3D9/DXGL/Implementation/GLContext.cpp +++ b/Code/CryEngine/RenderDll/XRenderD3D9/DXGL/Implementation/GLContext.cpp @@ -3641,7 +3641,7 @@ case _D3DValue: \ glDrawElements(m_ePrimitiveTopologyMode, uIndexCount, m_eIndexType, pvOffset); #endif - Lumberyard::OpenGL::CheckError(); + O3de::OpenGL::CheckError(); END_TRACE(); } @@ -3662,7 +3662,7 @@ case _D3DValue: \ CRY_ASSERT(m_ePrimitiveTopologyMode != GL_NONE); glDrawArrays(m_ePrimitiveTopologyMode, uStartVertexLocation, uVertexCount); - Lumberyard::OpenGL::CheckError(); + O3de::OpenGL::CheckError(); END_TRACE(); } diff --git a/Code/CryEngine/RenderDll/XRenderD3D9/DXGL/Implementation/GLDevice.cpp b/Code/CryEngine/RenderDll/XRenderD3D9/DXGL/Implementation/GLDevice.cpp index 76e971731d..3508d23176 100644 --- a/Code/CryEngine/RenderDll/XRenderD3D9/DXGL/Implementation/GLDevice.cpp +++ b/Code/CryEngine/RenderDll/XRenderD3D9/DXGL/Implementation/GLDevice.cpp @@ -2422,7 +2422,7 @@ namespace NCryOpenGL return false; } - Lumberyard::OpenGL::ClearErrors(); + O3de::OpenGL::ClearErrors(); GLint major = 0, minor = 0; glGetIntegerv(GL_MAJOR_VERSION, &major); glGetIntegerv(GL_MINOR_VERSION, &minor); @@ -2431,7 +2431,7 @@ namespace NCryOpenGL pAdapter->m_sVersion.m_uMajorVersion = static_cast(major); pAdapter->m_sVersion.m_uMinorVersion = static_cast(minor); - return Lumberyard::OpenGL::CheckError() == GL_NO_ERROR; + return O3de::OpenGL::CheckError() == GL_NO_ERROR; } bool ParseExtensions(SAdapterPtr& pAdapter) @@ -2443,7 +2443,7 @@ namespace NCryOpenGL int num = 0, index; bool result = true; - Lumberyard::OpenGL::ClearErrors(); + O3de::OpenGL::ClearErrors(); glGetIntegerv(GL_NUM_EXTENSIONS, &num); for (index = 0; index < num; ++index) { @@ -2458,7 +2458,7 @@ namespace NCryOpenGL pAdapter->AddExtension(extension); } - return result && Lumberyard::OpenGL::CheckError() == GL_NO_ERROR; + return result && O3de::OpenGL::CheckError() == GL_NO_ERROR; } bool DetectAdapters(std::vector& kAdapters) @@ -2971,7 +2971,7 @@ namespace NCryOpenGL #endif //DXGL_CHECK_ERRORS } // namespace NCryOpenGL -namespace Lumberyard +namespace O3de { namespace OpenGL { @@ -2994,4 +2994,4 @@ namespace Lumberyard } #endif } // namespace OpenGL -} // namespace Lumberyard +} // namespace O3de diff --git a/Code/CryEngine/RenderDll/XRenderD3D9/DriverD3D.cpp b/Code/CryEngine/RenderDll/XRenderD3D9/DriverD3D.cpp index 8f2f86081f..e3675be4e1 100644 --- a/Code/CryEngine/RenderDll/XRenderD3D9/DriverD3D.cpp +++ b/Code/CryEngine/RenderDll/XRenderD3D9/DriverD3D.cpp @@ -4914,7 +4914,6 @@ bool CD3D9Renderer::ScreenShotInternal([[maybe_unused]] const char* filename, [[ // ignore invalid file access for screenshots CDebugAllowFileAccess ignoreInvalidFileAccess; - bool bRet = true; #if !defined(_RELEASE) || defined(WIN32) || defined(WIN64) || defined(ENABLE_LW_PROFILERS) if (m_pRT && !m_pRT->IsRenderThread()) { @@ -5041,8 +5040,11 @@ bool CD3D9Renderer::ScreenShotInternal([[maybe_unused]] const char* filename, [[ return CaptureFrameBufferToFile(path); +#else + + return true; + #endif//_RELEASE - return bRet; } bool CD3D9Renderer::ScreenShot(const char* filename, int iPreWidth) @@ -5656,8 +5658,6 @@ bool CD3D9Renderer::CaptureFrameBufferFast([[maybe_unused]] unsigned char* pDstR } SAFE_RELEASE(pSourceTexture); - - return bStatus; #endif return bStatus; @@ -5710,8 +5710,6 @@ bool CD3D9Renderer::CopyFrameBufferFast([[maybe_unused]] unsigned char* pDstRGBA GetDeviceContext().Unmap(pCopyTexture, 0); bStatus = true; } - - return bStatus; #endif return bStatus; diff --git a/Code/CryEngine/RenderDll/XRenderD3D9/GPUTimer.cpp b/Code/CryEngine/RenderDll/XRenderD3D9/GPUTimer.cpp index 7a61de76b3..01c24631e0 100644 --- a/Code/CryEngine/RenderDll/XRenderD3D9/GPUTimer.cpp +++ b/Code/CryEngine/RenderDll/XRenderD3D9/GPUTimer.cpp @@ -105,8 +105,9 @@ bool CD3DProfilingGPUTimer::Init() { #ifdef ENABLE_PROFILING_GPU_TIMERS return CD3DGPUTimer::Init(); -#endif +#else return false; +#endif } CD3DGPUTimer::CD3DGPUTimer() @@ -264,4 +265,4 @@ bool CD3DGPUTimer::Init() #endif return m_bInitialized; -} \ No newline at end of file +} diff --git a/Code/CryEngine/RenderDll/XRenderD3D9/MultiLayerAlphaBlendPass.cpp b/Code/CryEngine/RenderDll/XRenderD3D9/MultiLayerAlphaBlendPass.cpp index 60ce22eb2a..26bffca9c2 100644 --- a/Code/CryEngine/RenderDll/XRenderD3D9/MultiLayerAlphaBlendPass.cpp +++ b/Code/CryEngine/RenderDll/XRenderD3D9/MultiLayerAlphaBlendPass.cpp @@ -90,7 +90,7 @@ bool MultiLayerAlphaBlendPass::IsSupported() } #else m_supported = SupportLevel::NOT_SUPPORTED; - AZ_Warning("Rendering", false, "Multi-Layer Alpha Blending requires Lumberyard to have been built with the Windows 10 SDK or higher."); + AZ_Warning("Rendering", false, "Multi-Layer Alpha Blending requires Open 3D Engine to have been built with the Windows 10 SDK or higher."); #endif } diff --git a/Code/CryEngine/RenderDll/XRenderNULL/CryRenderNULL.rc b/Code/CryEngine/RenderDll/XRenderNULL/CryRenderNULL.rc index 5730d0a537..33e65697ad 100644 --- a/Code/CryEngine/RenderDll/XRenderNULL/CryRenderNULL.rc +++ b/Code/CryEngine/RenderDll/XRenderNULL/CryRenderNULL.rc @@ -84,7 +84,7 @@ BEGIN VALUE "CompanyName", "Amazon.com, Inc." VALUE "FileVersion", "1, 0, 0, 1" VALUE "LegalCopyright", "Portions of this file Copyright (c) Amazon.com, Inc. or its affiliates. All Rights Reserved. Original file Copyright (c) Crytek GMBH. Used under license by Amazon.com, Inc. and its affiliates." - VALUE "ProductName", "Lumberyard" + VALUE "ProductName", "Open 3D Engine" VALUE "ProductVersion", "1, 0, 0, 1" END END diff --git a/Code/Framework/AzCore/AzCore/Android/APKFileHandler.cpp b/Code/Framework/AzCore/AzCore/Android/APKFileHandler.cpp index b535d9e201..6f0903bf31 100644 --- a/Code/Framework/AzCore/AzCore/Android/APKFileHandler.cpp +++ b/Code/Framework/AzCore/AzCore/Android/APKFileHandler.cpp @@ -111,7 +111,7 @@ namespace AZ bool loadFileToMemory = Get().ShouldLoadFileToMemory(filename); int assetMode = loadFileToMemory ? AASSET_MODE_BUFFER : AASSET_MODE_UNKNOWN; - asset = AAssetManager_open(Utils::GetAssetManager(), Utils::StripApkPrefix(filename), assetMode); + asset = AAssetManager_open(Utils::GetAssetManager(), Utils::StripApkPrefix(filename).c_str(), assetMode); if (asset != nullptr) { @@ -192,7 +192,7 @@ namespace AZ { buf->m_offset = buf->m_totalSize - offset; } - + if (buf->m_offset > buf->m_totalSize) { buf->m_offset = buf->m_totalSize; @@ -320,12 +320,19 @@ namespace AZ bool APKFileHandler::DirectoryOrFileExists(const char* path) { - ANDROID_IO_PROFILE_SECTION_ARGS("APK DirOrFileexists"); + ANDROID_IO_PROFILE_SECTION_ARGS("APK DirOrFileExists"); + + AZ::IO::FixedMaxPath insideApkPath(Utils::StripApkPrefix(path)); - AZ::IO::PathView insideApkPathView(Utils::StripApkPrefix(path)); + // Check for the case where the input path is equal to the APK Assets Prefix of /APK + // In that case the directory is the "root" of APK assets in which case the directory exist + if (insideApkPath.empty() && Utils::IsApkPath(path)) + { + return true; + } - AZ::IO::FixedMaxPathString filename{ insideApkPathView.Filename().Native() }; - AZ::IO::FixedMaxPathString pathToFile{ insideApkPathView.ParentPath().Native() }; + AZ::IO::FixedMaxPathString filename{ insideApkPath.Filename().Native() }; + AZ::IO::FixedMaxPathString pathToFile{ insideApkPath.ParentPath().Native() }; bool foundFile = false; ParseDirectory(pathToFile.c_str(), [&](const char* name) diff --git a/Code/Framework/AzCore/AzCore/Android/Utils.cpp b/Code/Framework/AzCore/AzCore/Android/Utils.cpp index aaf3a21328..efbbf50d1d 100644 --- a/Code/Framework/AzCore/AzCore/Android/Utils.cpp +++ b/Code/Framework/AzCore/AzCore/Android/Utils.cpp @@ -17,7 +17,7 @@ #include #include - +#include namespace AZ { @@ -28,9 +28,9 @@ namespace AZ namespace { //////////////////////////////////////////////////////////////// - const char* GetApkAssetsPrefix() + constexpr const char* GetApkAssetsPrefix() { - return "/APK/"; + return "/APK"; } } @@ -104,19 +104,14 @@ namespace AZ //////////////////////////////////////////////////////////////// bool IsApkPath(const char* filePath) { - return (strncmp(filePath, GetApkAssetsPrefix(), 4) == 0); // +3 for "APK", +1 for '/' starting slash + return AZ::IO::PathView(filePath).IsRelativeTo(AZ::IO::PathView(GetApkAssetsPrefix())); } //////////////////////////////////////////////////////////////// - const char* StripApkPrefix(const char* filePath) + AZ::IO::FixedMaxPath StripApkPrefix(const char* filePath) { - const int prefixLength = 5; // +3 for "APK", +2 for '/' on either end - if (!IsApkPath(filePath)) - { - return filePath; - } - - return filePath + prefixLength; + constexpr AZ::IO::PathView apkPrefixView = GetApkAssetsPrefix(); + return AZ::IO::PathView(filePath).LexicallyProximate(apkPrefixView); } //////////////////////////////////////////////////////////////// @@ -130,7 +125,7 @@ namespace AZ // first check to see if they are in public storage (application specific) const char* publicAppStorage = GetAppPublicStoragePath(); - OSString path = OSString::format("%s/bootstrap.cfg", publicAppStorage); + OSString path = OSString::format("%s/engine.json", publicAppStorage); AZ_TracePrintf("Android::Utils", "Searching for %s\n", path.c_str()); FILE* f = fopen(path.c_str(), "r"); @@ -145,7 +140,7 @@ namespace AZ AAssetManager* mgr = GetAssetManager(); if (mgr) { - AAsset* asset = AAssetManager_open(mgr, "bootstrap.cfg", AASSET_MODE_UNKNOWN); + AAsset* asset = AAssetManager_open(mgr, "engine.json", AASSET_MODE_UNKNOWN); if (asset) { AAsset_close(asset); diff --git a/Code/Framework/AzCore/AzCore/Android/Utils.h b/Code/Framework/AzCore/AzCore/Android/Utils.h index 2398aa490d..222fac80ad 100644 --- a/Code/Framework/AzCore/AzCore/Android/Utils.h +++ b/Code/Framework/AzCore/AzCore/Android/Utils.h @@ -11,6 +11,7 @@ */ #pragma once +#include #include #include @@ -55,7 +56,7 @@ namespace AZ const char* GetObbStoragePath(); //! Get the dot separated package name for the current application. - //! e.g. com.lumberyard.samples for SamplesProject + //! e.g. com.o3de.samples for SamplesProject const char* GetPackageName(); //! Get the app version code (android:versionCode in the manifest). @@ -70,7 +71,7 @@ namespace AZ //! Will first check to verify the argument is an apk asset path and if so //! will strip the prefix from the path. //! \return The pointer position of the relative asset path - const char* StripApkPrefix(const char* filePath); + AZ::IO::FixedMaxPath StripApkPrefix(const char* filePath); //! Searches application storage and the APK for bootstrap.cfg. Will return nullptr //! if bootstrap.cfg is not found. diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetJsonSerializer.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetJsonSerializer.cpp index aa9af89457..767dadedf8 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetJsonSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Asset/AssetJsonSerializer.cpp @@ -10,7 +10,7 @@ * */ -#include +#include #include #include #include @@ -107,7 +107,8 @@ namespace AZ result = ContinueLoading(&id, azrtti_typeid(), it->value, context); if (!id.m_guid.IsNull()) { - *instance = Asset(id, instance->GetType()); + *instance = AssetManager::Instance().FindOrCreateAsset(id, instance->GetType(), AssetLoadBehavior::NoLoad); + result.Combine(context.Report(result, "Successfully created Asset with id.")); } diff --git a/Code/Framework/AzCore/AzCore/Component/Component.h b/Code/Framework/AzCore/AzCore/Component/Component.h index c2878c1c7c..4804c35013 100644 --- a/Code/Framework/AzCore/AzCore/Component/Component.h +++ b/Code/Framework/AzCore/AzCore/Component/Component.h @@ -12,7 +12,7 @@ /** @file * Header file for the Component base class. - * In Lumberyard's component entity system, each component defines a discrete + * In Open 3D Engine's component entity system, each component defines a discrete * feature that can be attached to an entity. */ @@ -76,7 +76,7 @@ namespace AZ * practice to access other components through EBuses instead of accessing them directly. * For more information, see the * Programmer's Guide to Entities and Components - * in the Lumberyard Developer Guide. + * in the Open 3D Engine Developer Guide. * @return A pointer to the entity. If the component is not attached to any entity, * the return value is a null pointer. */ @@ -426,7 +426,7 @@ namespace AZ /** * Describes the properties of the component descriptor event bus. - * This bus uses AzTypeInfo::Uuid as the ID for the specific descriptor. Lumberyard allows only one + * This bus uses AzTypeInfo::Uuid as the ID for the specific descriptor. Open 3D Engine allows only one * descriptor for each component type. When you call functions on the bus for a specific component * type, you can safely pass only one result variable because aggregating or overwriting results * is impossible. diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp index 276e9fe78d..b8d3e12712 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -174,6 +173,7 @@ namespace AZ return true; }; + //! SettingsRegistry notifier handler which updates relevant registry settings based //! on an update to '/Amazon/AzCore/Bootstrap/project_path' key. struct UpdateProjectSettingsEventHandler @@ -185,66 +185,57 @@ namespace AZ void operator()(AZStd::string_view path, AZ::SettingsRegistryInterface::Type) { - UpdateProjectSpecializationInRegistry(path); + using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString; + const auto projectPathKey = FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + AZ::IO::FixedMaxPath newProjectPath; + if (SettingsRegistryMergeUtils::IsPathAncestorDescendantOrEqual(projectPathKey, path) + && m_registry.Get(newProjectPath.Native(), projectPathKey) && newProjectPath != m_oldProjectPath) + { + UpdateProjectSettingsFromProjectPath(AZ::IO::PathView(newProjectPath)); + } + + const auto projectNameKey = FixedValueString(AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey) + "/project_name"; + FixedValueString newProjectName; + if (SettingsRegistryMergeUtils::IsPathAncestorDescendantOrEqual(projectNameKey, path) + && m_registry.Get(newProjectName, projectNameKey) && newProjectName != m_oldProjectName) + { + UpdateProjectSpecializationFromProjectName(newProjectName); + } } //! Add the project name as a specialization underneath the /Amazon/AzCore/Settings/Specializations path //! and remove the current project name specialization if one exists. - void UpdateProjectSpecializationInRegistry(AZStd::string_view path) + void UpdateProjectSpecializationFromProjectName(AZStd::string_view newProjectName) { - auto projectPathKey = - AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) - + "/project_path"; - if (path == projectPathKey) - { - AZ::SettingsRegistryInterface::FixedValueString newProjectPath; - if (m_registry.Get(newProjectPath, path) && !newProjectPath.empty()) - { - // Make the path absolute by appending to app root, in case project path is relative. - // If the project path is already absolute it will remain the same. - // If we turn it from a relative path to an absolute path, write-back the absolute path to the registry. - AZ::IO::FixedMaxPath projectPath = AZ::SettingsRegistryMergeUtils::FindEngineRoot(m_registry) / newProjectPath; - if (projectPath.Compare(newProjectPath.c_str())) - { - m_registry.Set(path, projectPath.Native()); - } + using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString; + // Add the project_name as a specialization for loading the build system dependency .setreg files + auto newProjectNameSpecialization = FixedValueString::format("%s/%.*s", AZ::SettingsRegistryMergeUtils::SpecializationsRootKey, + aznumeric_cast(newProjectName.size()), newProjectName.data()); + auto oldProjectNameSpecialization = FixedValueString::format("%s/%s", AZ::SettingsRegistryMergeUtils::SpecializationsRootKey, + m_oldProjectName.c_str()); + m_registry.Remove(oldProjectNameSpecialization); + m_oldProjectName = newProjectName; + m_registry.Set(newProjectNameSpecialization, true); + } - // Merge the project.json file into settings registry under ProjectSettingsRootKey path. - AZ::IO::FixedMaxPath projectMetadataFile{ projectPath }; - projectMetadataFile /= "project.json"; - m_registry.MergeSettingsFile(projectMetadataFile.Native(), - AZ::SettingsRegistryInterface::Format::JsonMergePatch, AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey); + void UpdateProjectSettingsFromProjectPath(AZ::IO::PathView newProjectPath) + { + // Update old Project path before attempting to merge in new Settings Registry values in order to prevent recursive calls + m_oldProjectPath = newProjectPath; - // Get the 'project_name' value from what was in the 'project.json' file... - auto projectNameKey = - AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey) - + "/project_name"; + // Merge the project.json file into settings registry under ProjectSettingsRootKey path. + AZ::IO::FixedMaxPath projectMetadataFile{ AZ::SettingsRegistryMergeUtils::FindEngineRoot(m_registry) / newProjectPath }; + projectMetadataFile /= "project.json"; + m_registry.MergeSettingsFile(projectMetadataFile.Native(), + AZ::SettingsRegistryInterface::Format::JsonMergePatch, AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey); - AZ::SettingsRegistryInterface::FixedValueString projectSpecialization; - if (m_registry.Get(projectSpecialization, projectNameKey)) - { - auto specializationKey = AZ::SettingsRegistryInterface::FixedValueString::format( - "%s/%s", AZ::SettingsRegistryMergeUtils::SpecializationsRootKey, projectSpecialization.c_str()); - if (m_currentSpecialization != specializationKey) - { - m_registry.Set(specializationKey, true); - if (!m_currentSpecialization.empty()) - { - // Remove the previous Project Name from the specialization path if it was set. - m_registry.Remove(m_currentSpecialization); - } - m_currentSpecialization = specializationKey; - - // Update all the runtime file paths based on the new "project_path" value. - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(m_registry); - } - } - } - } + // Update all the runtime file paths based on the new "project_path" value. + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(m_registry); } private: - AZ::SettingsRegistryInterface::FixedValueString m_currentSpecialization; + AZ::IO::FixedMaxPath m_oldProjectPath; + AZ::SettingsRegistryInterface::FixedValueString m_oldProjectName; AZ::SettingsRegistryInterface& m_registry; }; @@ -424,7 +415,7 @@ namespace AZ // Add the Command Line arguments into the SettingsRegistry SettingsRegistryMergeUtils::StoreCommandLineToRegistry(*m_settingsRegistry, m_commandLine); - // Merge Command Line arguments + // Merge Command Line arguments constexpr bool executeRegDumpCommands = false; SettingsRegistryMergeUtils::MergeSettingsToRegistry_CommandLine(*m_settingsRegistry, m_commandLine, executeRegDumpCommands); @@ -1395,10 +1386,7 @@ namespace AZ //========================================================================= void ComponentApplication::CalculateExecutablePath() { - Utils::GetExecutableDirectory(m_exeDirectory.data(), m_exeDirectory.capacity()); - // Update the size value of the executable directory fixed string to correctly be the length of the null-terminated string stored within it - m_exeDirectory.resize_no_construct(AZStd::char_traits::length(m_exeDirectory.data())); - m_exeDirectory.push_back(AZ_CORRECT_FILESYSTEM_SEPARATOR); + m_exeDirectory = Utils::GetExecutableDirectory(); } void ComponentApplication::CalculateAppRoot() @@ -1406,19 +1394,12 @@ namespace AZ if (AZStd::optional appRootPath = Utils::GetDefaultAppRootPath(); appRootPath) { m_appRoot = AZStd::move(*appRootPath); - if (!m_appRoot.empty() && !m_appRoot.ends_with(AZ_CORRECT_FILESYSTEM_SEPARATOR)) - { - m_appRoot.push_back(AZ_CORRECT_FILESYSTEM_SEPARATOR); - } } } void ComponentApplication::CalculateEngineRoot() { - if (m_engineRoot = AZ::SettingsRegistryMergeUtils::FindEngineRoot(*m_settingsRegistry).Native(); !m_engineRoot.empty()) - { - m_engineRoot.push_back(AZ_CORRECT_FILESYSTEM_SEPARATOR); - } + m_engineRoot = AZ::SettingsRegistryMergeUtils::FindEngineRoot(*m_settingsRegistry).Native(); } void ComponentApplication::ResolveModulePath([[maybe_unused]] AZ::OSString& modulePath) diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h index 05507ba164..ef5c813573 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -392,9 +393,9 @@ namespace AZ void* m_fixedMemoryBlock{ nullptr }; //!< Pointer to the memory block allocator, so we can free it OnDestroy. IAllocatorAllocate* m_osAllocator{ nullptr }; EntitySetType m_entities; - AZ::IO::FixedMaxPathString m_exeDirectory; - AZ::IO::FixedMaxPathString m_engineRoot; - AZ::IO::FixedMaxPathString m_appRoot; + AZ::IO::FixedMaxPath m_exeDirectory; + AZ::IO::FixedMaxPath m_engineRoot; + AZ::IO::FixedMaxPath m_appRoot; AZ::SettingsRegistryInterface::NotifyEventHandler m_projectChangedHandler; diff --git a/Code/Framework/AzCore/AzCore/Component/Entity.h b/Code/Framework/AzCore/AzCore/Component/Entity.h index b8c8782ebf..b7dcb70b9c 100644 --- a/Code/Framework/AzCore/AzCore/Component/Entity.h +++ b/Code/Framework/AzCore/AzCore/Component/Entity.h @@ -12,7 +12,7 @@ /** @file * Header file for the Entity class. - * In Lumberyard's component entity system, an entity is an addressable container for + * In Open 3D Engine's component entity system, an entity is an addressable container for * a group of components. The entity represents the functionality and properties of an * object within your game. */ diff --git a/Code/Framework/AzCore/AzCore/EBus/BusImpl.h b/Code/Framework/AzCore/AzCore/EBus/BusImpl.h index 1d72c69e07..ea4522f126 100644 --- a/Code/Framework/AzCore/AzCore/EBus/BusImpl.h +++ b/Code/Framework/AzCore/AzCore/EBus/BusImpl.h @@ -15,7 +15,7 @@ * Header file for internal EBus classes. * For more information about EBuses, see AZ::EBus and AZ::EBusTraits in this guide and * [Event Bus](http://docs.aws.amazon.com/lumberyard/latest/developerguide/asset-pipeline-ebus.html) - * in the *Lumberyard Developer Guide*. + * in the *Open 3D Engine Developer Guide*. */ #pragma once diff --git a/Code/Framework/AzCore/AzCore/EBus/EBus.h b/Code/Framework/AzCore/AzCore/EBus/EBus.h index 5cd0c2b9ec..9a83d83529 100644 --- a/Code/Framework/AzCore/AzCore/EBus/EBus.h +++ b/Code/Framework/AzCore/AzCore/EBus/EBus.h @@ -13,11 +13,11 @@ /** * @file * Header file for event bus (EBus), a general-purpose communication system - * that Lumberyard uses to dispatch notifications and receive requests. + * that Open 3D Engine uses to dispatch notifications and receive requests. * EBuses are configurable and support many different use cases. * For more information about %EBuses, see AZ::EBus in this guide and * [Event Bus](http://docs.aws.amazon.com/lumberyard/latest/developerguide/asset-pipeline-ebus.html) - * in the *Lumberyard Developer Guide*. + * in the *Open 3D Engine Developer Guide*. */ #pragma once @@ -70,7 +70,7 @@ namespace AZ * * For more information about %EBuses, see EBus in this guide and * [Event Bus](http://docs.aws.amazon.com/lumberyard/latest/developerguide/asset-pipeline-ebus.html) - * in the *Lumberyard Developer Guide*. + * in the *Open 3D Engine Developer Guide*. */ struct EBusTraits { @@ -256,7 +256,7 @@ namespace AZ /** * Event buses (EBuses) are a general-purpose communication system - * that Lumberyard uses to dispatch notifications and receive requests. + * that Open 3D Engine uses to dispatch notifications and receive requests. * * @tparam Interface A class whose virtual functions define the events * dispatched or received by the %EBus. @@ -268,7 +268,7 @@ namespace AZ * For more information about EBuses, see * [Event Bus](http://docs.aws.amazon.com/lumberyard/latest/developerguide/asset-pipeline-ebus.html) * and [Components and EBuses: Best Practices ](http://docs.aws.amazon.com/lumberyard/latest/developerguide/component-entity-system-pg-components-ebuses-best-practices.html) - * in the *Lumberyard Developer Guide*. + * in the *Open 3D Engine Developer Guide*. * * ## How Components Use EBuses * Components commonly use EBuses in two ways: to dispatch events or to handle requests. diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.h b/Code/Framework/AzCore/AzCore/IO/Path/Path.h index 28e6854e60..61294cd637 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/Path.h +++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.h @@ -96,8 +96,8 @@ namespace AZ::IO constexpr int Compare(const value_type* pathString) const noexcept; // decomposition - //! Given a windows path of "C:\lumberyard\foo\bar\name.txt" and a posix path of - //! "/lumberyard/foo/bar/name.txt" + //! Given a windows path of "C:\O3DE\foo\bar\name.txt" and a posix path of + //! "/O3DE/foo/bar/name.txt" //! The following functions return the following //! Returns the root name part of the path. if it has one. @@ -114,10 +114,10 @@ namespace AZ::IO constexpr PathView RootPath() const; //! Returns the relative path portion of the path. //! This contains the path parts after the root path - //! windows = "lumberyard\foo\bar\name.txt", posix = "lumberyard/foo/bar/name.txt" + //! windows = "O3DE\foo\bar\name.txt", posix = "O3DE/foo/bar/name.txt" constexpr PathView RelativePath() const; //! Returns the parent directory of filename contained within the path - //! windows = "C:\lumberyard\foo\bar", posix = "/lumberyard/foo/bar" + //! windows = "C:\O3DE\foo\bar", posix = "/O3DE/foo/bar" //! NOTE: If the path ends with a trailing separator "test/foo/" it is treated as being a path of //! "test/foo" as if the filename of the path is "foo" and the parent directory is "test" constexpr PathView ParentPath() const; @@ -150,7 +150,7 @@ namespace AZ::IO //! The root portion of the path is made up of root_name() / root_directory() [[nodiscard]] constexpr bool HasRootPath() const; //! checks whether the relative part of path is empty - //! (C:\\ lumberyard\dev\) + //! (C:\\ O3DE\dev\) //! ^ ^ //! root part relative part [[nodiscard]] constexpr bool HasRelativePath() const; @@ -485,10 +485,10 @@ namespace AZ::IO constexpr PathView RootPath() const; //! Returns the relative path portion of the path. //! This contains the path parts after the root path - //! windows = "lumberyard\foo\bar\name.txt", posix = "lumberyard/foo/bar/name.txt" + //! windows = "O3DE\foo\bar\name.txt", posix = "O3DE/foo/bar/name.txt" constexpr PathView RelativePath() const; //! Returns the parent directory of filename contained within the path - //! windows = "C:\lumberyard\foo\bar", posix = "/lumberyard/foo/bar" + //! windows = "C:\O3DE\foo\bar", posix = "/O3DE/foo/bar" //! NOTE: If the path ends with a trailing separator "test/foo/" it is treated as being a path of //! "test/foo" as if the filename of the path is "foo" and the parent directory is "test" constexpr PathView ParentPath() const; @@ -521,8 +521,8 @@ namespace AZ::IO //! The root portion of the path is made up of root_name() / root_directory() [[nodiscard]] constexpr bool HasRootPath() const; //! checks whether the relative part of path is empty - //! (C:\\ lumberyard\dev\) - //! ^ ^ + //! (C:\\ O3DE\dev\) + //! ^ ^ //! root part relative part [[nodiscard]] constexpr bool HasRelativePath() const; //! checks whether the path has a parent path that empty @@ -544,8 +544,8 @@ namespace AZ::IO [[nodiscard]] constexpr bool IsRelativeTo(const PathView& base) const; // decomposition - //! Given a windows path of "C:\lumberyard\foo\bar\name.txt" and a posix path of - //! "/lumberyard/foo/bar/name.txt" + //! Given a windows path of "C:\O3DE\foo\bar\name.txt" and a posix path of + //! "/O3DE/foo/bar/name.txt" //! The following functions return the following // query diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp index dc1fac68e0..33b319bbb1 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.cpp @@ -147,15 +147,18 @@ namespace AZ ReadFile(request, args); return; } - else if constexpr (AZStd::is_same_v) - { - FlushCache(args.m_path); - } - else if constexpr (AZStd::is_same_v) + else { - FlushEntireCache(); + if constexpr (AZStd::is_same_v) + { + FlushCache(args.m_path); + } + else if constexpr (AZStd::is_same_v) + { + FlushEntireCache(); + } + StreamStackEntry::QueueRequest(request); } - StreamStackEntry::QueueRequest(request); }, request->GetCommand()); } diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.cpp index 20997eac59..8990ac3eb9 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.cpp @@ -146,15 +146,18 @@ namespace AZ DestroyDedicatedCache(request, args); return; } - else if constexpr (AZStd::is_same_v) - { - FlushCache(args.m_path); - } - else if constexpr (AZStd::is_same_v) + else { - FlushEntireCache(); + if constexpr (AZStd::is_same_v) + { + FlushCache(args.m_path); + } + else if constexpr (AZStd::is_same_v) + { + FlushEntireCache(); + } + StreamStackEntry::QueueRequest(request); } - StreamStackEntry::QueueRequest(request); }, request->GetCommand()); } diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp b/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp index 62deaf7388..451d23a78d 100644 --- a/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp +++ b/Code/Framework/AzCore/AzCore/IO/Streamer/StorageDrive.cpp @@ -97,19 +97,22 @@ namespace AZ CancelRequest(request, args.m_target); return; } - else if constexpr (AZStd::is_same_v) - { - FlushCache(args.m_path); - } - else if constexpr (AZStd::is_same_v) - { - FlushEntireCache(); - } - else if constexpr (AZStd::is_same_v) + else { - Report(args); + if constexpr (AZStd::is_same_v) + { + FlushCache(args.m_path); + } + else if constexpr (AZStd::is_same_v) + { + FlushEntireCache(); + } + else if constexpr (AZStd::is_same_v) + { + Report(args); + } + StreamStackEntry::QueueRequest(request); } - StreamStackEntry::QueueRequest(request); }, request->GetCommand()); } diff --git a/Code/Framework/AzCore/AzCore/Math/Matrix3x4.cpp b/Code/Framework/AzCore/AzCore/Math/Matrix3x4.cpp index 3e3c366485..db09a86908 100644 --- a/Code/Framework/AzCore/AzCore/Math/Matrix3x4.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Matrix3x4.cpp @@ -374,7 +374,7 @@ namespace AZ targetForward.Normalize(); - // Lumberyard is Z-up and is right-handed. + // Open 3D Engine is Z-up and is right-handed. Vector3 up = Vector3::CreateAxisZ(); // We have a degenerate case if target forward is parallel to the up axis, @@ -391,7 +391,7 @@ namespace AZ up.Normalize(); // Passing in forwardAxis allows you to force a particular local-space axis to look - // at the target point. In Lumberyard, the default is forward is along Y+. + // at the target point. In Open 3D Engine, the default is forward is along Y+. switch (forwardAxis) { case Axis::XPositive: diff --git a/Code/Framework/AzCore/AzCore/Math/Matrix4x4.cpp b/Code/Framework/AzCore/AzCore/Math/Matrix4x4.cpp index df85fd7f18..49b2eeab47 100644 --- a/Code/Framework/AzCore/AzCore/Math/Matrix4x4.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Matrix4x4.cpp @@ -426,7 +426,7 @@ namespace AZ Matrix4x4 Matrix4x4::CreateProjection(float fovY, float aspectRatio, float nearDist, float farDist) { // This section contains some notes about camera matrices and field of view, because there are some subtle differences - // between the convention Lumberyard uses and what you might be used to from other software packages. + // between the convention Open 3D Engine uses and what you might be used to from other software packages. // Our camera space has the camera looking down the *positive* z-axis, the x-axis points towards the left of the screen, // and the y-axis points towards the top of the screen. // diff --git a/Code/Framework/AzCore/AzCore/Math/Obb.cpp b/Code/Framework/AzCore/AzCore/Math/Obb.cpp index 4bbecbb647..eb511669d0 100644 --- a/Code/Framework/AzCore/AzCore/Math/Obb.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Obb.cpp @@ -154,7 +154,7 @@ namespace AZ return Obb::CreateFromPositionRotationAndHalfLengths( transform.TransformPoint(obb.GetPosition()), transform.GetRotation() * obb.GetRotation(), - obb.GetHalfLengths() + transform.GetScale() * obb.GetHalfLengths() ); } } diff --git a/Code/Framework/AzCore/AzCore/Math/Transform.cpp b/Code/Framework/AzCore/AzCore/Math/Transform.cpp index 3845b7b570..77d8658d0f 100644 --- a/Code/Framework/AzCore/AzCore/Math/Transform.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Transform.cpp @@ -354,7 +354,7 @@ namespace AZ targetForward.Normalize(); - // Lumberyard is Z-up and is right-handed. + // Open 3D Engine is Z-up and is right-handed. Vector3 up = Vector3::CreateAxisZ(); // We have a degenerate case if target forward is parallel to the up axis, @@ -371,7 +371,7 @@ namespace AZ up.Normalize(); // Passing in forwardAxis allows you to force a particular local-space axis to look - // at the target point. In Lumberyard, the default is forward is along Y+. + // at the target point. In Open 3D Engine, the default is forward is along Y+. switch (forwardAxis) { case Axis::XPositive: diff --git a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp index 76e745bc00..4c33c332da 100644 --- a/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/PoolSchema.cpp @@ -707,7 +707,7 @@ PoolSchema::GarbageCollect() // occur exclusively in the destruction of the allocator. // // TODO: A better solution needs to be found for integrating back into mainline - // Lumberyard. + // Open 3D Engine. //m_impl->GarbageCollect(); } diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp index b01062fe2c..ac1e61a5aa 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp @@ -1600,7 +1600,7 @@ static int Global_Typeid(lua_State* l) return 1; } -#ifdef LUA_LUMBERYARD_EXTENSIONS +#ifdef LUA_O3DE_EXTENSIONS //========================================================================= // LUA Dummy Node Extension @@ -1631,7 +1631,7 @@ LUA_API const Node* lua_getDummyNode() return &(*s_luaDummyNodeVariable); } -#endif // LUA_LUMBERYARD_EXTENSIONS +#endif // LUA_O3DE_EXTENSIONS ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl index d4658d4e8c..eac6e5760e 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl @@ -103,7 +103,7 @@ namespace AZ const static AZ::Crc32 ChangeNotify = AZ_CRC("ChangeNotify", 0xf793bc19); const static AZ::Crc32 ClearNotify = AZ_CRC("ClearNotify", 0x88914c8c); - //! Specifies a function to accept or reject a value changed in the Lumberyard Editor. + //! Specifies a function to accept or reject a value changed in the Open 3D Engine Editor. //! For example, a component could reject AZ::EntityId values that reference its own entity. //! //! Element type to use this with: Any type that you reflect using AZ::EditContext::ClassInfo::DataElement(). diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.cpp index 4d506e1960..6c67fd284a 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.cpp @@ -22,9 +22,9 @@ namespace AZ // JsonBaseContext // - JsonBaseContext::JsonBaseContext(JsonSerializationMetadata metadata, JsonSerializationResult::JsonIssueCallback reporting, + JsonBaseContext::JsonBaseContext(JsonSerializationMetadata& metadata, JsonSerializationResult::JsonIssueCallback reporting, StackedString::Format pathFormat, SerializeContext* serializeContext, JsonRegistrationContext* registrationContext) - : m_metadata(AZStd::move(metadata)) + : m_metadata(metadata) , m_serializeContext(serializeContext) , m_registrationContext(registrationContext) , m_path(pathFormat) @@ -126,20 +126,13 @@ namespace AZ // JsonDeserializerContext // - JsonDeserializerContext::JsonDeserializerContext(const JsonDeserializerSettings& settings) + JsonDeserializerContext::JsonDeserializerContext(JsonDeserializerSettings& settings) : JsonBaseContext(settings.m_metadata, settings.m_reporting, StackedString::Format::JsonPointer, settings.m_serializeContext, settings.m_registrationContext) , m_clearContainers(settings.m_clearContainers) { } - JsonDeserializerContext::JsonDeserializerContext(JsonDeserializerSettings&& settings) - : JsonBaseContext(AZStd::move(settings.m_metadata), AZStd::move(settings.m_reporting), - StackedString::Format::JsonPointer, settings.m_serializeContext, settings.m_registrationContext) - , m_clearContainers(settings.m_clearContainers) - { - } - bool JsonDeserializerContext::ShouldClearContainers() const { return m_clearContainers; @@ -151,7 +144,7 @@ namespace AZ // JsonSerializerContext // - JsonSerializerContext::JsonSerializerContext(const JsonSerializerSettings& settings, rapidjson::Document::AllocatorType& jsonAllocator) + JsonSerializerContext::JsonSerializerContext(JsonSerializerSettings& settings, rapidjson::Document::AllocatorType& jsonAllocator) : JsonBaseContext(settings.m_metadata, settings.m_reporting, StackedString::Format::ContextPath, settings.m_serializeContext, settings.m_registrationContext) , m_jsonAllocator(jsonAllocator) @@ -159,14 +152,6 @@ namespace AZ { } - JsonSerializerContext::JsonSerializerContext(JsonSerializerSettings&& settings, rapidjson::Document::AllocatorType& jsonAllocator) - : JsonBaseContext(AZStd::move(settings.m_metadata), AZStd::move(settings.m_reporting), StackedString::Format::ContextPath, - settings.m_serializeContext, settings.m_registrationContext) - , m_jsonAllocator(jsonAllocator) - , m_keepDefaults(settings.m_keepDefaults) - { - } - rapidjson::Document::AllocatorType& JsonSerializerContext::GetJsonAllocator() { return m_jsonAllocator; diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.h b/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.h index da6483d592..f6ced44583 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.h +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/BaseJsonSerializer.h @@ -26,7 +26,7 @@ namespace AZ class JsonBaseContext { public: - JsonBaseContext(JsonSerializationMetadata metadata, JsonSerializationResult::JsonIssueCallback reporting, + JsonBaseContext(JsonSerializationMetadata& metadata, JsonSerializationResult::JsonIssueCallback reporting, StackedString::Format pathFormat, SerializeContext* serializeContext, JsonRegistrationContext* registrationContext); virtual ~JsonBaseContext() = default; @@ -71,10 +71,6 @@ namespace AZ const JsonRegistrationContext* GetRegistrationContext() const; protected: - //! Metadata that's passed in by the settings as additional configuration options or metadata that's collected - //! during processing for later use. - JsonSerializationMetadata m_metadata; - //! Callback used to report progress and issues. Users of the serialization can update the return code to change //! the behavior of the serializer. AZStd::stack m_reporters; @@ -82,6 +78,10 @@ namespace AZ //! Path to the element that's currently being operated on. StackedString m_path; + //! Metadata that's passed in by the settings as additional configuration options or metadata that's collected + //! during processing for later use. + JsonSerializationMetadata& m_metadata; + //! The Serialize Context that can be used to retrieve meta data during processing. SerializeContext* m_serializeContext = nullptr; //! The registration context for the json serialization. This can be used to retrieve the handlers for specific types. @@ -92,8 +92,7 @@ namespace AZ : public JsonBaseContext { public: - explicit JsonDeserializerContext(const JsonDeserializerSettings& settings); - explicit JsonDeserializerContext(JsonDeserializerSettings&& settings); + explicit JsonDeserializerContext(JsonDeserializerSettings& settings); ~JsonDeserializerContext() override = default; JsonDeserializerContext(const JsonDeserializerContext&) = delete; @@ -114,8 +113,7 @@ namespace AZ : public JsonBaseContext { public: - explicit JsonSerializerContext(const JsonSerializerSettings& settings, rapidjson::Document::AllocatorType& jsonAllocator); - explicit JsonSerializerContext(JsonSerializerSettings&& settings, rapidjson::Document::AllocatorType& jsonAllocator); + JsonSerializerContext(JsonSerializerSettings& settings, rapidjson::Document::AllocatorType& jsonAllocator); ~JsonSerializerContext() override = default; JsonSerializerContext(const JsonSerializerContext&) = delete; diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonMerger.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonMerger.cpp index aea239e3b9..e359888da7 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonMerger.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonMerger.cpp @@ -20,7 +20,7 @@ namespace AZ { JsonSerializationResult::ResultCode JsonMerger::ApplyPatch(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& patch, - const JsonApplyPatchSettings& settings) + JsonApplyPatchSettings& settings) { using namespace JsonSerializationResult; @@ -122,7 +122,7 @@ namespace AZ JsonSerializationResult::ResultCode JsonMerger::CreatePatch(rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, - const rapidjson::Value& target, const JsonCreatePatchSettings& settings) + const rapidjson::Value& target, JsonCreatePatchSettings& settings) { StackedString element(StackedString::Format::JsonPointer); return CreatePatchInternal(patch.SetArray(), allocator, source, target, element, settings); @@ -130,7 +130,7 @@ namespace AZ JsonSerializationResult::ResultCode JsonMerger::ApplyMergePatch(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& patch, - const JsonApplyPatchSettings& settings) + JsonApplyPatchSettings& settings) { using namespace JsonSerializationResult; @@ -196,14 +196,14 @@ namespace AZ JsonSerializationResult::ResultCode JsonMerger::CreateMergePatch(rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, - const rapidjson::Value& target, const JsonCreatePatchSettings& settings) + const rapidjson::Value& target, JsonCreatePatchSettings& settings) { StackedString element(StackedString::Format::JsonPointer); return CreateMergePatchInternal(patch, allocator, source, target, element, settings); } JsonSerializationResult::ResultCode JsonMerger::ApplyPatch_GetFromValue(rapidjson::Value** fromValue, rapidjson::Pointer& fromPointer, - rapidjson::Value& target, const rapidjson::Value& entry, StackedString& element, const JsonApplyPatchSettings& settings) + rapidjson::Value& target, const rapidjson::Value& entry, StackedString& element, JsonApplyPatchSettings& settings) { using namespace JsonSerializationResult; @@ -242,7 +242,7 @@ namespace AZ JsonSerializationResult::ResultCode JsonMerger::ApplyPatch_Add(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& entry, const rapidjson::Pointer& path, - StackedString& element, const JsonApplyPatchSettings& settings) + StackedString& element, JsonApplyPatchSettings& settings) { using namespace JsonSerializationResult; @@ -261,7 +261,7 @@ namespace AZ JsonSerializationResult::ResultCode JsonMerger::ApplyPatch_AddValue(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, const rapidjson::Pointer& path, rapidjson::Value&& newValue, - StackedString& element, const JsonApplyPatchSettings& settings) + StackedString& element, JsonApplyPatchSettings& settings) { using namespace JsonSerializationResult; @@ -347,7 +347,7 @@ namespace AZ } JsonSerializationResult::ResultCode JsonMerger::ApplyPatch_Remove(rapidjson::Value& target, const rapidjson::Pointer& path, - StackedString& element, const JsonApplyPatchSettings& settings) + StackedString& element, JsonApplyPatchSettings& settings) { using namespace JsonSerializationResult; @@ -399,7 +399,7 @@ namespace AZ JsonSerializationResult::ResultCode JsonMerger::ApplyPatch_Replace(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& entry, const rapidjson::Pointer& path, - StackedString& element, const JsonApplyPatchSettings& settings) + StackedString& element, JsonApplyPatchSettings& settings) { using namespace JsonSerializationResult; @@ -426,7 +426,7 @@ namespace AZ JsonSerializationResult::ResultCode JsonMerger::ApplyPatch_Move(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& entry, const rapidjson::Pointer& path, - StackedString& element, const JsonApplyPatchSettings& settings) + StackedString& element, JsonApplyPatchSettings& settings) { using namespace JsonSerializationResult; @@ -445,7 +445,7 @@ namespace AZ JsonSerializationResult::ResultCode JsonMerger::ApplyPatch_Copy(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& entry, const rapidjson::Pointer& path, - StackedString& element, const JsonApplyPatchSettings& settings) + StackedString& element, JsonApplyPatchSettings& settings) { using namespace JsonSerializationResult; @@ -463,7 +463,7 @@ namespace AZ } JsonSerializationResult::ResultCode JsonMerger::ApplyPatch_Test(rapidjson::Value& target, const rapidjson::Value& entry, - const rapidjson::Pointer& path, StackedString& element, const JsonApplyPatchSettings& settings) + const rapidjson::Pointer& path, StackedString& element, JsonApplyPatchSettings& settings) { using namespace JsonSerializationResult; @@ -495,7 +495,7 @@ namespace AZ JsonSerializationResult::ResultCode JsonMerger::CreatePatchInternal(rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, - const rapidjson::Value& target, StackedString& element, const JsonCreatePatchSettings& settings) + const rapidjson::Value& target, StackedString& element, JsonCreatePatchSettings& settings) { using namespace JsonSerializationResult; @@ -633,7 +633,7 @@ namespace AZ JsonSerializationResult::ResultCode JsonMerger::CreateMergePatchInternal(rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, - const rapidjson::Value& target, StackedString& element, const JsonCreatePatchSettings& settings) + const rapidjson::Value& target, StackedString& element, JsonCreatePatchSettings& settings) { using namespace JsonSerializationResult; diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonMerger.h b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonMerger.h index f016897165..a33bac117b 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonMerger.h +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonMerger.h @@ -30,43 +30,43 @@ namespace AZ //! Implementation of the JSON Patch algorithm: https://tools.ietf.org/html/rfc6902 static JsonSerializationResult::ResultCode ApplyPatch(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& patch, - const JsonApplyPatchSettings& settings); + JsonApplyPatchSettings& settings); //! Function to create JSON Patches: https://tools.ietf.org/html/rfc6902 static JsonSerializationResult::ResultCode CreatePatch(rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, - const rapidjson::Value& target, const JsonCreatePatchSettings& settings); + const rapidjson::Value& target, JsonCreatePatchSettings& settings); //! Implementation of the JSON Merge Patch algorithm: https://tools.ietf.org/html/rfc7386 static JsonSerializationResult::ResultCode ApplyMergePatch(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& patch, - const JsonApplyPatchSettings& settings); + JsonApplyPatchSettings& settings); //! Function to create JSON Merge Patches: https://tools.ietf.org/html/rfc7386 static JsonSerializationResult::ResultCode CreateMergePatch(rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, - const rapidjson::Value& target, const JsonCreatePatchSettings& settings); + const rapidjson::Value& target, JsonCreatePatchSettings& settings); static JsonSerializationResult::ResultCode ApplyPatch_GetFromValue(rapidjson::Value** fromValue, rapidjson::Pointer& fromPointer, - rapidjson::Value& target, const rapidjson::Value& entry, StackedString& element, const JsonApplyPatchSettings& settings); + rapidjson::Value& target, const rapidjson::Value& entry, StackedString& element, JsonApplyPatchSettings& settings); static JsonSerializationResult::ResultCode ApplyPatch_Add(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, - const rapidjson::Value& entry, const rapidjson::Pointer& path, StackedString& element, const JsonApplyPatchSettings& settings); + const rapidjson::Value& entry, const rapidjson::Pointer& path, StackedString& element, JsonApplyPatchSettings& settings); static JsonSerializationResult::ResultCode ApplyPatch_AddValue(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, - const rapidjson::Pointer& path, rapidjson::Value&& newValue, StackedString& element, const JsonApplyPatchSettings& settings); + const rapidjson::Pointer& path, rapidjson::Value&& newValue, StackedString& element, JsonApplyPatchSettings& settings); static JsonSerializationResult::ResultCode ApplyPatch_Remove(rapidjson::Value& target, const rapidjson::Pointer& path, - StackedString& element, const JsonApplyPatchSettings& settings); + StackedString& element, JsonApplyPatchSettings& settings); static JsonSerializationResult::ResultCode ApplyPatch_Replace(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, - const rapidjson::Value& entry, const rapidjson::Pointer& path, StackedString& element, const JsonApplyPatchSettings& settings); + const rapidjson::Value& entry, const rapidjson::Pointer& path, StackedString& element, JsonApplyPatchSettings& settings); static JsonSerializationResult::ResultCode ApplyPatch_Move(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, - const rapidjson::Value& entry, const rapidjson::Pointer& path, StackedString& element, const JsonApplyPatchSettings& settings); + const rapidjson::Value& entry, const rapidjson::Pointer& path, StackedString& element, JsonApplyPatchSettings& settings); static JsonSerializationResult::ResultCode ApplyPatch_Copy(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, - const rapidjson::Value& entry, const rapidjson::Pointer& path, StackedString& element, const JsonApplyPatchSettings& settings); + const rapidjson::Value& entry, const rapidjson::Pointer& path, StackedString& element, JsonApplyPatchSettings& settings); static JsonSerializationResult::ResultCode ApplyPatch_Test(rapidjson::Value& target, - const rapidjson::Value& entry, const rapidjson::Pointer& path, StackedString& element, const JsonApplyPatchSettings& settings); + const rapidjson::Value& entry, const rapidjson::Pointer& path, StackedString& element, JsonApplyPatchSettings& settings); static JsonSerializationResult::ResultCode CreatePatchInternal(rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, - const rapidjson::Value& target, StackedString& element, const JsonCreatePatchSettings& settings); + const rapidjson::Value& target, StackedString& element, JsonCreatePatchSettings& settings); static rapidjson::Value CreatePatchInternal_Add(rapidjson::Document::AllocatorType& allocator, StackedString& path, const rapidjson::Value& value); static rapidjson::Value CreatePatchInternal_Remove(rapidjson::Document::AllocatorType& allocator, StackedString& path); @@ -75,6 +75,6 @@ namespace AZ static JsonSerializationResult::ResultCode CreateMergePatchInternal(rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, - const rapidjson::Value& target, StackedString& element, const JsonCreatePatchSettings& settings); + const rapidjson::Value& target, StackedString& element, JsonCreatePatchSettings& settings); }; } // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerialization.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerialization.cpp index f9359b890f..0629f1c32e 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerialization.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerialization.cpp @@ -97,9 +97,18 @@ namespace AZ } } // namespace JsonSerializationInternal + JsonSerializationResult::ResultCode JsonSerialization::ApplyPatch( + rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& patch, JsonMergeApproach approach, + const JsonApplyPatchSettings& settings) + { + // Explicitly make a copy to call the correct overloaded version and avoid infinite recursion on this function. + JsonApplyPatchSettings settingsCopy{ settings }; + return ApplyPatch(target, allocator, patch, approach, settingsCopy); + } + JsonSerializationResult::ResultCode JsonSerialization::ApplyPatch(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& patch, JsonMergeApproach approach, - JsonApplyPatchSettings settings) + JsonApplyPatchSettings& settings) { using namespace JsonSerializationResult; @@ -126,8 +135,17 @@ namespace AZ } } + JsonSerializationResult::ResultCode JsonSerialization::ApplyPatch( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, + const rapidjson::Value& patch, JsonMergeApproach approach, const JsonApplyPatchSettings& settings) + { + // Explicitly make a copy to call the correct overloaded version and avoid infinite recursion on this function. + JsonApplyPatchSettings settingsCopy{settings}; + return ApplyPatch(output, allocator, source, patch, approach, settingsCopy); + } + JsonSerializationResult::ResultCode JsonSerialization::ApplyPatch(rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, - const rapidjson::Value& source, const rapidjson::Value& patch, JsonMergeApproach approach, JsonApplyPatchSettings settings) + const rapidjson::Value& source, const rapidjson::Value& patch, JsonMergeApproach approach, JsonApplyPatchSettings& settings) { using namespace JsonSerializationResult; @@ -166,9 +184,18 @@ namespace AZ return result; } + JsonSerializationResult::ResultCode JsonSerialization::CreatePatch( + rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, + const rapidjson::Value& target, JsonMergeApproach approach, const JsonCreatePatchSettings& settings) + { + // Explicitly make a copy to call the correct overloaded version and avoid infinite recursion on this function. + JsonCreatePatchSettings settingsCopy{settings}; + return CreatePatch(patch, allocator, source, target, approach, settingsCopy); + } - JsonSerializationResult::ResultCode JsonSerialization::CreatePatch(rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, - const rapidjson::Value& source, const rapidjson::Value& target, JsonMergeApproach approach, JsonCreatePatchSettings settings) + JsonSerializationResult::ResultCode JsonSerialization::CreatePatch( + rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, + const rapidjson::Value& target, JsonMergeApproach approach, JsonCreatePatchSettings& settings) { using namespace JsonSerializationResult; @@ -194,7 +221,16 @@ namespace AZ } } - JsonSerializationResult::ResultCode JsonSerialization::Load(void* object, const Uuid& objectType, const rapidjson::Value& root, JsonDeserializerSettings settings) + JsonSerializationResult::ResultCode JsonSerialization::Load( + void* object, const Uuid& objectType, const rapidjson::Value& root, const JsonDeserializerSettings& settings) + { + // Explicitly make a copy to call the correct overloaded version and avoid infinite recursion on this function. + JsonDeserializerSettings settingsCopy{settings}; + return Load(object, objectType, root, settingsCopy); + } + + JsonSerializationResult::ResultCode JsonSerialization::Load( + void* object, const Uuid& objectType, const rapidjson::Value& root, JsonDeserializerSettings& settings) { using namespace JsonSerializationResult; @@ -212,14 +248,23 @@ namespace AZ if (result.GetOutcome() == Outcomes::Success) { StackedString path(StackedString::Format::JsonPointer); - JsonDeserializerContext context(AZStd::move(settings)); + JsonDeserializerContext context(settings); result = JsonDeserializer::Load(object, objectType, root, context); } return result; } + JsonSerializationResult::ResultCode JsonSerialization::LoadTypeId( + Uuid& typeId, const rapidjson::Value& input, const Uuid* baseClassTypeId, AZStd::string_view jsonPath, + const JsonDeserializerSettings& settings) + { + // Explicitly make a copy to call the correct overloaded version and avoid infinite recursion on this function. + JsonDeserializerSettings settingsCopy{settings}; + return LoadTypeId(typeId, input, baseClassTypeId, jsonPath, settingsCopy); + } + JsonSerializationResult::ResultCode JsonSerialization::LoadTypeId(Uuid& typeId, const rapidjson::Value& input, - const Uuid* baseClassTypeId, AZStd::string_view jsonPath, JsonDeserializerSettings settings) + const Uuid* baseClassTypeId, AZStd::string_view jsonPath, JsonDeserializerSettings& settings) { using namespace JsonSerializationResult; @@ -236,7 +281,7 @@ namespace AZ ResultCode result = JsonSerializationInternal::GetContexts(settings, settings.m_serializeContext, settings.m_registrationContext); if (result.GetOutcome() == Outcomes::Success) { - JsonDeserializerContext context(AZStd::move(settings)); + JsonDeserializerContext context(settings); context.PushPath(jsonPath); result = JsonDeserializer::LoadTypeId(typeId, input, context, baseClassTypeId); @@ -244,8 +289,18 @@ namespace AZ return result; } - JsonSerializationResult::ResultCode JsonSerialization::Store(rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, - const void* object, const void* defaultObject, const Uuid& objectType, JsonSerializerSettings settings) + JsonSerializationResult::ResultCode JsonSerialization::Store( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const void* object, const void* defaultObject, + const Uuid& objectType, const JsonSerializerSettings& settings) + { + // Explicitly make a copy to call the correct overloaded version and avoid infinite recursion on this function. + JsonSerializerSettings settingsCopy{settings}; + return Store(output, allocator, object, defaultObject, objectType, settingsCopy); + } + + JsonSerializationResult::ResultCode JsonSerialization::Store( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const void* object, const void* defaultObject, + const Uuid& objectType, JsonSerializerSettings& settings) { using namespace JsonSerializationResult; @@ -269,15 +324,24 @@ namespace AZ settings.m_keepDefaults = false; } - JsonSerializerContext context(AZStd::move(settings), allocator); + JsonSerializerContext context(settings, allocator); StackedString path(StackedString::Format::ContextPath); result = JsonSerializer::Store(output, object, defaultObject, objectType, context); } return result; } + JsonSerializationResult::ResultCode JsonSerialization::StoreTypeId( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const Uuid& typeId, AZStd::string_view elementPath, + const JsonSerializerSettings& settings) + { + // Explicitly make a copy to call the correct overloaded version and avoid infinite recursion on this function. + JsonSerializerSettings settingsCopy{settings}; + return StoreTypeId(output, allocator, typeId, elementPath, settingsCopy); + } + JsonSerializationResult::ResultCode JsonSerialization::StoreTypeId(rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, - const Uuid& typeId, AZStd::string_view elementPath, JsonSerializerSettings settings) + const Uuid& typeId, AZStd::string_view elementPath, JsonSerializerSettings& settings) { using namespace JsonSerializationResult; @@ -294,7 +358,7 @@ namespace AZ ResultCode result = JsonSerializationInternal::GetContexts(settings, settings.m_serializeContext, settings.m_registrationContext); if (result.GetOutcome() == Outcomes::Success) { - JsonSerializerContext context(AZStd::move(settings), allocator); + JsonSerializerContext context(settings, allocator); context.PushPath(elementPath); result = JsonSerializer::StoreTypeName(output, typeId, context); } diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerialization.h b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerialization.h index 58c2c390a1..5746005832 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerialization.h +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerialization.h @@ -48,14 +48,25 @@ namespace AZ //! Merges two json values together by applying "patch" to "target" using the selected merge algorithm. //! This version of ApplyPatch is destructive to "target". If the patch can't be correctly applied it will - //! leave target in a partially patched state. Use the over version of ApplyPatch if target should be copied. + //! leave target in a partially patched state. Use the other version of ApplyPatch if target should be copied. //! @param target The value where the patch will be applied to. //! @param allocator The allocator associated with the document that holds the target. //! @param patch The value holding the patch information. //! @param approach The merge algorithm that will be used to apply the patch on top of the target. //! @param settings Optional additional settings to control the way the patch is applied. static JsonSerializationResult::ResultCode ApplyPatch(rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, - const rapidjson::Value& patch, JsonMergeApproach approach, JsonApplyPatchSettings settings = JsonApplyPatchSettings{}); + const rapidjson::Value& patch, JsonMergeApproach approach, const JsonApplyPatchSettings& settings = JsonApplyPatchSettings{}); + //! Merges two json values together by applying "patch" to "target" using the selected merge algorithm. + //! This version of ApplyPatch is destructive to "target". If the patch can't be correctly applied it will + //! leave target in a partially patched state. Use the other version of ApplyPatch if target should be copied. + //! @param target The value where the patch will be applied to. + //! @param allocator The allocator associated with the document that holds the target. + //! @param patch The value holding the patch information. + //! @param approach The merge algorithm that will be used to apply the patch on top of the target. + //! @param settings Additional settings to control the way the patch is applied. + static JsonSerializationResult::ResultCode ApplyPatch( + rapidjson::Value& target, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& patch, + JsonMergeApproach approach, JsonApplyPatchSettings& settings); //! Merges two json values together by applying "patch" to a copy of "output" and written to output using the //! selected merge algorithm. This version of ApplyPatch is non-destructive to "source". If the patch couldn't be @@ -68,7 +79,19 @@ namespace AZ //! @param settings Optional additional settings to control the way the patch is applied. static JsonSerializationResult::ResultCode ApplyPatch(rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, const rapidjson::Value& patch, JsonMergeApproach approach, - JsonApplyPatchSettings settings = JsonApplyPatchSettings{}); + const JsonApplyPatchSettings& settings = JsonApplyPatchSettings{}); + //! Merges two json values together by applying "patch" to a copy of "output" and written to output using the + //! selected merge algorithm. This version of ApplyPatch is non-destructive to "source". If the patch couldn't be + //! fully applied "output" will be left set to an empty (default) object. + //! @param source A copy of source with the patch applied to it or an empty object if the patch couldn't be applied. + //! @param allocator The allocator associated with the document that holds the source. + //! @param target The value where the patch will be applied to. + //! @param patch The value holding the patch information. + //! @param approach The merge algorithm that will be used to apply the patch on top of the target. + //! @param settings Additional settings to control the way the patch is applied. + static JsonSerializationResult::ResultCode ApplyPatch( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, + const rapidjson::Value& patch, JsonMergeApproach approach, JsonApplyPatchSettings& settings); //! Creates a patch using the selected merge algorithm such that when applied to source it results in target. //! @param patch The value containing the differences between source and target. @@ -79,22 +102,46 @@ namespace AZ //! @param settings Optional additional settings to control the way the patch is created. static JsonSerializationResult::ResultCode CreatePatch(rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, const rapidjson::Value& target, JsonMergeApproach approach, - JsonCreatePatchSettings settings = JsonCreatePatchSettings{}); + const JsonCreatePatchSettings& settings = JsonCreatePatchSettings{}); + //! Creates a patch using the selected merge algorithm such that when applied to source it results in target. + //! @param patch The value containing the differences between source and target. + //! @param allocator The allocator associated with the document that will hold the patch. + //! @param source The value used as a starting point. + //! @param target The value that will result if the patch is applied to the source. + //! @param approach The algorithm that will be used when the patch is applied to the source. + //! @param settings Additional settings to control the way the patch is created. + static JsonSerializationResult::ResultCode CreatePatch( + rapidjson::Value& patch, rapidjson::Document::AllocatorType& allocator, const rapidjson::Value& source, + const rapidjson::Value& target, JsonMergeApproach approach, JsonCreatePatchSettings& settings); //! Loads the data from the provided json value into the supplied object. The object is expected to be created before calling load. //! @param object Object where the data will be loaded into. //! @param root The Value or Document where the deserializer will start reading data from. - //! @param settings The settings used during deserialization. Use the value passed in from Load. + //! @param settings Optional additional settings to control the way document is deserialized. + template + static JsonSerializationResult::ResultCode Load( + T& object, const rapidjson::Value& root, const JsonDeserializerSettings& settings = JsonDeserializerSettings{}); + //! Loads the data from the provided json value into the supplied object. The object is expected to be created before calling load. + //! @param object Object where the data will be loaded into. + //! @param root The Value or Document where the deserializer will start reading data from. + //! @param settings Additional settings to control the way document is deserialized. template - static JsonSerializationResult::ResultCode Load(T& object, const rapidjson::Value& root, - JsonDeserializerSettings settings = JsonDeserializerSettings{}); + static JsonSerializationResult::ResultCode Load(T& object, const rapidjson::Value& root, JsonDeserializerSettings& settings); //! Loads the data from the provided json value into the supplied object. The object is expected to be created before calling load. //! @param object Pointer to the object where the data will be loaded into. //! @param objectType Type id of the object passed in. //! @param root The Value or Document from where the deserializer will start reading data. - //! @param settings The settings used during deserialization. Use the value passed in from Load. - static JsonSerializationResult::ResultCode Load(void* object, const Uuid& objectType, const rapidjson::Value& root, - JsonDeserializerSettings settings = JsonDeserializerSettings{}); + //! @param settings Optional additional settings to control the way document is deserialized. + static JsonSerializationResult::ResultCode Load( + void* object, const Uuid& objectType, const rapidjson::Value& root, + const JsonDeserializerSettings& settings = JsonDeserializerSettings{}); + //! Loads the data from the provided json value into the supplied object. The object is expected to be created before calling load. + //! @param object Pointer to the object where the data will be loaded into. + //! @param objectType Type id of the object passed in. + //! @param root The Value or Document from where the deserializer will start reading data. + //! @param settings Additional settings to control the way document is deserialized. + static JsonSerializationResult::ResultCode Load( + void* object, const Uuid& objectType, const rapidjson::Value& root, JsonDeserializerSettings& settings); //! Loads the type id from the provided input. //! Note: it's not recommended to use this function (frequently) as it requires users of the json file to have knowledge of the internal @@ -105,20 +152,44 @@ namespace AZ //! references multiple types then the baseClassTypeId will be used to disambiguate between the different types by looking //! if exactly one of the types inherits from the base class that baseClassTypeId points to. //! @param jsonPath An optional path to the json node. This will be used for reporting. - //! @param settings An optional settings object to change where this function collects information from. This can be same settings + //! @param settings Optional settings object to change where this function collects information from. This can be same settings //! as used for the other Load functions. static JsonSerializationResult::ResultCode LoadTypeId(Uuid& typeId, const rapidjson::Value& input, const Uuid* baseClassTypeId = nullptr, AZStd::string_view jsonPath = AZStd::string_view{}, - JsonDeserializerSettings settings = JsonDeserializerSettings{}); + const JsonDeserializerSettings& settings = JsonDeserializerSettings{}); + //! Loads the type id from the provided input. + //! Note: it's not recommended to use this function (frequently) as it requires users of the json file to have knowledge of the + //! internal type structure and is therefore harder to use. + //! @param typeId The uuid where the loaded data will be written to. If loading fails this will be a null uuid. + //! @param input The json node to load from. The node is expected to contain a string. + //! @param baseClassTypeId. An optional type id for the base class, if known. If a type name is stored in the string which + //! references multiple types then the baseClassTypeId will be used to disambiguate between the different types by looking + //! if exactly one of the types inherits from the base class that baseClassTypeId points to. + //! @param jsonPath An optional path to the json node. This will be used for reporting. + //! @param settings Settings object to change where this function collects information from. This can be same settings + //! as used for the other Load functions. + static JsonSerializationResult::ResultCode LoadTypeId( + Uuid& typeId, const rapidjson::Value& input, const Uuid* baseClassTypeId, + AZStd::string_view jsonPath, JsonDeserializerSettings& settings); //! Stores the data in the provided object as json values starting at the provided value. //! @param output The Value or Document where the converted data will start writing to. //! @param allocator The memory allocator used by RapidJSON to create the json document. //! @param object The object that will be read from for values to convert. - //! @param settings The settings used during serialization. Use the value passed in from Store. + //! @param settings Optional additional settings to control the way document is serialized. template - static JsonSerializationResult::ResultCode Store(rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, - const T& object, JsonSerializerSettings settings = JsonSerializerSettings{}); + static JsonSerializationResult::ResultCode Store( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const T& object, + const JsonSerializerSettings& settings = JsonSerializerSettings{}); + //! Stores the data in the provided object as json values starting at the provided value. + //! @param output The Value or Document where the converted data will start writing to. + //! @param allocator The memory allocator used by RapidJSON to create the json document. + //! @param object The object that will be read from for values to convert. + //! @param settings Additional settings to control the way document is serialized. + template + static JsonSerializationResult::ResultCode Store( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const T& object, + JsonSerializerSettings& settings); //! Stores the data in the provided object as json values starting at the provided value. //! @param output The Value or Document where the converted data will start writing to. @@ -127,10 +198,23 @@ namespace AZ //! @param defaultObject Default object used to compare the object to in order to determine if values are //! defaulted or not. If this is argument is provided m_keepDefaults in the settings will automatically //! be set to true. - //! @param settings The settings used during serialization. Use the value passed in from Store. + //! @param settings Optional additional settings to control the way document is serialized. + template + static JsonSerializationResult::ResultCode Store( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const T& object, const T& defaultObject, + const JsonSerializerSettings& settings = JsonSerializerSettings{}); + //! Stores the data in the provided object as json values starting at the provided value. + //! @param output The Value or Document where the converted data will start writing to. + //! @param allocator The memory allocator used by RapidJSON to create the json document. + //! @param object The object that will be read from for values to convert. + //! @param defaultObject Default object used to compare the object to in order to determine if values are + //! defaulted or not. If this is argument is provided m_keepDefaults in the settings will automatically + //! be set to true. + //! @param settings Additional settings to control the way document is serialized. template - static JsonSerializationResult::ResultCode Store(rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, - const T& object, const T& defaultObject, JsonSerializerSettings settings = JsonSerializerSettings{}); + static JsonSerializationResult::ResultCode Store( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const T& object, const T& defaultObject, + JsonSerializerSettings& settings); //! Stores the data in the provided object as json values starting at the provided value. //! @param output The Value or Document where the converted data will start writing to. @@ -140,10 +224,22 @@ namespace AZ //! defaulted or not. This argument can be null, in which case a temporary default may be created if required by //! the settings. If this is argument is provided m_keepDefaults in the settings will automatically be set to true. //! @param objectType The type id of the object and default object. - //! @param settings The settings used during serialization. Use the value passed in from Store. - static JsonSerializationResult::ResultCode Store(rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, - const void* object, const void* defaultObject, const Uuid& objectType, - JsonSerializerSettings settings = JsonSerializerSettings{}); + //! @param settings Optional additional settings to control the way document is serialized. + static JsonSerializationResult::ResultCode Store( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const void* object, const void* defaultObject, + const Uuid& objectType, const JsonSerializerSettings& settings = JsonSerializerSettings{}); + //! Stores the data in the provided object as json values starting at the provided value. + //! @param output The Value or Document where the converted data will start writing to. + //! @param allocator The memory allocator used by RapidJSON to create the json document. + //! @param object Pointer to the object that will be read from for values to convert. + //! @param defaultObject Pointer to a default object used to compare the object to in order to determine if values are + //! defaulted or not. This argument can be null, in which case a temporary default may be created if required by + //! the settings. If this is argument is provided m_keepDefaults in the settings will automatically be set to true. + //! @param objectType The type id of the object and default object. + //! @param settings Additional settings to control the way document is serialized. + static JsonSerializationResult::ResultCode Store( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const void* object, const void* defaultObject, + const Uuid& objectType, JsonSerializerSettings& settings); //! Stores a name for the type id in the provided output. The name can be safely used to reference a type such as a class during loading. //! Note: it's not recommended to use this function (frequently) as it requires users of the json file to have knowledge of the internal @@ -152,10 +248,25 @@ namespace AZ //! @param allocator The allocator associated with the document that will or already holds the output. //! @param typeId The type id to store. //! @param elementPath An optional path to the element. This will be used for reporting. - //! @param settings An optional settings object to change where this function collects information from. This can be same settings + //! @param settings Optional settings to change where this function collects information from. This can be the same settings //! as used for the other Store functions. - static JsonSerializationResult::ResultCode StoreTypeId(rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, - const Uuid& typeId, AZStd::string_view elementPath = AZStd::string_view{}, JsonSerializerSettings settings = JsonSerializerSettings{}); + static JsonSerializationResult::ResultCode StoreTypeId( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const Uuid& typeId, + AZStd::string_view elementPath = AZStd::string_view{}, const JsonSerializerSettings& settings = JsonSerializerSettings{}); + //! Stores a name for the type id in the provided output. The name can be safely used to reference a type such as a class during + //! loading. Note: it's not recommended to use this function (frequently) as it requires users of the json file to have knowledge of + //! the internal + //! type structure and is therefore harder to use. + //! @param output The json value the result will be written to. If successful this will contain a string object otherwise a default + //! object. + //! @param allocator The allocator associated with the document that will or already holds the output. + //! @param typeId The type id to store. + //! @param elementPath The path to the element. This will be used for reporting. + //! @param settings Settings to change where this function collects information from. This can be the same settings + //! as used for the other Store functions. + static JsonSerializationResult::ResultCode StoreTypeId( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const Uuid& typeId, + AZStd::string_view elementPath, JsonSerializerSettings& settings); //! Compares two json values of any type and determines if the left is less, equal or greater than the right. //! @param lhs The left hand side value for the compare. @@ -180,22 +291,43 @@ namespace AZ }; template - JsonSerializationResult::ResultCode JsonSerialization::Load(T& object, const rapidjson::Value& root, JsonDeserializerSettings settings) + JsonSerializationResult::ResultCode JsonSerialization::Load(T& object, const rapidjson::Value& root, const JsonDeserializerSettings& settings) { return Load(&object, azrtti_typeid(object), root, settings); } template - JsonSerializationResult::ResultCode JsonSerialization::Store(rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, - const T& object, JsonSerializerSettings settings) + JsonSerializationResult::ResultCode JsonSerialization::Load(T& object, const rapidjson::Value& root, JsonDeserializerSettings& settings) + { + return Load(&object, azrtti_typeid(object), root, settings); + } + + template + JsonSerializationResult::ResultCode JsonSerialization::Store( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const T& object, const JsonSerializerSettings& settings) + { + return Store(output, allocator, &object, nullptr, azrtti_typeid(object), settings); + } + + template + JsonSerializationResult::ResultCode JsonSerialization::Store( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const T& object, JsonSerializerSettings& settings) { return Store(output, allocator, &object, nullptr, azrtti_typeid(object), settings); } template JsonSerializationResult::ResultCode JsonSerialization::Store(rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, - const T& object, const T& defaultObject, JsonSerializerSettings settings) + const T& object, const T& defaultObject, const JsonSerializerSettings& settings) { return Store(output, allocator, &object,& defaultObject, azrtti_typeid(object), settings); } + + template + JsonSerializationResult::ResultCode JsonSerialization::Store( + rapidjson::Value& output, rapidjson::Document::AllocatorType& allocator, const T& object, const T& defaultObject, + JsonSerializerSettings& settings) + { + return Store(output, allocator, &object, &defaultObject, azrtti_typeid(object), settings); + } } // namespace AZ diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializationMetadata.h b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializationMetadata.h index d48f5f8d39..97d57f0631 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializationMetadata.h +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializationMetadata.h @@ -22,14 +22,20 @@ namespace AZ class JsonSerializationMetadata final { public: + //! Creates a new settings object in the metadata collection. + //! Only one object of the same type can be added or created. + //! Returns false if an object of this type was already added. + template + bool Create(Args&&... args); + //! Adds a new settings object to the metadata collection. - //! Only one object of the same type can be added. + //! Only one object of the same type can be added or created. //! Returns false if an object of this type was already added. template bool Add(MetadataT&& data); //! Adds a new settings object to the metadata collection. - //! Only one object of the same type can be added. + //! Only one object of the same type can be added or created. //! Returns false if an object of this type was already added. template bool Add(const MetadataT& data); diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializationMetadata.inl b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializationMetadata.inl index e1a540ff14..d7f6eb857d 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializationMetadata.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonSerializationMetadata.inl @@ -16,19 +16,31 @@ namespace AZ { + template + bool JsonSerializationMetadata::Create(Args&&... args) + { + const Uuid& typeId = azrtti_typeid(); + if (m_data.find(typeId) != m_data.end()) + { + AZ_Assert(false, "Metadata object of type %s already added", typeId.template ToString().c_str()); + return false; + } + + m_data.emplace(typeId, MetadataT{AZStd::forward(args)...}); + return true; + } + template bool JsonSerializationMetadata::Add(MetadataT&& data) { - auto typeId = azrtti_typeid(); - auto iter = m_data.find(typeId); - if (iter != m_data.end()) + const Uuid& typeId = azrtti_typeid(); + if (m_data.find(typeId) != m_data.end()) { - AZ_Warning("JsonSerializationMetadata", false, "Metadata object of type %s already added", - typeId.template ToString().c_str()); + AZ_Assert(false, "Metadata object of type %s already added", typeId.template ToString().c_str()); return false; } - m_data[typeId] = AZStd::any{ AZStd::forward(data) }; + m_data.emplace(typeId, AZStd::forward(data)); return true; } @@ -41,7 +53,7 @@ namespace AZ template MetadataT* JsonSerializationMetadata::Find() { - const auto& typeId = azrtti_typeid(); + const Uuid& typeId = azrtti_typeid(); auto iter = m_data.find(typeId); return iter != m_data.end() ? AZStd::any_cast(&iter->second) : nullptr; } diff --git a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp index 46f4c59455..392e95bf6e 100644 --- a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp +++ b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp @@ -576,14 +576,32 @@ namespace AZ::SettingsRegistryMergeUtils aznumeric_cast(projectPathKey.size()), projectPathKey.data()); } -#if !AZ_TRAIT_USE_ASSET_CACHE_FOLDER - // Setup the cache and user paths for Platforms where the Asset Cache Folder isn't used +#if !AZ_TRAIT_OS_IS_HOST_OS_PLATFORM + // Setup the cache and user paths when to platform specific locations when running on non-host platforms path = engineRoot; - registry.Set(FilePathKey_CacheProjectRootFolder, path.LexicallyNormal().Native()); - registry.Set(FilePathKey_CacheRootFolder, path.LexicallyNormal().Native()); - registry.Set(FilePathKey_DevWriteStorage, path.LexicallyNormal().Native()); - registry.Set(FilePathKey_ProjectUserPath, (path / "user").LexicallyNormal().Native()); -#endif // AZ_TRAIT_USE_ASSET_CACHE_FOLDER + if (AZStd::optional nonHostCacheRoot = Utils::GetDefaultAppRootPath(); + nonHostCacheRoot) + { + registry.Set(FilePathKey_CacheProjectRootFolder, *nonHostCacheRoot); + registry.Set(FilePathKey_CacheRootFolder, *nonHostCacheRoot); + } + else + { + registry.Set(FilePathKey_CacheProjectRootFolder, path.LexicallyNormal().Native()); + registry.Set(FilePathKey_CacheRootFolder, path.LexicallyNormal().Native()); + } + if (AZStd::optional devWriteStorage = Utils::GetDevWriteStoragePath(); + devWriteStorage) + { + registry.Set(FilePathKey_DevWriteStorage, *devWriteStorage); + registry.Set(FilePathKey_ProjectUserPath, *devWriteStorage); + } + else + { + registry.Set(FilePathKey_DevWriteStorage, path.LexicallyNormal().Native()); + registry.Set(FilePathKey_ProjectUserPath, (path / "user").LexicallyNormal().Native()); + } +#endif // AZ_TRAIT_OS_IS_HOST_OS_PLATFORM } void MergeSettingsToRegistry_TargetBuildDependencyRegistry(SettingsRegistryInterface& registry, const AZStd::string_view platform, @@ -986,4 +1004,12 @@ namespace AZ::SettingsRegistryMergeUtils return visitor.Finalize(); } + + bool IsPathAncestorDescendantOrEqual(AZStd::string_view candidatePath, AZStd::string_view inputPath) + { + AZ::IO::PathView candidateView{ candidatePath, AZ::IO::PosixPathSeparator }; + AZ::IO::PathView inputView{ inputPath, AZ::IO::PosixPathSeparator }; + return inputView.empty() || candidateView.IsRelativeTo(inputView) || inputView.IsRelativeTo(candidateView); + } + } diff --git a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.h b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.h index dd7488d7f1..dad6c36d0f 100644 --- a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.h +++ b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.h @@ -256,4 +256,22 @@ namespace AZ::SettingsRegistryMergeUtils aznumeric_cast(keyName.size()), keyName.data()); return registry.Get(result, key); } + + //! Check if the supplied input path is an ancestor, a descendant or exactly equal to the candidate path + //! The can be used to check if a JSON pointer to a settings registry entry has potentially + //! "modified" the object at candidate path or its children in notifications + //! @param candidatePath Path which is being checked for the ancestor/descendant relationship + //! @param inputPath Path which is checked to determine if it is an ancestor or descendant of the candidate path + //! @return true if the input path is an ancestor, descendant or equal to the candidate path + //! Example: input path is ancestor path of candidate path + //! IsPathAncestorDescendantOrEqual("/Amazon/AzCore/Bootstrap", "/Amazon/AzCore") = true + //! Example: input path is equal to candidate path + //! IsPathAncestorDescendantOrEqual("/Amazon/AzCore/Bootstrap", "/Amazon/AzCore/Bootstrap") = true + //! Example: input path is descendant of candidate path + //! IsPathAncestorDescendantOrEqual("/Amazon/AzCore/Bootstrap", "/Amazon/AzCore/Bootstrap/project_path") = true + //! //! Example: input path is unrelated to candidate path + //! IsPathAncestorDescendantOrEqual("/Amazon/AzCore/Bootstrap", "/Amazon/Project/Settings/project_name") = false + //! //! Example: The path "" is the root JSON pointer therefore that is the ancestor of all paths + //! IsPathAncestorDescendantOrEqual("/Amazon/AzCore/Bootstrap", "") = true + bool IsPathAncestorDescendantOrEqual(AZStd::string_view candidatePath, AZStd::string_view inputPath); } diff --git a/Code/Framework/AzCore/AzCore/Slice/SliceComponent.cpp b/Code/Framework/AzCore/AzCore/Slice/SliceComponent.cpp index e1a954bb51..592989ebda 100644 --- a/Code/Framework/AzCore/AzCore/Slice/SliceComponent.cpp +++ b/Code/Framework/AzCore/AzCore/Slice/SliceComponent.cpp @@ -2900,7 +2900,7 @@ namespace AZ { AZ::Data::AssetCatalogRequestBus::BroadcastResult(referencedSliceAssetPath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, slice.GetSliceAsset()->GetId()); } - AZ_Error("Slices", false, "Slice with asset ID %s and path %s has an invalid slice reference to slice with path %s. The Lumberyard editor may be unstable, it is recommended you re-launch the editor.", + AZ_Error("Slices", false, "Slice with asset ID %s and path %s has an invalid slice reference to slice with path %s. The Open 3D Engine editor may be unstable, it is recommended you re-launch the editor.", !m_myAsset ? "invalid asset" : m_myAsset->GetId().ToString().c_str(), mySliceAssetPath.empty() ? "invalid path" : mySliceAssetPath.c_str(), referencedSliceAssetPath.empty() ? "invalid path" : referencedSliceAssetPath.c_str()); diff --git a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h index 7dc4b79090..29d9b9328a 100644 --- a/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h +++ b/Code/Framework/AzCore/AzCore/StringFunc/StringFunc.h @@ -769,8 +769,8 @@ namespace AZ *! This has similar behavior to Python pathlib '/' operator and os.path.join *! Specifically, that it uses the last absolute path as the anchor for the resulting path *! https://docs.python.org/3/library/pathlib.html#pathlib.PurePath - *! This means that joining StringFunc::Path::Join("C:\\lumberyard" "F:\\lumberyard") results in "F:\\lumberyard" - *! not "C:\\lumberyard\\F:\\lumberyard" + *! This means that joining StringFunc::Path::Join("C:\\O3DE" "F:\\O3DE") results in "F:\\O3DE" + *! not "C:\\O3DE\\F:\\O3DE" *! EX: StringFunc::Path::Join("C:\\p4\\game","info\\some.file", a) == true; a== "C:\\p4\\game\\info\\some.file" *! EX: StringFunc::Path::Join("C:\\p4\\game\\info", "game\\info\\some.file", a) == true; a== "C:\\p4\\game\\info\\game\\info\\some.file" *! EX: StringFunc::Path::Join("C:\\p4\\game\\info", "\\game\\info\\some.file", a) == true; a== "C:\\game\\info\\some.file" diff --git a/Code/Framework/AzCore/AzCore/UnitTest/UnitTest.h b/Code/Framework/AzCore/AzCore/UnitTest/UnitTest.h index c00ba2dd55..49e116ee81 100644 --- a/Code/Framework/AzCore/AzCore/UnitTest/UnitTest.h +++ b/Code/Framework/AzCore/AzCore/UnitTest/UnitTest.h @@ -278,7 +278,7 @@ namespace UnitTest #define AZ_TEST_STATIC_ASSERT(_Exp) static_assert(_Exp, "Test Static Assert") #ifdef AZ_ENABLE_TRACING /* - * The AZ_TEST_START_ASSERTTEST and AZ_TEST_STOP_ASSERTTEST macros have been deprecated and will be removed in a future Lumberyard release. + * The AZ_TEST_START_ASSERTTEST and AZ_TEST_STOP_ASSERTTEST macros have been deprecated and will be removed in a future Open 3D Engine release. * The AZ_TEST_START_TRACE_SUPPRESSION and AZ_TEST_STOP_TRACE_SUPPRESSION is the recommend macros * The reason for the deprecation is that the AZ_TEST_(START|STOP)_ASSERTTEST implies that they should be used to for writing assert unit test * where the asserts themselves are expected to cause the test process to terminate. diff --git a/Code/Framework/AzCore/Platform/Android/AzCore/AzCore_Traits_Android.h b/Code/Framework/AzCore/Platform/Android/AzCore/AzCore_Traits_Android.h index eb2bf18b8e..ce7d0fd9e4 100644 --- a/Code/Framework/AzCore/Platform/Android/AzCore/AzCore_Traits_Android.h +++ b/Code/Framework/AzCore/Platform/Android/AzCore/AzCore_Traits_Android.h @@ -105,7 +105,6 @@ #define AZ_TRAIT_THREAD_HARDWARE_CONCURRENCY_RETURN_VALUE static_cast(sysconf(_SC_NPROCESSORS_ONLN)); #define AZ_TRAIT_UNITTEST_NON_PREALLOCATED_HPHA_TEST 0 #define AZ_TRAIT_UNITTEST_USE_TEST_RUNNER_ENVIRONMENT 1 -#define AZ_TRAIT_USE_ASSET_CACHE_FOLDER 0 #define AZ_TRAIT_USE_CRY_SIGNAL_HANDLER 0 #define AZ_TRAIT_USE_POSIX_STRERROR_R 1 #define AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS 0 diff --git a/Code/Framework/AzCore/Platform/Android/AzCore/IO/SystemFile_Android.cpp b/Code/Framework/AzCore/Platform/Android/AzCore/IO/SystemFile_Android.cpp index 80cdf8fa7e..2b1ebf54aa 100644 --- a/Code/Framework/AzCore/Platform/Android/AzCore/IO/SystemFile_Android.cpp +++ b/Code/Framework/AzCore/Platform/Android/AzCore/IO/SystemFile_Android.cpp @@ -193,7 +193,7 @@ namespace Platform::Internal void FindFilesInApk(const char* filter, const SystemFile::FindFileCB& cb) { // Separate the directory from the filename portion of the filter - AZ::IO::PathView filterPath(AZ::Android::Utils::StripApkPrefix(filter)); + AZ::IO::FixedMaxPath filterPath(AZ::Android::Utils::StripApkPrefix(filter)); AZ::IO::FixedMaxPathString filterDir{ filterPath.ParentPath().Native() }; AZStd::string_view fileFilter{ filterPath.Filename().Native() }; diff --git a/Code/Framework/AzCore/Platform/Linux/AzCore/AzCore_Traits_Linux.h b/Code/Framework/AzCore/Platform/Linux/AzCore/AzCore_Traits_Linux.h index 976efed60d..2f213dcfd1 100644 --- a/Code/Framework/AzCore/Platform/Linux/AzCore/AzCore_Traits_Linux.h +++ b/Code/Framework/AzCore/Platform/Linux/AzCore/AzCore_Traits_Linux.h @@ -105,7 +105,6 @@ #define AZ_TRAIT_THREAD_HARDWARE_CONCURRENCY_RETURN_VALUE static_cast(sysconf(_SC_NPROCESSORS_ONLN)); #define AZ_TRAIT_UNITTEST_NON_PREALLOCATED_HPHA_TEST 0 #define AZ_TRAIT_UNITTEST_USE_TEST_RUNNER_ENVIRONMENT 0 -#define AZ_TRAIT_USE_ASSET_CACHE_FOLDER 1 #define AZ_TRAIT_USE_CRY_SIGNAL_HANDLER 1 #define AZ_TRAIT_USE_POSIX_STRERROR_R 1 #define AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS 0 diff --git a/Code/Framework/AzCore/Platform/Mac/AzCore/AzCore_Traits_Mac.h b/Code/Framework/AzCore/Platform/Mac/AzCore/AzCore_Traits_Mac.h index e7475451bd..d03ab12ebf 100644 --- a/Code/Framework/AzCore/Platform/Mac/AzCore/AzCore_Traits_Mac.h +++ b/Code/Framework/AzCore/Platform/Mac/AzCore/AzCore_Traits_Mac.h @@ -105,7 +105,6 @@ #define AZ_TRAIT_THREAD_HARDWARE_CONCURRENCY_RETURN_VALUE static_cast(sysconf(_SC_NPROCESSORS_ONLN)); #define AZ_TRAIT_UNITTEST_NON_PREALLOCATED_HPHA_TEST 0 #define AZ_TRAIT_UNITTEST_USE_TEST_RUNNER_ENVIRONMENT 0 -#define AZ_TRAIT_USE_ASSET_CACHE_FOLDER 1 #define AZ_TRAIT_USE_CRY_SIGNAL_HANDLER 1 #define AZ_TRAIT_USE_POSIX_STRERROR_R 1 #define AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS 0 diff --git a/Code/Framework/AzCore/Platform/Windows/AzCore/AzCore_Traits_Windows.h b/Code/Framework/AzCore/Platform/Windows/AzCore/AzCore_Traits_Windows.h index 144d6ee890..52872e3d43 100644 --- a/Code/Framework/AzCore/Platform/Windows/AzCore/AzCore_Traits_Windows.h +++ b/Code/Framework/AzCore/Platform/Windows/AzCore/AzCore_Traits_Windows.h @@ -105,7 +105,6 @@ #define AZ_TRAIT_THREAD_HARDWARE_CONCURRENCY_RETURN_VALUE INVALID_RETURN_VALUE #define AZ_TRAIT_UNITTEST_NON_PREALLOCATED_HPHA_TEST 1 #define AZ_TRAIT_UNITTEST_USE_TEST_RUNNER_ENVIRONMENT 0 -#define AZ_TRAIT_USE_ASSET_CACHE_FOLDER 1 #define AZ_TRAIT_USE_CRY_SIGNAL_HANDLER 0 #define AZ_TRAIT_USE_POSIX_STRERROR_R 0 #define AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS 1 diff --git a/Code/Framework/AzCore/Platform/iOS/AzCore/AzCore_Traits_iOS.h b/Code/Framework/AzCore/Platform/iOS/AzCore/AzCore_Traits_iOS.h index 1cbe1f5e98..210841932c 100644 --- a/Code/Framework/AzCore/Platform/iOS/AzCore/AzCore_Traits_iOS.h +++ b/Code/Framework/AzCore/Platform/iOS/AzCore/AzCore_Traits_iOS.h @@ -106,7 +106,6 @@ #define AZ_TRAIT_THREAD_HARDWARE_CONCURRENCY_RETURN_VALUE static_cast(sysconf(_SC_NPROCESSORS_ONLN)); #define AZ_TRAIT_UNITTEST_NON_PREALLOCATED_HPHA_TEST 0 #define AZ_TRAIT_UNITTEST_USE_TEST_RUNNER_ENVIRONMENT 0 -#define AZ_TRAIT_USE_ASSET_CACHE_FOLDER 0 #define AZ_TRAIT_USE_CRY_SIGNAL_HANDLER 1 #define AZ_TRAIT_USE_POSIX_STRERROR_R 1 #define AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS 0 diff --git a/Code/Framework/AzCore/Tests/AZStd/Optional.cpp b/Code/Framework/AzCore/Tests/AZStd/Optional.cpp index 260c1151db..817fc9a61e 100644 --- a/Code/Framework/AzCore/Tests/AZStd/Optional.cpp +++ b/Code/Framework/AzCore/Tests/AZStd/Optional.cpp @@ -90,7 +90,7 @@ namespace UnitTest TEST_F(OptionalFixture, ConstructorInPlaceWithInitializerList) { - const optional opt(in_place, {"Lumberyard"}, 4); + const optional opt(in_place, {"O3DE"}, 4); EXPECT_TRUE(bool(opt)) << "optional constructed with args should be true"; } diff --git a/Code/Framework/AzCore/Tests/Components.cpp b/Code/Framework/AzCore/Tests/Components.cpp index 3f4a9464a9..7801f69375 100644 --- a/Code/Framework/AzCore/Tests/Components.cpp +++ b/Code/Framework/AzCore/Tests/Components.cpp @@ -1081,13 +1081,11 @@ namespace UnitTest AZStd::string filePath; if (providerId == UserSettings::CT_GLOBAL) { - filePath.append(static_cast(m_exeDirectory)); - filePath.append("GlobalUserSettings.xml"); + filePath = (m_exeDirectory / "GlobalUserSettings.xml").String(); } else if (providerId == UserSettings::CT_LOCAL) { - filePath.append(static_cast(m_exeDirectory)); - filePath.append("LocalUserSettings.xml"); + filePath = (m_exeDirectory / "LocalUserSettings.xml").String(); } return filePath; } diff --git a/Code/Framework/AzCore/Tests/IO/Path/PathTests.cpp b/Code/Framework/AzCore/Tests/IO/Path/PathTests.cpp index e7aa61a9ef..c85a78cf9b 100644 --- a/Code/Framework/AzCore/Tests/IO/Path/PathTests.cpp +++ b/Code/Framework/AzCore/Tests/IO/Path/PathTests.cpp @@ -547,7 +547,7 @@ namespace UnitTest PathLexicallyNormalParams{ '/', "foo/./bar/..", "foo" }, PathLexicallyNormalParams{ '/', "foo/.///bar/../", "foo" }, PathLexicallyNormalParams{ '/', R"(/foo\./bar\..\)", "/foo" }, - PathLexicallyNormalParams{ '\\', R"(C:/lumberyard/dev/Cache\game/../pc)", R"(C:\lumberyard\dev\Cache\pc)" } + PathLexicallyNormalParams{ '\\', R"(C:/O3DE/dev/Cache\game/../pc)", R"(C:\O3DE\dev\Cache\pc)" } ) ); @@ -756,13 +756,13 @@ namespace UnitTest PathPrefixParams{ "C:\\foo\\", "C:\\foo", true }, PathPrefixParams{ "C:", "C:\\foo", true }, PathPrefixParams{ "D:\\", "C:\\foo", false }, - PathPrefixParams{ "/lumberyard/dev/", "/lumberyard/dev", true }, - PathPrefixParams{ "/lumberyard/dev", "/lumberyard/dev/", true }, - PathPrefixParams{ "/lumberyard/dev/", "/lumberyard/dev/Cache", true }, - PathPrefixParams{ "/lumberyard/dev", "/lumberyard/dev/Cache", true }, - PathPrefixParams{ "/lumberyard/dev", "/lumberyard/dev/Cache/", true }, - PathPrefixParams{ "lumberyard/dev/", "lumberyard/dev/Cache/", true }, - PathPrefixParams{ "lumberyard\\dev/Assets", "lumberyard/dev/Cache/", false } + PathPrefixParams{ "/O3DE/dev/", "/O3DE/dev", true }, + PathPrefixParams{ "/O3DE/dev", "/O3DE/dev/", true }, + PathPrefixParams{ "/O3DE/dev/", "/O3DE/dev/Cache", true }, + PathPrefixParams{ "/O3DE/dev", "/O3DE/dev/Cache", true }, + PathPrefixParams{ "/O3DE/dev", "/O3DE/dev/Cache/", true }, + PathPrefixParams{ "O3DE/dev/", "O3DE/dev/Cache/", true }, + PathPrefixParams{ "O3DE\\dev/Assets", "O3DE/dev/Cache/", false } )); struct PathDecompositionParams @@ -854,7 +854,7 @@ namespace Benchmark } protected: AZStd::fixed_vector m_appendPaths{ "foo", "bar", "baz", "bazzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", - "boo/bar/base", "C:\\path\\to\\lumberyard", "C", "\\\\", "/", R"(test\\path/with\mixed\separators)" }; + "boo/bar/base", "C:\\path\\to\\O3DE", "C", "\\\\", "/", R"(test\\path/with\mixed\separators)" }; }; BENCHMARK_F(PathBenchmarkFixture, BM_PathAppendFixedPath)(benchmark::State& state) diff --git a/Code/Framework/AzCore/Tests/Math/ObbTests.cpp b/Code/Framework/AzCore/Tests/Math/ObbTests.cpp index f837bd677b..a90d66f288 100644 --- a/Code/Framework/AzCore/Tests/Math/ObbTests.cpp +++ b/Code/Framework/AzCore/Tests/Math/ObbTests.cpp @@ -56,6 +56,16 @@ namespace UnitTest EXPECT_THAT(obb.GetAxisZ(), IsClose(Vector3(1.0f, 0.0f, 0.0f))); } + TEST(MATH_Obb, TestScaleTransform) + { + Obb obb = Obb::CreateFromPositionRotationAndHalfLengths(position, rotation, halfLengths); + Vector3 scaleFactors = Vector3(1.0f, 2.0f, 3.0f); + Transform transform = Transform::CreateScale(scaleFactors); + obb = transform * obb; + EXPECT_THAT(obb.GetPosition(), IsClose(Vector3(1.0f, 4.0f, 9.0f))); + EXPECT_THAT(obb.GetHalfLengths(), IsClose(Vector3(0.5f, 1.0f, 1.5f))); + } + TEST(MATH_Obb, TestSetPosition) { Obb obb; diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/JsonSerializationMetadataTests.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/JsonSerializationMetadataTests.cpp index 1546681bd8..8b2f39b214 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/JsonSerializationMetadataTests.cpp +++ b/Code/Framework/AzCore/Tests/Serialization/Json/JsonSerializationMetadataTests.cpp @@ -93,8 +93,10 @@ namespace JsonSerializationTests TEST_F(JsonSerializationMetadataTests, Add_MoveDuplicateValue_ReturnsFalse) { + AZ_TEST_START_TRACE_SUPPRESSION; m_metadata->Add(TestSettingsA{ 42 }); EXPECT_FALSE(m_metadata->Add(TestSettingsA{ 88 })); + AZ_TEST_STOP_TRACE_SUPPRESSION(1); } TEST_F(JsonSerializationMetadataTests, Add_CopyNewValue_ReturnsTrue) @@ -119,11 +121,13 @@ namespace JsonSerializationTests TEST_F(JsonSerializationMetadataTests, Find_MultipleValues_ReturnsFirstValue) { - m_metadata->Add(TestSettingsA{ 42 }); + AZ_TEST_START_TRACE_SUPPRESSION; + m_metadata->Add(TestSettingsA{42}); m_metadata->Add(TestSettingsA{ 88 }); TestSettingsA* value = m_metadata->Find(); ASSERT_NE(nullptr, value); EXPECT_EQ(42, value->m_number); + AZ_TEST_STOP_TRACE_SUPPRESSION(1); } TEST_F(JsonSerializationMetadataTests, FindConst_PreviouslyAddedValue_ReturnsConstPointer) diff --git a/Code/Framework/AzCore/Tests/SettingsRegistryMergeUtilsTests.cpp b/Code/Framework/AzCore/Tests/SettingsRegistryMergeUtilsTests.cpp index 37ea9f1bc1..36b9757ce3 100644 --- a/Code/Framework/AzCore/Tests/SettingsRegistryMergeUtilsTests.cpp +++ b/Code/Framework/AzCore/Tests/SettingsRegistryMergeUtilsTests.cpp @@ -542,4 +542,14 @@ tags=tools,renderer,metal)" EXPECT_STREQ("Foo", commandLine.GetMiscValue(1).c_str()); EXPECT_STREQ("Bat", commandLine.GetMiscValue(2).c_str()); } + + using SettingsRegistryAncestorDescendantOrEqualPathFixture = SettingsRegistryMergeUtilsCommandLineFixture; + + TEST_F(SettingsRegistryAncestorDescendantOrEqualPathFixture, ValidateThatAncestorOrDescendantOrPathWithTheSameValue_Succeeds) + { + EXPECT_TRUE(AZ::SettingsRegistryMergeUtils::IsPathAncestorDescendantOrEqual("/Amazon/AzCore/Bootstrap", "/Amazon/AzCore")); + EXPECT_TRUE(AZ::SettingsRegistryMergeUtils::IsPathAncestorDescendantOrEqual("/Amazon/AzCore/Bootstrap", "/Amazon/AzCore/Bootstrap")); + EXPECT_TRUE(AZ::SettingsRegistryMergeUtils::IsPathAncestorDescendantOrEqual("/Amazon/AzCore/Bootstrap", "/Amazon/AzCore/Bootstrap/project_path")); + EXPECT_FALSE(AZ::SettingsRegistryMergeUtils::IsPathAncestorDescendantOrEqual("/Amazon/AzCore/Bootstrap", "/Amazon/Project/Settings/project_name")); + } } diff --git a/Code/Framework/AzFramework/AzFramework/Application/Application.cpp b/Code/Framework/AzFramework/AzFramework/Application/Application.cpp index ff9e0ce6c5..4b75a3d1cf 100644 --- a/Code/Framework/AzFramework/AzFramework/Application/Application.cpp +++ b/Code/Framework/AzFramework/AzFramework/Application/Application.cpp @@ -82,9 +82,6 @@ static const char* s_azFrameworkWarningWindow = "AzFramework"; -static const char* s_engineConfigFileName = "engine.json"; -static const char* s_engineConfigEngineVersionKey = "LumberyardVersion"; - namespace AzFramework { namespace ApplicationInternal @@ -264,24 +261,8 @@ namespace AzFramework void Application::PreModuleLoad() { - // Calculate the engine root by reading the engine.json file - AZStd::string engineJsonPath = AZStd::string_view{ m_engineRoot }; - engineJsonPath += s_engineConfigFileName; - AzFramework::StringFunc::Path::Normalize(engineJsonPath); - AZ::IO::LocalFileIO localFileIO; - auto readJsonResult = AzFramework::FileFunc::ReadJsonFile(engineJsonPath, &localFileIO); - - if (readJsonResult.IsSuccess()) - { - SetRootPath(RootPathType::EngineRoot, m_engineRoot.c_str()); - AZ_TracePrintf(s_azFrameworkWarningWindow, "Engine Path: %s\n", m_engineRoot.c_str()); - } - else - { - // If there is any problem reading the engine.json file, then default to engine root to the app root - AZ_Warning(s_azFrameworkWarningWindow, false, "Unable to read engine.json file '%s' (%s). Defaulting the engine root to '%s'", engineJsonPath.c_str(), readJsonResult.GetError().c_str(), m_appRoot.c_str()); - SetRootPath(RootPathType::EngineRoot, m_appRoot.c_str()); - } + SetRootPath(RootPathType::EngineRoot, m_engineRoot.c_str()); + AZ_TracePrintf(s_azFrameworkWarningWindow, "Engine Path: %s\n", m_engineRoot.c_str()); } @@ -504,13 +485,13 @@ namespace AzFramework void Application::ResolveEnginePath(AZStd::string& engineRelativePath) const { - AZStd::string fullPath = AZStd::string(m_engineRoot) + AZStd::string(AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING) + engineRelativePath; - engineRelativePath = fullPath; + AZ::IO::FixedMaxPath fullPath = m_engineRoot / engineRelativePath; + engineRelativePath = fullPath.String(); } void Application::CalculateBranchTokenForEngineRoot(AZStd::string& token) const { - AzFramework::StringFunc::AssetPath::CalculateBranchToken(AZStd::string(m_engineRoot), token); + AzFramework::StringFunc::AssetPath::CalculateBranchToken(m_engineRoot.String(), token); } //////////////////////////////////////////////////////////////////////////// @@ -648,37 +629,21 @@ namespace AzFramework void Application::SetRootPath(RootPathType type, const char* source) { - size_t sourceLen = strlen(source); - - constexpr AZStd::string_view pathSeparators{ AZ_CORRECT_AND_WRONG_FILESYSTEM_SEPARATOR }; - // Determine if we need to append a trailing path separator - bool appendTrailingPathSep = sourceLen > 0 && pathSeparators.find_first_of(source[sourceLen - 1]) == AZStd::string_view::npos; + const size_t sourceLen = strlen(source); // Copy the source path to the intended root path and correct the path separators as well switch (type) { case RootPathType::AppRoot: { - AZ_Assert(sourceLen < m_appRoot.max_size(), "String overflow for App Root: %s", source); - m_appRoot = source; - - AZStd::replace(std::begin(m_appRoot), std::end(m_appRoot), AZ_WRONG_FILESYSTEM_SEPARATOR, AZ_CORRECT_FILESYSTEM_SEPARATOR); - if (appendTrailingPathSep) - { - m_appRoot.push_back(AZ_CORRECT_FILESYSTEM_SEPARATOR); - } + AZ_Assert(sourceLen < m_appRoot.Native().max_size(), "String overflow for App Root: %s", source); + m_appRoot = AZ::IO::PathView(source).LexicallyNormal(); } break; case RootPathType::EngineRoot: { - AZ_Assert(sourceLen < m_engineRoot.max_size(), "String overflow for Engine Root: %s", source); - m_engineRoot = source; - - AZStd::replace(std::begin(m_engineRoot), std::end(m_engineRoot), AZ_WRONG_FILESYSTEM_SEPARATOR, AZ_CORRECT_FILESYSTEM_SEPARATOR); - if (appendTrailingPathSep) - { - m_engineRoot.push_back(AZ_CORRECT_FILESYSTEM_SEPARATOR); - } + AZ_Assert(sourceLen < m_engineRoot.Native().max_size(), "String overflow for Engine Root: %s", source); + m_engineRoot = AZ::IO::PathView(source).LexicallyNormal(); } break; default: diff --git a/Code/Framework/AzFramework/AzFramework/Archive/MissingFileReport.cpp b/Code/Framework/AzFramework/AzFramework/Archive/MissingFileReport.cpp index f57a4cafa6..91f945c31e 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/MissingFileReport.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/MissingFileReport.cpp @@ -28,7 +28,7 @@ namespace AZ::IO::Internal static bool IsIgnored(const char* szPath); // Do not report missing LOD files if no CGF files depend on them - // Do not report missing .cgfm files since they're not actually created and used in Lumberyard + // Do not report missing .cgfm files since they're not actually created and used in Open 3D Engine // This checking prevents our missing dependency scanner from having a lot of false positives on these files static bool IgnoreCGFDependencies(const char* szPath); diff --git a/Code/Framework/AzFramework/AzFramework/Asset/AssetBundleManifest.h b/Code/Framework/AzFramework/AzFramework/Asset/AssetBundleManifest.h index d80974382b..0c2ef28ac1 100644 --- a/Code/Framework/AzFramework/AzFramework/Asset/AssetBundleManifest.h +++ b/Code/Framework/AzFramework/AzFramework/Asset/AssetBundleManifest.h @@ -21,7 +21,7 @@ namespace AZ namespace AzFramework { - // Class to describe metadata about an AssetBundle in Lumberyard + // Class to describe metadata about an AssetBundle in Open 3D Engine class AssetBundleManifest { public: diff --git a/Code/Framework/AzFramework/AzFramework/IO/LocalFileIO.cpp b/Code/Framework/AzFramework/AzFramework/IO/LocalFileIO.cpp index bf60241419..860f1e3b4a 100644 --- a/Code/Framework/AzFramework/AzFramework/IO/LocalFileIO.cpp +++ b/Code/Framework/AzFramework/AzFramework/IO/LocalFileIO.cpp @@ -597,9 +597,9 @@ namespace AZ { // here we are making sure that the buffer being passed in has enough space to include the alias in it. // we are trying to find the LONGEST match, meaning of the following two examples, the second should 'win' - // File: g:/lumberyard/dev/files/morefiles/blah.xml - // Alias1 links to 'g:/lumberyard/dev/' - // Alias2 links to 'g:/lumberyard/dev/files/morefiles' + // File: g:/O3DE/dev/files/morefiles/blah.xml + // Alias1 links to 'g:/O3DE/dev/' + // Alias2 links to 'g:/O3DE/dev/files/morefiles' // so returning Alias2 is preferred as it is more specific, even though alias1 includes it. // note that its not possible for this to be matched if the string is shorter than the length of the alias itself so we skip // strings that are shorter than the alias's mapped path without checking. diff --git a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp index 4117c72572..b16d142365 100644 --- a/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp +++ b/Code/Framework/AzFramework/AzFramework/IO/RemoteStorageDrive.cpp @@ -126,19 +126,22 @@ namespace AzFramework return; } } - else if constexpr (AZStd::is_same_v) - { - FlushCache(args.m_path); - } - else if constexpr (AZStd::is_same_v) - { - FlushEntireCache(); - } - else if constexpr (AZStd::is_same_v) + else { - Report(args); + if constexpr (AZStd::is_same_v) + { + FlushCache(args.m_path); + } + else if constexpr (AZStd::is_same_v) + { + FlushEntireCache(); + } + else if constexpr (AZStd::is_same_v) + { + Report(args); + } + StreamStackEntry::QueueRequest(request); } - StreamStackEntry::QueueRequest(request); }, request->GetCommand()); } diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Material.h b/Code/Framework/AzFramework/AzFramework/Physics/Material.h index 72be2805f9..e9eaae929f 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Material.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Material.h @@ -168,7 +168,7 @@ namespace Physics MaterialId m_id; }; - /// An asset that holds a list of materials to be edited and assigned in Lumberyard Editor + /// An asset that holds a list of materials to be edited and assigned in Open 3D Engine Editor /// ====================================================================================== /// /// Use Asset Editor to create a MaterialLibraryAsset and add materials to it.\n diff --git a/Code/Framework/AzFramework/AzFramework/Physics/RigidBody.h b/Code/Framework/AzFramework/AzFramework/Physics/RigidBody.h new file mode 100644 index 0000000000..04d9799c8b --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Physics/RigidBody.h @@ -0,0 +1,238 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include + +#include +#include + +namespace +{ + class ReflectContext; +} + +namespace Physics +{ + class ShapeConfiguration; + class World; + class Shape; + + /// Default values used for initializing RigidBodySettings. + /// These can be modified by Physics Implementation gems. // O3DE_DEPRECATED(LY-114472) - DefaultRigidBodyConfiguration values are not shared across modules. + // Use RigidBodyConfiguration default values. + struct DefaultRigidBodyConfiguration + { + static float m_mass; + static bool m_computeInertiaTensor; + static float m_linearDamping; + static float m_angularDamping; + static float m_sleepMinEnergy; + static float m_maxAngularVelocity; + }; + + enum class MassComputeFlags : AZ::u8 + { + NONE = 0, + + //! Flags indicating whether a certain mass property should be auto-computed or not. + COMPUTE_MASS = 1, + COMPUTE_INERTIA = 1 << 1, + COMPUTE_COM = 1 << 2, + + //! If set, non-simulated shapes will also be included in the mass properties calculation. + INCLUDE_ALL_SHAPES = 1 << 3, + + DEFAULT = COMPUTE_COM | COMPUTE_INERTIA | COMPUTE_MASS + }; + + class RigidBodyConfiguration + : public WorldBodyConfiguration + { + public: + AZ_CLASS_ALLOCATOR(RigidBodyConfiguration, AZ::SystemAllocator, 0); + AZ_RTTI(RigidBodyConfiguration, "{ACFA8900-8530-4744-AF00-AA533C868A8E}", WorldBodyConfiguration); + static void Reflect(AZ::ReflectContext* context); + + enum PropertyVisibility : AZ::u16 + { + InitialVelocities = 1 << 0, ///< Whether the initial linear and angular velocities are visible. + InertiaProperties = 1 << 1, ///< Whether the whole category of inertia properties (mass, compute inertia, + ///< inertia tensor etc) is visible. + Damping = 1 << 2, ///< Whether linear and angular damping are visible. + SleepOptions = 1 << 3, ///< Whether the sleep threshold and start asleep options are visible. + Interpolation = 1 << 4, ///< Whether the interpolation option is visible. + Gravity = 1 << 5, ///< Whether the effected by gravity option is visible. + Kinematic = 1 << 6, ///< Whether the option to make the body kinematic is visible. + ContinuousCollisionDetection = 1 << 7, ///< Whether the option to enable continuous collision detection is visible. + MaxVelocities = 1 << 8 ///< Whether upper limits on velocities are visible. + }; + + RigidBodyConfiguration() = default; + RigidBodyConfiguration(const RigidBodyConfiguration& settings) = default; + + // Visibility functions. + AZ::Crc32 GetPropertyVisibility(PropertyVisibility property) const; + void SetPropertyVisibility(PropertyVisibility property, bool isVisible); + + AZ::Crc32 GetInitialVelocitiesVisibility() const; + /// Returns whether the whole category of inertia settings (mass, inertia, center of mass offset etc) is visible. + AZ::Crc32 GetInertiaSettingsVisibility() const; + /// Returns whether the individual inertia tensor field is visible or is hidden because the compute inertia option is selected. + AZ::Crc32 GetInertiaVisibility() const; + /// Returns whether the mass field is visible or is hidden because compute mass option is selected. + AZ::Crc32 GetMassVisibility() const; + /// Returns whether the individual centre of mass offset field is visible or is hidden because compute CoM option is selected. + AZ::Crc32 GetCoMVisibility() const; + AZ::Crc32 GetDampingVisibility() const; + AZ::Crc32 GetSleepOptionsVisibility() const; + AZ::Crc32 GetInterpolationVisibility() const; + AZ::Crc32 GetGravityVisibility() const; + AZ::Crc32 GetKinematicVisibility() const; + AZ::Crc32 GetCCDVisibility() const; + AZ::Crc32 GetMaxVelocitiesVisibility() const; + MassComputeFlags GetMassComputeFlags() const; + void SetMassComputeFlags(MassComputeFlags flags); + + bool IsCCDEnabled() const; + + // Basic initial settings. + AZ::Vector3 m_initialLinearVelocity = AZ::Vector3::CreateZero(); + AZ::Vector3 m_initialAngularVelocity = AZ::Vector3::CreateZero(); + AZ::Vector3 m_centerOfMassOffset = AZ::Vector3::CreateZero(); + + // Simulation parameters. + float m_mass = DefaultRigidBodyConfiguration::m_mass; + AZ::Matrix3x3 m_inertiaTensor = AZ::Matrix3x3::CreateIdentity(); + float m_linearDamping = DefaultRigidBodyConfiguration::m_linearDamping; + float m_angularDamping = DefaultRigidBodyConfiguration::m_angularDamping; + float m_sleepMinEnergy = DefaultRigidBodyConfiguration::m_sleepMinEnergy; + float m_maxAngularVelocity = DefaultRigidBodyConfiguration::m_maxAngularVelocity; + + // Visibility settings. + AZ::u16 m_propertyVisibilityFlags = (std::numeric_limits::max)(); + + bool m_startAsleep = false; + bool m_interpolateMotion = false; + bool m_gravityEnabled = true; + bool m_simulated = true; + bool m_kinematic = false; + bool m_ccdEnabled = false; ///< Whether continuous collision detection is enabled. + float m_ccdMinAdvanceCoefficient = 0.15f; ///< Coefficient affecting how granularly time is subdivided in CCD. + bool m_ccdFrictionEnabled = false; ///< Whether friction is applied when resolving CCD collisions. + + bool m_computeCenterOfMass = true; + bool m_computeInertiaTensor = true; + bool m_computeMass = true; + + //! If set, non-simulated shapes will also be included in the mass properties calculation. + bool m_includeAllShapesInMassCalculation = false; + }; + + /// Dynamic rigid body. + class RigidBody + : public WorldBody + { + public: + + AZ_CLASS_ALLOCATOR(RigidBody, AZ::SystemAllocator, 0); + AZ_RTTI(RigidBody, "{156E459F-7BB7-4B4E-ADA0-2130D96B7E80}", WorldBody); + + public: + RigidBody() = default; + explicit RigidBody(const RigidBodyConfiguration& settings); + + + virtual void AddShape(AZStd::shared_ptr shape) = 0; + virtual void RemoveShape(AZStd::shared_ptr shape) = 0; + virtual AZ::u32 GetShapeCount() { return 0; } + virtual AZStd::shared_ptr GetShape(AZ::u32 /*index*/) { return nullptr; } + + virtual AZ::Vector3 GetCenterOfMassWorld() const = 0; + virtual AZ::Vector3 GetCenterOfMassLocal() const = 0; + + virtual AZ::Matrix3x3 GetInverseInertiaWorld() const = 0; + virtual AZ::Matrix3x3 GetInverseInertiaLocal() const = 0; + + virtual float GetMass() const = 0; + virtual float GetInverseMass() const = 0; + virtual void SetMass(float mass) = 0; + virtual void SetCenterOfMassOffset(const AZ::Vector3& comOffset) = 0; + + /// Retrieves the velocity at center of mass; only linear velocity, no rotational velocity contribution. + virtual AZ::Vector3 GetLinearVelocity() const = 0; + virtual void SetLinearVelocity(const AZ::Vector3& velocity) = 0; + virtual AZ::Vector3 GetAngularVelocity() const = 0; + virtual void SetAngularVelocity(const AZ::Vector3& angularVelocity) = 0; + virtual AZ::Vector3 GetLinearVelocityAtWorldPoint(const AZ::Vector3& worldPoint) = 0; + virtual void ApplyLinearImpulse(const AZ::Vector3& impulse) = 0; + virtual void ApplyLinearImpulseAtWorldPoint(const AZ::Vector3& impulse, const AZ::Vector3& worldPoint) = 0; + virtual void ApplyAngularImpulse(const AZ::Vector3& angularImpulse) = 0; + + virtual float GetLinearDamping() const = 0; + virtual void SetLinearDamping(float damping) = 0; + virtual float GetAngularDamping() const = 0; + virtual void SetAngularDamping(float damping) = 0; + + virtual bool IsAwake() const = 0; + virtual void ForceAsleep() = 0; + virtual void ForceAwake() = 0; + virtual float GetSleepThreshold() const = 0; + virtual void SetSleepThreshold(float threshold) = 0; + + virtual bool IsKinematic() const = 0; + virtual void SetKinematic(bool kinematic) = 0; + virtual void SetKinematicTarget(const AZ::Transform& targetPosition) = 0; + + virtual bool IsGravityEnabled() const = 0; + virtual void SetGravityEnabled(bool enabled) = 0; + virtual void SetSimulationEnabled(bool enabled) = 0; + virtual void SetCCDEnabled(bool enabled) = 0; + + //! Recalculates mass, inertia and center of mass based on the flags passed. + //! @param flags MassComputeFlags specifying which properties should be recomputed. + //! @param centerOfMassOffsetOverride Optional override of the center of mass. Note: This parameter will be ignored if COMPUTE_COM is passed in flags. + //! @param inertiaTensorOverride Optional override of the inertia. Note: This parameter will be ignored if COMPUTE_INERTIA is passed in flags. + //! @param massOverride Optional override of the mass. Note: This parameter will be ignored if COMPUTE_MASS is passed in flags. + virtual void UpdateMassProperties(MassComputeFlags flags = MassComputeFlags::DEFAULT, + const AZ::Vector3* centerOfMassOffsetOverride = nullptr, + const AZ::Matrix3x3* inertiaTensorOverride = nullptr, + const float* massOverride = nullptr) = 0; + }; + + /// Bitwise operators for MassComputeFlags + inline MassComputeFlags operator|(MassComputeFlags lhs, MassComputeFlags rhs) + { + return aznumeric_cast(aznumeric_cast(lhs) | aznumeric_cast(rhs)); + } + + inline MassComputeFlags operator&(MassComputeFlags lhs, MassComputeFlags rhs) + { + return aznumeric_cast(aznumeric_cast(lhs) & aznumeric_cast(rhs)); + } + + /// Static rigid body. + class RigidBodyStatic + : public WorldBody + { + public: + AZ_CLASS_ALLOCATOR(RigidBodyStatic, AZ::SystemAllocator, 0); + AZ_RTTI(RigidBodyStatic, "{13A677BB-7085-4EDB-BCC8-306548238692}", WorldBody); + + virtual void AddShape(const AZStd::shared_ptr& shape) = 0; + virtual AZ::u32 GetShapeCount() { return 0; } + virtual AZStd::shared_ptr GetShape(AZ::u32 /*index*/) { return nullptr; } + }; +} // namespace Physics diff --git a/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityBoundsUnionSystem.cpp b/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityBoundsUnionSystem.cpp index 7623c772c5..e9b0d4609e 100644 --- a/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityBoundsUnionSystem.cpp +++ b/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityBoundsUnionSystem.cpp @@ -84,7 +84,7 @@ namespace AzFramework { if (IVisibilitySystem* visibilitySystem = AZ::Interface::Get()) { - visibilitySystem->RemoveEntry(instance_it->second.m_visibilityEntry); + visibilitySystem->GetDefaultVisibilityScene()->RemoveEntry(instance_it->second.m_visibilityEntry); m_entityVisibilityBoundsUnionInstanceMapping.erase(instance_it); } } @@ -104,7 +104,7 @@ namespace AzFramework if (visibilitySystem && !worldEntityBoundsUnion.IsClose(instance.m_visibilityEntry.m_boundingVolume)) { instance.m_visibilityEntry.m_boundingVolume = worldEntityBoundsUnion; - visibilitySystem->InsertOrUpdateEntry(instance.m_visibilityEntry); + visibilitySystem->GetDefaultVisibilityScene()->InsertOrUpdateEntry(instance.m_visibilityEntry); } } } diff --git a/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityQuery.cpp b/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityQuery.cpp index 8a2e48535f..fd119c8199 100644 --- a/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityQuery.cpp +++ b/Code/Framework/AzFramework/AzFramework/Visibility/EntityVisibilityQuery.cpp @@ -56,10 +56,10 @@ namespace AzFramework m_octreeDebug.Clear(); m_visibleEntityIds.clear(); - visSystem->Enumerate( + visSystem->GetDefaultVisibilityScene()->Enumerate( viewFrustum, [&viewFrustum, &visibleEntityIdsOut = m_visibleEntityIds, - &octreeDebug = m_octreeDebug](const AzFramework::IVisibilitySystem::NodeData& nodeData) + &octreeDebug = m_octreeDebug](const AzFramework::IVisibilityScene::NodeData& nodeData) { if (ed_visibility_showDebug) { diff --git a/Code/Framework/AzFramework/AzFramework/Visibility/IVisibilitySystem.h b/Code/Framework/AzFramework/AzFramework/Visibility/IVisibilitySystem.h index 46fef2ab5a..e7dc783a30 100644 --- a/Code/Framework/AzFramework/AzFramework/Visibility/IVisibilitySystem.h +++ b/Code/Framework/AzFramework/AzFramework/Visibility/IVisibilitySystem.h @@ -13,11 +13,13 @@ #pragma once #include +#include #include #include #include #include #include +#include #include #include @@ -45,12 +47,15 @@ namespace AzFramework TypeFlags m_typeFlags = TYPE_None; }; - //! @class IVisibilitySystem - //! @brief This is an AZ::Interface<> useful for extremely fast, CPU only, proximity and visibility queries. - class IVisibilitySystem + //! @class IVisibilityScene + //! @brief This is the interface for managing objects and visibility queries for a given scene. + class IVisibilityScene { public: - AZ_RTTI(IVisibilitySystem, "{7C6C710F-ACDB-44CD-867D-A2C4B912ECF5}"); + AZ_RTTI(IVisibilityScene, "{822BC414-3CE3-40B4-A9A2-A42EA5B9499F}"); + + IVisibilityScene() = default; + virtual ~IVisibilityScene() = default; struct NodeData { @@ -59,8 +64,8 @@ namespace AzFramework }; using EnumerateCallback = AZStd::function; - IVisibilitySystem() = default; - virtual ~IVisibilitySystem() = default; + //! Get the unique scene name, used to look up the scene in the IVisibilitySystem. Duplicate names will assert on creation. + virtual const AZ::Name& GetName() const = 0; //! Insert or update an entry within the visibility system. //! This encompasses the following three scenarios: @@ -68,11 +73,11 @@ namespace AzFramework // 2. A previously added entry moves to a new position within its current node in the spatial hash. // 3. A previously added entry moves to a new node in the spatial hash. // (causing it to be removed from its original node and added to its new node) - //! @param visibilityEntry data for the object being added to the visibility system + //! @param visibilityEntry data for the object being added/updated virtual void InsertOrUpdateEntry(VisibilityEntry& visibilityEntry) = 0; //! Removes an entry from the visibility system. - //! @param visibilityEntry data for the object being added to the visibility system + //! @param visibilityEntry data for the object being removed virtual void RemoveEntry(VisibilityEntry& visibilityEntry) = 0; //! Intersects an axis aligned bounding box against the visibility system. @@ -99,6 +104,34 @@ namespace AzFramework //! Return the number of VisibilityEntries that have been added to the system virtual uint32_t GetEntryCount() const = 0; + }; + + //! @class IVisibilitySystem + //! @brief This is an AZ::Interface<> useful for extremely fast, CPU only, proximity and visibility queries. + class IVisibilitySystem + { + public: + AZ_RTTI(IVisibilitySystem, "{7C6C710F-ACDB-44CD-867D-A2C4B912ECF5}"); + + IVisibilitySystem() = default; + virtual ~IVisibilitySystem() = default; + + //! Return the default IVisibilityScene for entities. + virtual IVisibilityScene* GetDefaultVisibilityScene() = 0; + + //! Create a new IVisibilityScene that is uniquely identified by the scene name. + virtual IVisibilityScene* CreateVisibilityScene(const AZ::Name& sceneName) = 0; + + //! Destroy the visibility scene. + //! This does not destroy the entities that are a part of the scene, only the visibility scene. + //! This will set the visScene to nullptr + virtual void DestroyVisibilityScene(IVisibilityScene* visScene) = 0; + + //! Find the IVisibilityScene that is identified by sceneName. + virtual IVisibilityScene* FindVisibilityScene(const AZ::Name& sceneName) = 0; + + //! Logs stats about the visibility system to the console. + virtual void DumpStats(const AZ::ConsoleCommandContainer& arguments) = 0; AZ_DISABLE_COPY_MOVE(IVisibilitySystem); }; diff --git a/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.cpp b/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.cpp index 95c638c5cb..cdb7ce0dd9 100644 --- a/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.cpp @@ -15,7 +15,7 @@ namespace AzFramework { - AZ_CVAR(bool, bg_octreeUseQuadtree, false, nullptr, AZ::ConsoleFunctorFlags::ReadOnly, "If set to true, the octreeSystemComponent will degenerate to a quadtree split along the X/Y plane"); + AZ_CVAR(bool, bg_octreeUseQuadtree, false, nullptr, AZ::ConsoleFunctorFlags::ReadOnly, "If set to true, the visibility octrees will degenerate to a quadtree split along the X/Y plane"); AZ_CVAR(float, bg_octreeMaxWorldExtents, 16384.0f, nullptr, AZ::ConsoleFunctorFlags::Null, "Maximum supported world size by the world octreeSystemComponent"); AZ_CVAR(uint32_t, bg_octreeNodeMaxEntries, 64, nullptr, AZ::ConsoleFunctorFlags::Null, "Maximum number of entries to allow in any node before forcing a split"); AZ_CVAR(uint32_t, bg_octreeNodeMinEntries, 32, nullptr, AZ::ConsoleFunctorFlags::Null, "Minimum number of entries to allow in a node resulting from a merge operation"); @@ -67,9 +67,9 @@ namespace AzFramework } - void OctreeNode::Insert(OctreeSystemComponent& octreeSystemComponent, VisibilityEntry* entry) + void OctreeNode::Insert(OctreeScene& octreeScene, VisibilityEntry* entry) { - AZ_Assert(entry->m_internalNode == nullptr, "Double-insertion: Insert invoked for an entry already bound to the OctreeSystemComponent"); + AZ_Assert(entry->m_internalNode == nullptr, "Double-insertion: Insert invoked for an entry already bound to the OctreeScene"); // If this is not a leaf node, try to insert into the child nodes if (m_children != nullptr) @@ -80,7 +80,7 @@ namespace AzFramework { if (AZ::ShapeIntersection::Contains(m_children[child].m_bounds, boundingVolume)) { - return m_children[child].Insert(octreeSystemComponent, entry); + return m_children[child].Insert(octreeScene, entry); } } } @@ -90,8 +90,8 @@ namespace AzFramework if ((m_children == nullptr) && (m_entries.size() >= bg_octreeNodeMaxEntries)) { // If we're not already split, and our entry list gets too large, split this node - Split(octreeSystemComponent); - Insert(octreeSystemComponent, entry); + Split(octreeScene); + Insert(octreeScene, entry); } else { @@ -102,7 +102,7 @@ namespace AzFramework } - void OctreeNode::Update(OctreeSystemComponent& octreeSystemComponent, VisibilityEntry* entry) + void OctreeNode::Update(OctreeScene& octreeScene, VisibilityEntry* entry) { AZ_Assert(entry->m_internalNode == this, "Update invoked for an entry bound to a different OctreeNode"); @@ -116,7 +116,7 @@ namespace AzFramework } // Remove the entry from our current node, since it is no longer contained - Remove(octreeSystemComponent, entry); + Remove(octreeScene, entry); // Traverse up our ancestor nodes to find the first node that fully contains the entry // This strategy assumes an entry will typically move a small distance relative to the total world @@ -125,14 +125,14 @@ namespace AzFramework { if (AZ::ShapeIntersection::Contains(insertCheck->m_bounds, boundingVolume)) { - return insertCheck->Insert(octreeSystemComponent, entry); + return insertCheck->Insert(octreeScene, entry); } insertCheck = insertCheck->m_parent; } } - void OctreeNode::Remove(OctreeSystemComponent& octreeSystemComponent, VisibilityEntry* entry) + void OctreeNode::Remove(OctreeScene& octreeScene, VisibilityEntry* entry) { AZ_Assert(entry->m_internalNode == this, "Remove invoked for an entry bound to a different OctreeNode"); AZ_Assert(m_entries[entry->m_internalNodeIndex] == entry, "Visibility entry data is corrupt"); @@ -150,29 +150,30 @@ namespace AzFramework if (m_parent != nullptr) { - m_parent->TryMerge(octreeSystemComponent); + m_parent->TryMerge(octreeScene); } } - void OctreeNode::Enumerate(const AZ::Aabb& aabb, const IVisibilitySystem::EnumerateCallback& callback) const + void OctreeNode::Enumerate(const AZ::Aabb& aabb, const IVisibilityScene::EnumerateCallback& callback) const { EnumerateHelper(aabb, callback); } - void OctreeNode::Enumerate(const AZ::Sphere& sphere, const IVisibilitySystem::EnumerateCallback& callback) const + void OctreeNode::Enumerate(const AZ::Sphere& sphere, const IVisibilityScene::EnumerateCallback& callback) const { EnumerateHelper(sphere, callback); } - void OctreeNode::Enumerate(const AZ::Frustum& frustum, const IVisibilitySystem::EnumerateCallback& callback) const + void OctreeNode::Enumerate(const AZ::Frustum& frustum, const IVisibilityScene::EnumerateCallback& callback) const { EnumerateHelper(frustum, callback); } - void OctreeNode::EnumerateNoCull(const IVisibilitySystem::EnumerateCallback& callback) const + + void OctreeNode::EnumerateNoCull(const IVisibilityScene::EnumerateCallback& callback) const { // Invoke the callback for the current node if (!m_entries.empty()) @@ -191,6 +192,7 @@ namespace AzFramework } } + const AZStd::vector& OctreeNode::GetEntries() const { return m_entries; @@ -209,7 +211,7 @@ namespace AzFramework } - void OctreeNode::TryMerge(OctreeSystemComponent& octreeSystemComponent) + void OctreeNode::TryMerge(OctreeScene& octreeScene) { if (IsLeaf()) { @@ -222,7 +224,7 @@ namespace AzFramework const uint32_t childCount = GetChildNodeCount(); for (uint32_t child = 0; child < childCount; ++child) { - m_children[child].TryMerge(octreeSystemComponent); + m_children[child].TryMerge(octreeScene); if (!m_children[child].IsLeaf()) { return; @@ -232,13 +234,13 @@ namespace AzFramework if (potentialNodeCount <= bg_octreeNodeMinEntries) { - Merge(octreeSystemComponent); + Merge(octreeScene); } } template - void OctreeNode::EnumerateHelper(const T& boundingVolume, const IVisibilitySystem::EnumerateCallback& callback) const + void OctreeNode::EnumerateHelper(const T& boundingVolume, const IVisibilityScene::EnumerateCallback& callback) const { AZ_Assert(AZ::ShapeIntersection::Overlaps(boundingVolume, m_bounds), "EnumerateHelper invoked on an octreeSystemComponent node that is not within the bounding volume"); @@ -263,11 +265,11 @@ namespace AzFramework } - void OctreeNode::Split(OctreeSystemComponent& octreeSystemComponent) + void OctreeNode::Split(OctreeScene& octreeScene) { - AZ_Assert(m_children == nullptr, "Split invoked on an octreeSystemComponent node that has already been split"); - m_childNodeIndex = octreeSystemComponent.AllocateChildNodes(); - m_children = octreeSystemComponent.GetChildNodesAtIndex(m_childNodeIndex); + AZ_Assert(m_children == nullptr, "Split invoked on an octreeScene node that has already been split"); + m_childNodeIndex = octreeScene.AllocateChildNodes(); + m_children = octreeScene.GetChildNodesAtIndex(m_childNodeIndex); // Set child split planes and bounding volumes { @@ -308,14 +310,14 @@ namespace AzFramework { entry->m_internalNode = nullptr; entry->m_internalNodeIndex = 0; - Insert(octreeSystemComponent, entry); + Insert(octreeScene, entry); } } - void OctreeNode::Merge(OctreeSystemComponent& octreeSystemComponent) + void OctreeNode::Merge(OctreeScene& octreeScene) { - AZ_Assert(m_children != nullptr, "Merge invoked on an octreeSystemComponent node that does not have children"); + AZ_Assert(m_children != nullptr, "Merge invoked on an octreeScene node that does not have children"); // Move all child entries to our own entry set const uint32_t childCount = GetChildNodeCount(); @@ -330,46 +332,20 @@ namespace AzFramework m_children[child].m_entries.clear(); } - octreeSystemComponent.ReleaseChildNodes(m_childNodeIndex); + octreeScene.ReleaseChildNodes(m_childNodeIndex); m_childNodeIndex = InvalidChildNodeIndex; m_children = nullptr; } - - void OctreeSystemComponent::Reflect(AZ::ReflectContext* context) - { - if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(1); - } - } - - - void OctreeSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) - { - provided.push_back(AZ_CRC_CE("VisibilityService")); - } - - - void OctreeSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) + OctreeScene::OctreeScene(const AZ::Name& sceneName) + : m_sceneName(sceneName) + , m_root(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-bg_octreeMaxWorldExtents), AZ::Vector3(bg_octreeMaxWorldExtents))) { - incompatible.push_back(AZ_CRC_CE("VisibilityService")); + AZ_Assert(!sceneName.IsEmpty(), "sceneName must be a valid string"); } - - OctreeSystemComponent::OctreeSystemComponent() - : m_root(AZ::Aabb::CreateFromMinMax(AZ::Vector3(-bg_octreeMaxWorldExtents), AZ::Vector3(bg_octreeMaxWorldExtents))) + OctreeScene::~OctreeScene() { - AZ::Interface::Register(this); - IVisibilitySystemRequestBus::Handler::BusConnect(); - } - - - OctreeSystemComponent::~OctreeSystemComponent() - { - IVisibilitySystemRequestBus::Handler::BusDisconnect(); - AZ::Interface::Unregister(this); for (auto page : m_nodeCache) { delete page; @@ -378,21 +354,14 @@ namespace AzFramework m_nodeCache.shrink_to_fit(); } - - void OctreeSystemComponent::Activate() - { - ; - } - - - void OctreeSystemComponent::Deactivate() + const AZ::Name& OctreeScene::GetName() const { - ; + return m_sceneName; } - - void OctreeSystemComponent::InsertOrUpdateEntry(VisibilityEntry& entry) + void OctreeScene::InsertOrUpdateEntry(VisibilityEntry& entry) { + AZStd::lock_guard lock(m_sharedMutex); if (entry.m_internalNode != nullptr) { static_cast(entry.m_internalNode)->Update(*this, &entry); @@ -405,8 +374,9 @@ namespace AzFramework } - void OctreeSystemComponent::RemoveEntry(VisibilityEntry& entry) + void OctreeScene::RemoveEntry(VisibilityEntry& entry) { + AZStd::lock_guard lock(m_sharedMutex); if (entry.m_internalNode) { static_cast(entry.m_internalNode)->Remove(*this, &entry); @@ -415,70 +385,71 @@ namespace AzFramework } - void OctreeSystemComponent::Enumerate(const AZ::Aabb& aabb, const IVisibilitySystem::EnumerateCallback& callback) const + void OctreeScene::Enumerate(const AZ::Aabb& aabb, const IVisibilityScene::EnumerateCallback& callback) const { + AZStd::shared_lock lock(m_sharedMutex); m_root.Enumerate(aabb, callback); } - void OctreeSystemComponent::Enumerate(const AZ::Sphere& sphere, const IVisibilitySystem::EnumerateCallback& callback) const + void OctreeScene::Enumerate(const AZ::Sphere& sphere, const IVisibilityScene::EnumerateCallback& callback) const { + AZStd::shared_lock lock(m_sharedMutex); m_root.Enumerate(sphere, callback); } - void OctreeSystemComponent::Enumerate(const AZ::Frustum& frustum, const IVisibilitySystem::EnumerateCallback& callback) const + void OctreeScene::Enumerate(const AZ::Frustum& frustum, const IVisibilityScene::EnumerateCallback& callback) const { + AZStd::shared_lock lock(m_sharedMutex); m_root.Enumerate(frustum, callback); } - void OctreeSystemComponent::EnumerateNoCull(const IVisibilitySystem::EnumerateCallback& callback) const + + void OctreeScene::EnumerateNoCull(const IVisibilityScene::EnumerateCallback& callback) const { + AZStd::shared_lock lock(m_sharedMutex); m_root.EnumerateNoCull(callback); } - uint32_t OctreeSystemComponent::GetEntryCount() const - { - return m_entryCount; - } - OctreeNode& OctreeSystemComponent::GetRoot() + uint32_t OctreeScene::GetEntryCount() const { - return m_root; + return m_entryCount; } - uint32_t OctreeSystemComponent::GetNodeCount() const + uint32_t OctreeScene::GetNodeCount() const { return m_nodeCount; } - uint32_t OctreeSystemComponent::GetFreeNodeCount() const + uint32_t OctreeScene::GetFreeNodeCount() const { // Each entry represents GetChildNodeCount() nodes return aznumeric_cast(m_freeOctreeNodes.size() * GetChildNodeCount()); } - uint32_t OctreeSystemComponent::GetPageCount() const + uint32_t OctreeScene::GetPageCount() const { return aznumeric_cast(m_nodeCache.size()); } - uint32_t OctreeSystemComponent::GetChildNodeCount() const + uint32_t OctreeScene::GetChildNodeCount() const { return AzFramework::GetChildNodeCount(); } - void OctreeSystemComponent::DumpStats([[maybe_unused]] const AZ::ConsoleCommandContainer& arguments) + void OctreeScene::DumpStats() { - AZ_TracePrintf("Console", "OctreeNode::EntryCount = %u", GetEntryCount()); - AZ_TracePrintf("Console", "OctreeNode::NodeCount = %u", GetNodeCount()); - AZ_TracePrintf("Console", "OctreeNode::FreeNodeCount = %u", GetFreeNodeCount()); - AZ_TracePrintf("Console", "OctreeNode::PageCount = %u", GetPageCount()); - AZ_TracePrintf("Console", "OctreeNode::ChildNodeCount = %u", GetChildNodeCount()); + AZ_TracePrintf("Console", "OctreeScene[\"%s\"]::EntryCount = %u", GetName().GetCStr(), GetEntryCount()); + AZ_TracePrintf("Console", "OctreeScene[\"%s\"]::NodeCount = %u", GetName().GetCStr(), GetNodeCount()); + AZ_TracePrintf("Console", "OctreeScene[\"%s\"]::FreeNodeCount = %u", GetName().GetCStr(), GetFreeNodeCount()); + AZ_TracePrintf("Console", "OctreeScene[\"%s\"]::PageCount = %u", GetName().GetCStr(), GetPageCount()); + AZ_TracePrintf("Console", "OctreeScene[\"%s\"]::ChildNodeCount = %u", GetName().GetCStr(), GetChildNodeCount()); } @@ -496,7 +467,7 @@ namespace AzFramework } - uint32_t OctreeSystemComponent::AllocateChildNodes() + uint32_t OctreeScene::AllocateChildNodes() { const uint32_t childCount = GetChildNodeCount(); m_nodeCount += childCount; @@ -540,18 +511,124 @@ namespace AzFramework } - void OctreeSystemComponent::ReleaseChildNodes(uint32_t nodeIndex) + void OctreeScene::ReleaseChildNodes(uint32_t nodeIndex) { m_nodeCount -= GetChildNodeCount(); m_freeOctreeNodes.push(nodeIndex); } - OctreeNode* OctreeSystemComponent::GetChildNodesAtIndex(uint32_t nodeIndex) const + OctreeNode* OctreeScene::GetChildNodesAtIndex(uint32_t nodeIndex) const { uint32_t childPage; uint32_t childOffset; ExtractPageAndOffsetFromIndex(nodeIndex, childPage, childOffset); return &(*m_nodeCache[childPage])[childOffset]; } + + + void OctreeSystemComponent::Reflect(AZ::ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(1); + } + } + + + void OctreeSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) + { + provided.push_back(AZ_CRC("OctreeService")); + } + + + void OctreeSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) + { + incompatible.push_back(AZ_CRC("OctreeService")); + } + + + OctreeSystemComponent::OctreeSystemComponent() + { + AZ::Interface::Register(this); + IVisibilitySystemRequestBus::Handler::BusConnect(); + + m_defaultScene = aznew OctreeScene(AZ::Name("DefaultVisibilityScene")); + } + + + OctreeSystemComponent::~OctreeSystemComponent() + { + AZ_Assert(m_scenes.empty(), "All IVisibilityScenes must be destroyed before shutdown"); + + delete m_defaultScene; + + IVisibilitySystemRequestBus::Handler::BusDisconnect(); + AZ::Interface::Unregister(this); + } + + + void OctreeSystemComponent::Activate() + { + ; + } + + + void OctreeSystemComponent::Deactivate() + { + ; + } + + IVisibilityScene* OctreeSystemComponent::GetDefaultVisibilityScene() + { + return m_defaultScene; + } + + IVisibilityScene* OctreeSystemComponent::CreateVisibilityScene(const AZ::Name& sceneName) + { + AZ_Assert(FindVisibilityScene(sceneName) == nullptr, "Scene with same name already created!"); + OctreeScene* newScene = aznew OctreeScene(sceneName); + m_scenes.push_back(newScene); + return newScene; + } + + + void OctreeSystemComponent::DestroyVisibilityScene(IVisibilityScene* visScene) + { + for (auto iter = m_scenes.begin(); iter != m_scenes.end(); ++iter) + { + if (*iter == visScene) + { + delete visScene; + m_scenes.erase(iter); + return; + } + } + AZ_Assert(false, "visScene[\"%s\"] not found in the OctreeSystemComponent", visScene->GetName().GetCStr()); + } + + + IVisibilityScene* OctreeSystemComponent::FindVisibilityScene(const AZ::Name& sceneName) + { + for (OctreeScene* scene : m_scenes) + { + if(scene->GetName() == sceneName) + { + return scene; + } + } + return nullptr; + } + + + void OctreeSystemComponent::DumpStats([[maybe_unused]] const AZ::ConsoleCommandContainer& arguments) + { + for (OctreeScene* scene : m_scenes) + { + AZ_TracePrintf("Console", "============================================"); + scene->DumpStats(); + } + AZ_TracePrintf("Console", "============================================"); + } } diff --git a/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.h b/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.h index c89ba93b7f..8a5362c003 100644 --- a/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.h +++ b/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.h @@ -15,14 +15,15 @@ #include #include #include -#include #include #include #include +#include namespace AzFramework { class OctreeSystemComponent; + class OctreeScene; //! An internal node within the tree. //! It contains all objects that are *fully contained* by the node, if an object spans multiple child nodes that object will be stored in the parent. @@ -40,25 +41,25 @@ namespace AzFramework OctreeNode& operator=(OctreeNode&& rhs); //! Inserts a VisibilityEntry into this OctreeNode, potentially triggering a split. - void Insert(OctreeSystemComponent& octreeSystemComponent, VisibilityEntry* entry); + void Insert(OctreeScene& octreeScene, VisibilityEntry* entry); //! Updates a VisibilityEntry that is currently bound to this OctreeNode. //! The provided entry must be bound to this node, but may no longer be bound to this node upon function exit. - void Update(OctreeSystemComponent& octreeSystemComponent, VisibilityEntry* entry); + void Update(OctreeScene& octreeScene, VisibilityEntry* entry); //! Removes a VisibilityEntry from this OctreeNode. //! The provided entry must be bound to this node. - void Remove(OctreeSystemComponent& octreeSystemComponent, VisibilityEntry* entry); + void Remove(OctreeScene& octreeScene, VisibilityEntry* entry); //! Recursively enumerates any OctreeNodes and their children that intersect the provided bounding volume. //! @{ - void Enumerate(const AZ::Aabb& aabb, const IVisibilitySystem::EnumerateCallback& callback) const; - void Enumerate(const AZ::Sphere& sphere, const IVisibilitySystem::EnumerateCallback& callback) const; - void Enumerate(const AZ::Frustum& frustum, const IVisibilitySystem::EnumerateCallback& callback) const; + void Enumerate(const AZ::Aabb& aabb, const IVisibilityScene::EnumerateCallback& callback) const; + void Enumerate(const AZ::Sphere& sphere, const IVisibilityScene::EnumerateCallback& callback) const; + void Enumerate(const AZ::Frustum& frustum, const IVisibilityScene::EnumerateCallback& callback) const; //! @} //! Recursively enumerate *all* OctreeNodes that have any entries in them (without any culling). - void EnumerateNoCull(const IVisibilitySystem::EnumerateCallback& callback) const; + void EnumerateNoCull(const IVisibilityScene::EnumerateCallback& callback) const; //! Returns the set of entries bound to this node. const AZStd::vector& GetEntries() const; @@ -71,13 +72,13 @@ namespace AzFramework private: - void TryMerge(OctreeSystemComponent& octreeSystemComponent); + void TryMerge(OctreeScene& octreeScene); template - void EnumerateHelper(const T& boundingVolume, const IVisibilitySystem::EnumerateCallback& callback) const; + void EnumerateHelper(const T& boundingVolume, const IVisibilityScene::EnumerateCallback& callback) const; - void Split(OctreeSystemComponent& octreeSystemComponent); - void Merge(OctreeSystemComponent& octreeSystemComponent); + void Split(OctreeScene& octreeScene); + void Merge(OctreeScene& octreeScene); // The page is stored in the upper 16-bits of the child node index, the offset into the page is the lower 16-bits // This gives us a maximum of 65,536 pages and 65,536 nodes per page, for a total of 2^32 - 1 total pages (-1 reserved for the invalid index) @@ -90,60 +91,47 @@ namespace AzFramework }; //! Implementation of the visibility system interface. - //! This uses a simple adaptive octreeSystemComponent to support partitioning an object set and efficiently running gathers and visibility queries. - class OctreeSystemComponent - : public AZ::Component - , public IVisibilitySystemRequestBus::Handler + //! This uses a simple adaptive octree to support partitioning an object set for a specific scene and efficiently running gathers and visibility queries. + class OctreeScene + : public IVisibilityScene { public: + AZ_RTTI(OctreeScene, "{A88E4D86-11F1-4E3F-A91A-66DE99502B93}"); + AZ_CLASS_ALLOCATOR(OctreeScene, AZ::SystemAllocator, 0); + AZ_DISABLE_COPY_MOVE(OctreeScene); - AZ_COMPONENT(OctreeSystemComponent, "{CD4FF1C5-BAF4-421D-951B-1E05DAEEF67B}"); - - static void Reflect(AZ::ReflectContext* context); - static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); - static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); - - OctreeSystemComponent(); - virtual ~OctreeSystemComponent(); - - //! AZ::Component overrides. - //! @{ - void Activate() override; - void Deactivate() override; - //! @} + explicit OctreeScene(const AZ::Name& sceneName); + virtual ~OctreeScene(); - //! IVisibilitySystem overrides. + //! IVisibilityScene overrides. //! @{ + const AZ::Name& GetName() const override; void InsertOrUpdateEntry(VisibilityEntry& entry) override; void RemoveEntry(VisibilityEntry& entry) override; - void Enumerate(const AZ::Aabb& aabb, const IVisibilitySystem::EnumerateCallback& callback) const override; - void Enumerate(const AZ::Sphere& sphere, const IVisibilitySystem::EnumerateCallback& callback) const override; - void Enumerate(const AZ::Frustum& frustum, const IVisibilitySystem::EnumerateCallback& callback) const override; - void EnumerateNoCull(const IVisibilitySystem::EnumerateCallback& callback) const override; + void Enumerate(const AZ::Aabb& aabb, const IVisibilityScene::EnumerateCallback& callback) const override; + void Enumerate(const AZ::Sphere& sphere, const IVisibilityScene::EnumerateCallback& callback) const override; + void Enumerate(const AZ::Frustum& frustum, const IVisibilityScene::EnumerateCallback& callback) const override; + void EnumerateNoCull(const IVisibilityScene::EnumerateCallback& callback) const override; uint32_t GetEntryCount() const override; //! @} - //! Returns the OctreeSystemComponent's root node. - OctreeNode& GetRoot(); - - //! OctreeSystemComponent stats + //! Stats //! @{ uint32_t GetNodeCount() const; uint32_t GetFreeNodeCount() const; uint32_t GetPageCount() const; uint32_t GetChildNodeCount() const; - void DumpStats(const AZ::ConsoleCommandContainer& arguments); + void DumpStats(); //! @} private: - uint32_t AllocateChildNodes(); void ReleaseChildNodes(uint32_t nodeIndex); OctreeNode* GetChildNodesAtIndex(uint32_t nodeIndex) const; - // Bind the DumpStats member function to the console as 'OctreeSystemComponent.DumpStats' - AZ_CONSOLEFUNC(OctreeSystemComponent, DumpStats, AZ::ConsoleFunctorFlags::Null, "Dump octreeSystemComponent stats to the console window"); + mutable AZStd::shared_mutex m_sharedMutex; + AZ::Name m_sceneName; //< The uniquely identifying name for the visibility scene. OctreeNode m_root; //< The root node for the octreeSystemComponent. uint32_t m_entryCount = 0; //< Metric tracking the number of entries inserted into the octreeSystemComponent. @@ -158,4 +146,47 @@ namespace AzFramework friend class OctreeNode; // For access to the node allocator methods }; + + //! Implementation of the visibility system interface. + //! This manages creating, destroying, and finding the underlying octrees that are associated with specific scenes + class OctreeSystemComponent + : public AZ::Component + , public IVisibilitySystemRequestBus::Handler + { + public: + AZ_COMPONENT(OctreeSystemComponent, "{CD4FF1C5-BAF4-421D-951B-1E05DAEEF67B}"); + + // Bind the DumpStats member function to the console as 'OctreeSystemComponent.DumpStats' + AZ_CONSOLEFUNC(OctreeSystemComponent, DumpStats, AZ::ConsoleFunctorFlags::Null, "Dump octreeSystemComponent stats to the console window"); + + static void Reflect(AZ::ReflectContext* context); + static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); + static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); + + OctreeSystemComponent(); + virtual ~OctreeSystemComponent(); + + //! AZ::Component overrides. + //! @{ + void Activate() override; + void Deactivate() override; + //! @} + + //! IVisibilitySystem overrides + //! @{ + IVisibilityScene* GetDefaultVisibilityScene() override; + IVisibilityScene* CreateVisibilityScene(const AZ::Name& sceneName) override; + void DestroyVisibilityScene(IVisibilityScene* visScene) override; + IVisibilityScene* FindVisibilityScene(const AZ::Name& sceneName) override; + void DumpStats(const AZ::ConsoleCommandContainer& arguments) override; + //! @} + + private: + //! The default scene used for most entities (e.g. gameplay, networking) + OctreeScene* m_defaultScene = nullptr; + + //! Other scenes (e.g. each rendering scene) are stored here and looked up by name. + AZStd::vector m_scenes; //using a vector<> here because we'll generally have a small number of scenes + + }; } diff --git a/Code/Framework/AzFramework/Platform/Android/AzFramework/IO/LocalFileIO_Android.cpp b/Code/Framework/AzFramework/Platform/Android/AzFramework/IO/LocalFileIO_Android.cpp index 4d025e1b20..b2cbe33438 100644 --- a/Code/Framework/AzFramework/Platform/Android/AzFramework/IO/LocalFileIO_Android.cpp +++ b/Code/Framework/AzFramework/Platform/Android/AzFramework/IO/LocalFileIO_Android.cpp @@ -16,13 +16,14 @@ #include #include #include +#include #include #include #include #if __ANDROID_API__ == 19 - // The following were apparently introduced in API 21, however in earlier versions of the + // The following were apparently introduced in API 21, however in earlier versions of the // platform specific headers they were defines. In the move to unified headers, the following // defines were removed from stat.h #ifndef stat64 @@ -52,7 +53,7 @@ namespace AZ if (AZ::Android::Utils::IsApkPath(resolvedPath)) { - return AZ::Android::APKFileHandler::IsDirectory(AZ::Android::Utils::StripApkPrefix(resolvedPath)); + return AZ::Android::APKFileHandler::IsDirectory(AZ::Android::Utils::StripApkPrefix(resolvedPath).c_str()); } struct stat result; @@ -108,7 +109,7 @@ namespace AZ if (isInAPK) { - AZ::OSString strippedPath = AZ::Android::Utils::StripApkPrefix(pathWithoutSlash.c_str()); + AZ::IO::FixedMaxPath strippedPath = AZ::Android::Utils::StripApkPrefix(pathWithoutSlash.c_str()); char tempBuffer[AZ_MAX_PATH_LEN] = {0}; diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/TargetManagement/TargetManagementComponent_Windows.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/TargetManagement/TargetManagementComponent_Windows.cpp index a3ada465f8..770c0741f9 100644 --- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/TargetManagement/TargetManagementComponent_Windows.cpp +++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/TargetManagement/TargetManagementComponent_Windows.cpp @@ -21,7 +21,7 @@ namespace AzFramework { AZStd::string GetPersistentName() { - AZStd::string persistentName = "Lumberyard"; + AZStd::string persistentName = "Open 3D Engine"; char procPath[AZ_MAX_PATH_LEN]; AZ::Utils::GetExecutablePathReturnType ret = AZ::Utils::GetExecutablePath(procPath, AZ_MAX_PATH_LEN); diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp index 660bb544a0..fd49f37dc8 100644 --- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp +++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Windowing/NativeWindow_Windows.cpp @@ -56,7 +56,7 @@ namespace AzFramework bool m_isInBorderlessWindowFullScreenState = false; //!< Was a borderless window used to enter full screen state? }; - const char* NativeWindowImpl_Win32::s_defaultClassName = "LumberyardWin32Class"; + const char* NativeWindowImpl_Win32::s_defaultClassName = "O3DEWin32Class"; NativeWindow::Implementation* NativeWindow::Implementation::Create() { diff --git a/Code/Framework/AzFramework/Platform/iOS/AzFramework/Input/Devices/Motion/InputDeviceMotion_iOS.mm b/Code/Framework/AzFramework/Platform/iOS/AzFramework/Input/Devices/Motion/InputDeviceMotion_iOS.mm index 8ce98afe3c..71037038a0 100644 --- a/Code/Framework/AzFramework/Platform/iOS/AzFramework/Input/Devices/Motion/InputDeviceMotion_iOS.mm +++ b/Code/Framework/AzFramework/Platform/iOS/AzFramework/Input/Devices/Motion/InputDeviceMotion_iOS.mm @@ -85,7 +85,7 @@ namespace AzFramework //! //! return another vector relative to the specified display orientation, and such that the //! +y axis points out the back of the screen and z+ axis points out the top of the device. - //! This flipping of axes is to match Lumberyard's z-up and left-handed coordinate system. + //! This flipping of axes is to match Open 3D Engine's z-up and left-handed coordinate system. //! //! \param[in] x The x component of the vector to be aligned //! \param[in] y The y component of the vector to be aligned diff --git a/Code/Framework/AzGameFramework/AzGameFramework/Application/GameApplication.cpp b/Code/Framework/AzGameFramework/AzGameFramework/Application/GameApplication.cpp index 4bd4ed5a40..f4fc9364f7 100644 --- a/Code/Framework/AzGameFramework/AzGameFramework/Application/GameApplication.cpp +++ b/Code/Framework/AzGameFramework/AzGameFramework/Application/GameApplication.cpp @@ -28,9 +28,9 @@ namespace AzGameFramework GameApplication::GameApplication() { } - - GameApplication::GameApplication(int* argc, char*** argv) - : Application(argc, argv) + + GameApplication::GameApplication(int argc, char** argv) + : Application(&argc, &argv) { } @@ -108,7 +108,7 @@ namespace AzGameFramework } void GameApplication::QueryApplicationType(AZ::ApplicationTypeQuery& appType) const - { + { appType.m_maskValue = AZ::ApplicationTypeQuery::Masks::Game; }; diff --git a/Code/Framework/AzGameFramework/AzGameFramework/Application/GameApplication.h b/Code/Framework/AzGameFramework/AzGameFramework/Application/GameApplication.h index 99735c9191..71b876c04b 100644 --- a/Code/Framework/AzGameFramework/AzGameFramework/Application/GameApplication.h +++ b/Code/Framework/AzGameFramework/AzGameFramework/Application/GameApplication.h @@ -24,7 +24,7 @@ namespace AzGameFramework AZ_CLASS_ALLOCATOR(GameApplication, AZ::SystemAllocator, 0); GameApplication(); - GameApplication(int* argc, char*** argvS); + GameApplication(int argc, char** argvS); ~GameApplication(); AZ::ComponentTypeList GetRequiredSystemComponents() const override; diff --git a/Code/Framework/AzQtComponents/AzQtComponents/AzQtComponentsAPI.h b/Code/Framework/AzQtComponents/AzQtComponents/AzQtComponentsAPI.h index 42e76551b3..e4e635658a 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/AzQtComponentsAPI.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/AzQtComponentsAPI.h @@ -14,19 +14,17 @@ /** * \mainpage * - * Introduced with Amazon Lumberyard version 1.25 and the release of UI 2.0, Lumberyard's - * custom Qt widget library provides developers with access to the same UI components used - * throughout Lumberyard. Using this library, UI developers can build their own tools and - * extensions for Lumberyard, while maintaining a coherent and standardized UI experience. + * Using this library, UI developers can build their own tools and + * extensions for Open 3D Engine, while maintaining a coherent and standardized UI experience. * This custom library provides new and extended widgets, and includes a set of styles and * user interaction patterns that are applied on top of the Qt framework - the C++ library - * that Lumberyard relies on for its UI. The library can be extended to support your own customizations and modifications. + * that Open 3D Engine relies on for its UI. The library can be extended to support your own customizations and modifications. * * With this UI 2.0 API reference guide, we're working towards offering a full and comprehensive - * API refernce for all tools developers that are extending Lumberyard. The API reference + * API refernce for all tools developers that are extending Open 3D Engine. The API reference * is intended for C++ programmers building tools. For UX designers looking to understand * the best patterns and practices when making a tool to comfortably integrate with - * the Lumberyard editor, see the [UI 2.0 design guide](https://docs.aws.amazon.com/lumberyard/latest/ui/). + * the Open 3D Engine editor, see the [UI 2.0 design guide](https://docs.aws.amazon.com/lumberyard/latest/ui/). */ #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/FilteredSearchWidget.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/FilteredSearchWidget.cpp index 6508b9f2f9..2cfe2a7abf 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/FilteredSearchWidget.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/FilteredSearchWidget.cpp @@ -17,7 +17,7 @@ #include #include -#include "Components/ui_FilteredSearchWidget.h" +#include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/LumberyardStylesheet.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/O3DEStylesheet.h similarity index 85% rename from Code/Framework/AzQtComponents/AzQtComponents/Components/LumberyardStylesheet.h rename to Code/Framework/AzQtComponents/AzQtComponents/Components/O3DEStylesheet.h index bbc307639d..b881ebe9e1 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/LumberyardStylesheet.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/O3DEStylesheet.h @@ -16,10 +16,10 @@ namespace AzQtComponents { // Here for backwards compatibility with the old name of this class - class LumberyardStylesheet : public StyleManager + class O3DEStylesheet : public StyleManager { public: - LumberyardStylesheet(QObject* parent) : StyleManager(parent) {} + O3DEStylesheet(QObject* parent) : StyleManager(parent) {} }; } // namespace AzQtComponents diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Style.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/Style.h index 7f82a7b4c4..d1b2cd8eda 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Style.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Style.h @@ -39,7 +39,7 @@ namespace AzQtComponents } // namespace Internal /** - * The UI 2.0 Lumberyard Qt Style. + * The UI 2.0 Open 3D Engine Qt Style. * * Should not need to be used directly; use the AzQtComponents::StyleManager instead. * diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/StyleManager.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/StyleManager.h index 404c0869cd..e7b5b61cc2 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/StyleManager.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/StyleManager.h @@ -37,7 +37,7 @@ namespace AzQtComponents class AutoCustomWindowDecorations; /** - * Wrapper around classes dealing with Lumberyard style. + * Wrapper around classes dealing with Open 3D Engine style. * * New applications should work like this: * diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ColorPicker/Palette.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ColorPicker/Palette.h index 67b3c512df..7d3c82ae22 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ColorPicker/Palette.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ColorPicker/Palette.h @@ -24,7 +24,7 @@ class QMimeData; namespace AzQtComponents { - static const QString MIME_TYPE_PALETTE = QStringLiteral("application/x-lumberyard-color-palette+xml"); + static const QString MIME_TYPE_PALETTE = QStringLiteral("application/x-o3de-color-palette+xml"); class PaletteModel; diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Internal/OverlayWidgetLayer.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Internal/OverlayWidgetLayer.cpp index 7925b22614..41e8683663 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Internal/OverlayWidgetLayer.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Internal/OverlayWidgetLayer.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include namespace AzQtComponents @@ -264,4 +264,4 @@ namespace AzQtComponents } // namespace Internal } // namespace AzQtComponents -#include "Components/Widgets/Internal/moc_OverlayWidgetLayer.cpp" \ No newline at end of file +#include "Components/Widgets/Internal/moc_OverlayWidgetLayer.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/MessageBox.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/MessageBox.h index 1a181a18e9..b992183ac8 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/MessageBox.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/MessageBox.h @@ -20,7 +20,7 @@ namespace AzQtComponents class Style; /** - * Lumberyard specific wrapper to do MessageBox type stuff, specifically to automatically handle + * Open 3D Engine specific wrapper to do MessageBox type stuff, specifically to automatically handle * checking/writing "do not ask this question again" checkbox/settings. * * Called AzMessageBox instead of MessageBox because for windows.h does #define MessageBox MessageBoxA / MessageBoxW diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/WindowDecorationWrapper.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/WindowDecorationWrapper.cpp index 4e621835bf..5a7e68b21a 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/WindowDecorationWrapper.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/WindowDecorationWrapper.cpp @@ -179,7 +179,7 @@ namespace AzQtComponents { m_guestWidget = nullptr; - // the Lumberyard Editor has code that checks for Modal widgets, and blocks on doing other things + // the Open 3D Engine Editor has code that checks for Modal widgets, and blocks on doing other things // if there are still active Modal dialogs. // So we need to ensure that this WindowDecorationWrapper doesn't report itself as being modal // after the guest widget has been deleted. diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/AssetBrowserFolderPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/AssetBrowserFolderPage.cpp index 33fb361a77..6cfc06a420 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/AssetBrowserFolderPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/AssetBrowserFolderPage.cpp @@ -10,7 +10,7 @@ * */ #include "AssetBrowserFolderPage.h" -#include "Gallery/ui_AssetBrowserFolderPage.h" +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/BreadCrumbsPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/BreadCrumbsPage.cpp index 007a24429f..2ead6fc295 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/BreadCrumbsPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/BreadCrumbsPage.cpp @@ -11,7 +11,7 @@ */ #include "BreadCrumbsPage.h" -#include "Gallery/ui_BreadCrumbsPage.h" +#include #include #include @@ -107,4 +107,4 @@ BreadCrumbsPage::~BreadCrumbsPage() { } -#include "Gallery/moc_BreadCrumbsPage.cpp" \ No newline at end of file +#include "Gallery/moc_BreadCrumbsPage.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/BrowseEditPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/BrowseEditPage.cpp index 6a7645256b..0c4c50f543 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/BrowseEditPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/BrowseEditPage.cpp @@ -11,7 +11,7 @@ */ #include "BrowseEditPage.h" -#include "Gallery/ui_BrowseEditPage.h" +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ButtonPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ButtonPage.cpp index 8f0b258fa8..530bb5b433 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ButtonPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ButtonPage.cpp @@ -12,7 +12,7 @@ #include "ButtonPage.h" #include "FixedStateButton.h" -#include "Gallery/ui_ButtonPage.h" +#include #include @@ -110,4 +110,4 @@ ButtonPage::~ButtonPage() { } -#include "Gallery/moc_ButtonPage.cpp" \ No newline at end of file +#include "Gallery/moc_ButtonPage.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/CardPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/CardPage.cpp index d27360d934..f3d4fe20ad 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/CardPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/CardPage.cpp @@ -11,7 +11,7 @@ */ #include "CardPage.h" -#include "Gallery/ui_CardPage.h" +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/CheckBoxPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/CheckBoxPage.cpp index 4d1fc36474..702124773c 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/CheckBoxPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/CheckBoxPage.cpp @@ -11,7 +11,7 @@ */ #include "CheckBoxPage.h" -#include "Gallery/ui_CheckBoxPage.h" +#include #include @@ -71,4 +71,4 @@ CheckBoxPage::~CheckBoxPage() { } -#include "Gallery/moc_CheckBoxPage.cpp" \ No newline at end of file +#include "Gallery/moc_CheckBoxPage.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ColorLabelPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ColorLabelPage.cpp index c3dbe609cb..b2fed3f55e 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ColorLabelPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ColorLabelPage.cpp @@ -11,7 +11,7 @@ */ #include "ColorLabelPage.h" -#include "Gallery/ui_ColorLabelPage.h" +#include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ColorPickerPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ColorPickerPage.cpp index ce5d601eba..9f4f882347 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ColorPickerPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ColorPickerPage.cpp @@ -11,7 +11,7 @@ */ #include "ColorPickerPage.h" -#include "Gallery/ui_ColorPickerPage.h" +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComboBoxPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComboBoxPage.cpp index 24f50e6902..edc93db9b6 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComboBoxPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComboBoxPage.cpp @@ -11,7 +11,7 @@ */ #include "ComboBoxPage.h" -#include "Gallery/ui_ComboBoxPage.h" +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComponentDemoWidget.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComponentDemoWidget.cpp index fec350137d..3e7c1eabea 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComponentDemoWidget.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ComponentDemoWidget.cpp @@ -11,7 +11,7 @@ */ #include "ComponentDemoWidget.h" -#include "Gallery/ui_ComponentDemoWidget.h" +#include "AzQtComponents/Gallery/ui_ComponentDemoWidget.h" #include "AssetBrowserFolderPage.h" #include "BreadCrumbsPage.h" #include "BrowseEditPage.h" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/DragAndDropPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/DragAndDropPage.cpp index fd55c7e02a..ae90334b87 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/DragAndDropPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/DragAndDropPage.cpp @@ -11,7 +11,7 @@ */ #include "DragAndDropPage.h" -#include +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/FilteredSearchWidgetPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/FilteredSearchWidgetPage.cpp index 2f419220e2..a8a7cb60ff 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/FilteredSearchWidgetPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/FilteredSearchWidgetPage.cpp @@ -11,7 +11,7 @@ */ #include "FilteredSearchWidgetPage.h" -#include "Gallery/ui_FilteredSearchWidgetPage.h" +#include FilteredSearchWidgetPage::FilteredSearchWidgetPage(QWidget* parent) : QWidget(parent) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/Gallery.ico b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/Gallery.ico new file mode 100644 index 0000000000..d0948c09d5 --- /dev/null +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/Gallery.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe52372c907d680df52dbf32d863a4007a15db90e9ad35fbe153870a72e2d0ef +size 108402 diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/Gallery.rc b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/Gallery.rc new file mode 100644 index 0000000000..fb44fadeb4 --- /dev/null +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/Gallery.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "Gallery.ico" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/GradientSliderPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/GradientSliderPage.cpp index 85f5ca2a9b..76bc1e3a28 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/GradientSliderPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/GradientSliderPage.cpp @@ -12,7 +12,7 @@ #include "GradientSliderPage.h" #include -#include "Gallery/ui_GradientSliderPage.h" +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/HyperlinkPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/HyperlinkPage.cpp index bb8951f1a4..0d06f250ff 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/HyperlinkPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/HyperlinkPage.cpp @@ -11,7 +11,7 @@ */ #include "HyperlinkPage.h" -#include +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/LineEditPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/LineEditPage.cpp index 042f4d0d1e..fb9a59b020 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/LineEditPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/LineEditPage.cpp @@ -11,7 +11,7 @@ */ #include "LineEditPage.h" -#include "Gallery/ui_LineEditPage.h" +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/MenuPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/MenuPage.cpp index c21ece683e..8220ba5d52 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/MenuPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/MenuPage.cpp @@ -11,7 +11,7 @@ */ #include "MenuPage.h" -#include +#include #include @@ -83,7 +83,7 @@ action->setChecked(true); auto submenu = menu->addMenu(QStringLiteral("Submenu")); submenu->addAction(actionText); -// Note: some Lumberyard menus (like the one in the MainWindow) forcefully hide icons by design. +// Note: some Open 3D Engine menus (like the one in the MainWindow) forcefully hide icons by design. diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ProgressIndicatorPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ProgressIndicatorPage.cpp index 85baf2f395..dc14bffa68 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ProgressIndicatorPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ProgressIndicatorPage.cpp @@ -11,7 +11,7 @@ */ #include "ProgressIndicatorPage.h" -#include "Gallery/ui_ProgressIndicatorPage.h" +#include ProgressIndicatorPage::ProgressIndicatorPage(QWidget* parent) : QWidget(parent) @@ -75,4 +75,4 @@ ProgressIndicatorPage::~ProgressIndicatorPage() { } -#include "Gallery/moc_ProgressIndicatorPage.cpp" \ No newline at end of file +#include "Gallery/moc_ProgressIndicatorPage.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/RadioButtonPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/RadioButtonPage.cpp index 7df0401842..11042c1365 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/RadioButtonPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/RadioButtonPage.cpp @@ -11,7 +11,7 @@ */ #include "RadioButtonPage.h" -#include "Gallery/ui_RadioButtonPage.h" +#include #include @@ -59,4 +59,4 @@ RadioButtonPage::~RadioButtonPage() { } -#include "Gallery/moc_RadioButtonPage.cpp" \ No newline at end of file +#include "Gallery/moc_RadioButtonPage.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ReflectedPropertyEditorPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ReflectedPropertyEditorPage.cpp index 067a5a9a48..f044efda61 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ReflectedPropertyEditorPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ReflectedPropertyEditorPage.cpp @@ -11,7 +11,7 @@ */ #include "ReflectedPropertyEditorPage.h" -#include +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ScrollBarPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ScrollBarPage.cpp index ef246e2221..d4c8920c22 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ScrollBarPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ScrollBarPage.cpp @@ -11,7 +11,7 @@ */ #include "ScrollBarPage.h" -#include +#include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SegmentControlPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SegmentControlPage.cpp index fa4a8c59e1..3d8b1aa8fd 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SegmentControlPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SegmentControlPage.cpp @@ -11,7 +11,7 @@ */ #include "SegmentControlPage.h" -#include "Gallery/ui_SegmentControlPage.h" +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SliderComboPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SliderComboPage.cpp index 4a442fda40..997979a89b 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SliderComboPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SliderComboPage.cpp @@ -11,7 +11,7 @@ */ #include "SliderComboPage.h" -#include +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SliderPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SliderPage.cpp index 5a311565a4..27ee34c776 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SliderPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SliderPage.cpp @@ -11,7 +11,7 @@ */ #include "SliderPage.h" -#include "Gallery/ui_SliderPage.h" +#include #include @@ -155,4 +155,4 @@ SliderPage::~SliderPage() { } -#include "Gallery/moc_SliderPage.cpp" \ No newline at end of file +#include "Gallery/moc_SliderPage.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SpinBoxPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SpinBoxPage.cpp index 01afdac7ff..434e000b1c 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SpinBoxPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SpinBoxPage.cpp @@ -11,7 +11,7 @@ */ #include "SpinBoxPage.h" -#include "Gallery/ui_SpinBoxPage.h" +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SplitterPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SplitterPage.cpp index 88bc752775..08d174699e 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SplitterPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SplitterPage.cpp @@ -11,7 +11,7 @@ */ #include "SplitterPage.h" -#include +#include SplitterPage::SplitterPage(QWidget* parent) : QWidget(parent) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/StyleSheetPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/StyleSheetPage.cpp index 61e12ebd03..a8c1f1ebf7 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/StyleSheetPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/StyleSheetPage.cpp @@ -11,7 +11,7 @@ */ #include "StyleSheetPage.h" -#include "Gallery/ui_StyleSheetPage.h" +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/StyledDockWidgetPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/StyledDockWidgetPage.cpp index 0336bdfe4a..11214a6841 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/StyledDockWidgetPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/StyledDockWidgetPage.cpp @@ -11,7 +11,7 @@ */ #include "StyledDockWidgetPage.h" -#include "Gallery/ui_StyledDockWidgetPage.h" +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SvgLabelPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SvgLabelPage.cpp index 2569b4daed..06d64ef9c3 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SvgLabelPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/SvgLabelPage.cpp @@ -11,7 +11,7 @@ */ #include "SvgLabelPage.h" -#include "Gallery/ui_SvgLabelPage.h" +#include #include #include @@ -118,4 +118,4 @@ void SvgLabelPage::dropEvent(QDropEvent *event) theImage->load(firstUrl.toLocalFile()); m_initialSize = theImage->renderer()->defaultSize(); onResetSize(); -} \ No newline at end of file +} diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TabWidgetPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TabWidgetPage.cpp index 0c942dc29b..ef38bc2245 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TabWidgetPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TabWidgetPage.cpp @@ -11,7 +11,7 @@ */ #include "TabWidgetPage.h" -#include +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TableViewPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TableViewPage.cpp index 56f097df5d..c70a34a9a9 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TableViewPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TableViewPage.cpp @@ -19,7 +19,7 @@ #include -#include +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.cpp index dce13e26e5..c31f533574 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TitleBarPage.cpp @@ -11,7 +11,7 @@ */ #include "TitleBarPage.h" -#include +#include TitleBarPage::TitleBarPage(QWidget* parent) : QWidget(parent) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ToggleSwitchPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ToggleSwitchPage.cpp index bfc84b965e..816525591b 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ToggleSwitchPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ToggleSwitchPage.cpp @@ -11,7 +11,7 @@ */ #include "ToggleSwitchPage.h" -#include +#include #include @@ -59,4 +59,4 @@ ToggleSwitchPage::~ToggleSwitchPage() { } -#include "Gallery/moc_ToggleSwitchPage.cpp" \ No newline at end of file +#include "Gallery/moc_ToggleSwitchPage.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ToolBarPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ToolBarPage.cpp index a5e303b3f2..5937d496de 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ToolBarPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/ToolBarPage.cpp @@ -11,7 +11,7 @@ */ #include "ToolBarPage.h" -#include +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TreeViewPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TreeViewPage.cpp index 4fa2a145c7..823fadbf68 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TreeViewPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TreeViewPage.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include namespace { diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TypographyPage.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TypographyPage.cpp index acedfec4fb..267b0fcdf2 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TypographyPage.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/TypographyPage.cpp @@ -11,7 +11,7 @@ */ #include "TypographyPage.h" -#include +#include #include #include @@ -123,4 +123,4 @@ TypographyPage::~TypographyPage() { } -#include "Gallery/moc_TypographyPage.cpp" \ No newline at end of file +#include "Gallery/moc_TypographyPage.cpp" diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/main.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/main.cpp index cffe20cb34..23b113cf7b 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Gallery/main.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Gallery/main.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include "ComponentDemoWidget.h" @@ -136,7 +136,7 @@ int main(int argc, char **argv) QApplication::setOrganizationName("Amazon"); QApplication::setOrganizationDomain("amazon.com"); - QApplication::setApplicationName("LumberyardWidgetGallery"); + QApplication::setApplicationName("O3DEWidgetGallery"); QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates)); diff --git a/Code/Framework/AzQtComponents/AzQtComponents/PropertyEditorStandalone/main.cpp b/Code/Framework/AzQtComponents/AzQtComponents/PropertyEditorStandalone/main.cpp index 3ba2d96451..f2afb63a64 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/PropertyEditorStandalone/main.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/PropertyEditorStandalone/main.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/DeploymentsWidget.h b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/DeploymentsWidget.h index 2d1ee24cae..4b49883dc9 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/DeploymentsWidget.h +++ b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/DeploymentsWidget.h @@ -14,7 +14,7 @@ #define DEPLOYMENTSWIDGET_H #if !defined(Q_MOC_RUN) -#include "StyleGallery/ui_deploymentswidget.h" +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.cpp b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.cpp index ba322e8375..eb6916f20a 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/ViewportTitleDlg.cpp @@ -16,7 +16,7 @@ #include "ViewportTitleDlg.h" -#include "StyleGallery/ui_ViewportTitleDlg.h" +#include #include ViewportTitleDlg::ViewportTitleDlg(QWidget* pParent) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/main.cpp b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/main.cpp index 0fc03e58cc..0d3827b43a 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/main.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/main.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include "MyCombo.h" #include @@ -183,7 +183,7 @@ int main(int argc, char **argv) QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); QApplication app(argc, argv); - AzQtComponents::LumberyardStylesheet stylesheet(&app); + AzQtComponents::O3DEStylesheet stylesheet(&app); AZ::IO::FixedMaxPath engineRootPath; { AZ::ComponentApplication componentApplication(argc, argv); @@ -210,7 +210,7 @@ int main(int argc, char **argv) action->setMenu(fileMenu); auto openDock = fileMenu->addAction("Open dockwidget"); QObject::connect(openDock, &QAction::triggered, w, [&w] { - auto dock = new AzQtComponents::StyledDockWidget(QLatin1String("Amazon Lumberyard"), w); + auto dock = new AzQtComponents::StyledDockWidget(QLatin1String("Open 3D Engine"), w); auto button = new QPushButton("Click to dock"); auto wid = new QWidget(); auto widLayout = new QVBoxLayout(wid); diff --git a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.cpp b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.cpp index 4c3cfe2adf..2cbdea45c3 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/StyleGallery/mainwidget.cpp @@ -10,7 +10,7 @@ * */ #include "mainwidget.h" -#include +#include #include #include diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Utilities/ScreenGrabber_win.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/ScreenGrabber_win.cpp index 747a7c3615..4539336b86 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Utilities/ScreenGrabber_win.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/ScreenGrabber_win.cpp @@ -117,7 +117,7 @@ namespace AzQtComponents // the correct size, but with garbage data in the last scanline. We crop this in the callback. m_magnifier = CreateWindowW( WC_MAGNIFIERW, - L"Lumberyard Color Picker Eyedropper Helper", + L"Open 3D Engine Color Picker Eyedropper Helper", WS_CHILD | WS_VISIBLE, 0, 0, diff --git a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_files.cmake b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_files.cmake index fdbe6deb94..30929b712b 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_files.cmake +++ b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_files.cmake @@ -45,7 +45,7 @@ set(FILES Components/FilteredSearchWidget.ui Components/GlobalEventFilter.h Components/GlobalEventFilter.cpp - Components/LumberyardStylesheet.h + Components/O3DEStylesheet.h Components/Titlebar.cpp Components/Titlebar.h Components/TitleBarOverdrawHandler.cpp diff --git a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_gallery_files.cmake b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_gallery_files.cmake index d36e81b3d2..a9364efab4 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_gallery_files.cmake +++ b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_gallery_files.cmake @@ -124,4 +124,5 @@ set(FILES Gallery/TreeViewPage.ui Gallery/TreeViewPage.cpp Gallery/TreeViewPage.h + Gallery/Gallery.rc ) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/API/ToolsApplicationAPI.h b/Code/Framework/AzToolsFramework/AzToolsFramework/API/ToolsApplicationAPI.h index fc641cea33..0c631cf09e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/API/ToolsApplicationAPI.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/API/ToolsApplicationAPI.h @@ -601,7 +601,7 @@ namespace AzToolsFramework virtual ResolveToolPathOutcome ResolveConfigToolsPath(const char* toolApplicationName) const = 0; /** - * LUMBERYARD INTERNAL USE ONLY. + * Open 3D Engine Internal use only. * * Run a specific redo command separate from the undo/redo system. * In many cases before a modifcation on an entity takes place, it is first packaged into diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp index 307d06129d..352048f5f0 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp @@ -92,7 +92,7 @@ namespace AzToolsFramework namespace Internal { static const char* s_engineConfigFileName = "engine.json"; - static const char* s_engineConfigEngineVersionKey = "LumberyardVersion"; + static const char* s_engineConfigEngineVersionKey = "O3DEVersion"; static const char* s_startupLogWindow = "Startup"; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.h index a2773adf54..ef9f190309 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.h @@ -155,7 +155,7 @@ namespace AzToolsFramework void CreateAndAddEntityFromComponentTags(const AZStd::vector& requiredTags, const char* entityName) override; - /* LUMBERYARD INTERNAL USE ONLY. */ + /* Open 3D Engine INTERNAL USE ONLY. */ void RunRedoSeparately(UndoSystem::URSequencePoint* redoCommand) override; ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp index 69eba765e4..9ab50a803c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp @@ -23,7 +23,7 @@ #include AZ_PUSH_DISABLE_WARNING(4251 4244, "-Wunknown-warning-option") // disable warnings spawned by QT -#include "AssetBrowser/AssetPicker/ui_AssetPickerDialog.h" +#include #include #include #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Previewer/EmptyPreviewer.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Previewer/EmptyPreviewer.cpp index 468ebb502d..99b235b2f4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Previewer/EmptyPreviewer.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Previewer/EmptyPreviewer.cpp @@ -17,7 +17,7 @@ // 4251: class needs to have dll-interface to be used by clients of class // 4800: forcing value to bool 'true' or 'false' (performance warning) AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") -#include "AssetBrowser/Previewer/ui_EmptyPreviewer.h" +#include AZ_POP_DISABLE_WARNING namespace AzToolsFramework @@ -45,4 +45,4 @@ namespace AzToolsFramework } } -#include \ No newline at end of file +#include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/FilterByWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/FilterByWidget.cpp index e5e1de4fc0..d0c5ec3837 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/FilterByWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/FilterByWidget.cpp @@ -11,7 +11,7 @@ */ #include AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: class 'QFlags' needs to have dll-interface to be used by clients of class 'QLayoutItem' -#include +#include AZ_POP_DISABLE_WARNING #include @@ -39,4 +39,4 @@ namespace AzToolsFramework } // namespace AssetBrowser } // namespace AzToolsFramework -#include "AssetBrowser/Search/moc_FilterByWidget.cpp" \ No newline at end of file +#include "AssetBrowser/Search/moc_FilterByWidget.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/SearchAssetTypeSelectorWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/SearchAssetTypeSelectorWidget.cpp index 189beea209..3d62c1d01b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/SearchAssetTypeSelectorWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/SearchAssetTypeSelectorWidget.cpp @@ -18,7 +18,7 @@ #include AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags' needs to have dll-interface to be used by clients of class 'QLayoutItem' -#include +#include AZ_POP_DISABLE_WARNING #include @@ -154,4 +154,4 @@ namespace AzToolsFramework } // namespace AssetBrowser } // namespace AzToolsFramework -#include "AssetBrowser/Search/moc_SearchAssetTypeSelectorWidget.cpp" \ No newline at end of file +#include "AssetBrowser/Search/moc_SearchAssetTypeSelectorWidget.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/SearchParametersWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/SearchParametersWidget.cpp index b30adc0f18..09a8f84167 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/SearchParametersWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Search/SearchParametersWidget.cpp @@ -12,7 +12,7 @@ #include "SearchParametersWidget.h" AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags' needs to have dll-interface to be used by clients of class 'QLayoutItem' -#include "AssetBrowser/Search/ui_SearchParametersWidget.h" +#include AZ_POP_DISABLE_WARNING #include @@ -68,4 +68,4 @@ namespace AzToolsFramework } // namespace AssetBrowser } // namespace AzToolsFramework -#include "AssetBrowser/Search/moc_SearchParametersWidget.cpp" \ No newline at end of file +#include "AssetBrowser/Search/moc_SearchParametersWidget.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.h index 1aaed74e0f..697396b09e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.h @@ -54,7 +54,7 @@ namespace AzToolsFramework //! Set unique asset browser name, used to persist tree expansion states void SetName(const QString& name); - // LUMBERYARD_DEPRECATED + // O3DE_DEPRECATED void LoadState(const QString& name); void SaveState() const; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp index 610b5a185b..603c7a8023 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp @@ -19,9 +19,9 @@ #include #include AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 'QLayoutItem::align': class 'QFlags' needs to have dll-interface to be used by clients of class 'QLayoutItem' -#include +#include AZ_POP_DISABLE_WARNING -#include +#include #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp index 18b2dacefb..9caca69b34 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/EditorEntityModel.cpp @@ -707,7 +707,7 @@ namespace AzToolsFramework { QMessageBox::warning(AzToolsFramework::GetActiveWindow(), QStringLiteral("Can't instantiate the selected slice"), - QString("The slice may contain UI elements that can't be instantiated in the main Lumberyard editor. " + QString("The slice may contain UI elements that can't be instantiated in the main Open 3D Engine editor. " "Use the UI Editor to instantiate this slice or select another one."), QMessageBox::Ok); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorManager.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorManager.h index 85d5724cbd..5f57738b8c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorManager.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorManager.h @@ -89,7 +89,7 @@ namespace AzToolsFramework const AzFramework::CameraState& cameraState, const ViewportInteraction::MouseInteraction& mouseInteraction); - // LUMBERYARD_DEPRECATED(LY-117150) + // O3DE_DEPRECATED(LY-117150) /// Check if the modifier key state has changed - if so we may need to refresh /// certain manipulator bounds. AZ_DEPRECATED( diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceEntityScrubber.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceEntityScrubber.h index 193d9ad496..a3945f8cf8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceEntityScrubber.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceEntityScrubber.h @@ -31,7 +31,7 @@ namespace AzToolsFramework class InstanceEntityScrubber { public: - AZ_RTTI(InstanceEntityScrubber, "{0BC12562-C240-48AD-89C6-EDF572C9B485}"); + AZ_TYPE_INFO(InstanceEntityScrubber, "{0BC12562-C240-48AD-89C6-EDF572C9B485}"); explicit InstanceEntityScrubber(Instance::EntityList& entities); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceSerializer.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceSerializer.cpp index a5056328ee..bd02f3cd9b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceSerializer.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceSerializer.cpp @@ -219,11 +219,10 @@ namespace AzToolsFramework entitiesInInstance.emplace_back(entity.get()); } - InstanceEntityScrubber** instanceEntityScrubber = jsonDeserializerContext.GetMetadata().Find(); - if (instanceEntityScrubber && (*instanceEntityScrubber)) - + InstanceEntityScrubber* instanceEntityScrubber = jsonDeserializerContext.GetMetadata().Find(); + if (instanceEntityScrubber) { - (*instanceEntityScrubber)->AddEntitiesToScrub(entitiesInInstance); + instanceEntityScrubber->AddEntitiesToScrub(entitiesInInstance); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp index 979d85151a..d53aeaa241 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.cpp @@ -10,6 +10,7 @@ * */ +#include #include #include #include @@ -78,6 +79,11 @@ namespace AzToolsFramework bool LoadInstanceFromPrefabDom(Instance& instance, const PrefabDom& prefabDom, LoadInstanceFlags flags) { + // When entities are rebuilt they are first destroyed. As a result any assets they were exclusively holding on to will + // be released and reloaded once the entities are built up again. By suspending asset release temporarily the asset reload + // is avoided. + AZ::Data::AssetManager::Instance().SuspendAssetRelease(); + InstanceEntityIdMapper entityIdMapper; entityIdMapper.SetLoadingInstance(instance); if ((flags & LoadInstanceFlags::AssignRandomEntityId) == LoadInstanceFlags::AssignRandomEntityId) @@ -91,10 +97,12 @@ namespace AzToolsFramework // data has strict typing and doesn't look for inheritance both have to be explicitly added so they're found both locations. settings.m_metadata.Add(static_cast(&entityIdMapper)); settings.m_metadata.Add(&entityIdMapper); - + AZ::JsonSerializationResult::ResultCode result = AZ::JsonSerialization::Load(instance, prefabDom, settings); + AZ::Data::AssetManager::Instance().ResumeAssetRelease(); + if (result.GetProcessing() == AZ::JsonSerializationResult::Processing::Halted) { AZ_Error("Prefab", false, @@ -110,6 +118,11 @@ namespace AzToolsFramework bool LoadInstanceFromPrefabDom( Instance& instance, Instance::EntityList& newlyAddedEntities, const PrefabDom& prefabDom, LoadInstanceFlags flags) { + // When entities are rebuilt they are first destroyed. As a result any assets they were exclusively holding on to will + // be released and reloaded once the entities are built up again. By suspending asset release temporarily the asset reload + // is avoided. + AZ::Data::AssetManager::Instance().SuspendAssetRelease(); + InstanceEntityIdMapper entityIdMapper; entityIdMapper.SetLoadingInstance(instance); if ((flags & LoadInstanceFlags::AssignRandomEntityId) == LoadInstanceFlags::AssignRandomEntityId) @@ -123,12 +136,12 @@ namespace AzToolsFramework // data has strict typing and doesn't look for inheritance both have to be explicitly added so they're found both locations. settings.m_metadata.Add(static_cast(&entityIdMapper)); settings.m_metadata.Add(&entityIdMapper); - - InstanceEntityScrubber instanceEntityScrubber(newlyAddedEntities); - settings.m_metadata.Add(&instanceEntityScrubber); + settings.m_metadata.Create(newlyAddedEntities); AZ::JsonSerializationResult::ResultCode result = AZ::JsonSerialization::Load(instance, prefabDom, settings); + AZ::Data::AssetManager::Instance().ResumeAssetRelease(); + if (result.GetProcessing() == AZ::JsonSerializationResult::Processing::Halted) { AZ_Error( diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp index fc61d5717f..75070d9b41 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp @@ -2662,7 +2662,7 @@ namespace AzToolsFramework QString cleanAssetSafeFolder(QDir::cleanPath(assetSafeFolder.c_str())); // Compare using clean paths so slash direction does not matter. // Note that this comparison is case sensitive because some file systems - // Lumberyard supports are case sensitive. + // Open 3D Engine supports are case sensitive. if (cleanSaveAs.startsWith(cleanAssetSafeFolder)) { isPathSafeForAssets = true; @@ -4017,8 +4017,8 @@ namespace AzToolsFramework // Detach entities action currently acts on entities and all descendants, so include those as part of the selection AzToolsFramework::EntityIdList selectedDetachEntities(selectedTransformHierarchyEntities.begin(), selectedTransformHierarchyEntities.end()); - // A selection in Lumberyard is usually singular, but a selection can have more than one entity. - // No Lumberyard systems support multiple selections, or multiple different groups of selected entities. + // A selection in Open 3D Engine is usually singular, but a selection can have more than one entity. + // No Open 3D Engine systems support multiple selections, or multiple different groups of selected entities. QString detachEntitiesActionText(QObject::tr("Selection")); QString detachEntitiesTooltipText; if (selectedDetachEntities.size() == 1) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/SourceControl/PerforceComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/SourceControl/PerforceComponent.cpp index 20e3bfc59a..c0b0b67c68 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/SourceControl/PerforceComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/SourceControl/PerforceComponent.cpp @@ -71,7 +71,7 @@ namespace AzToolsFramework AZ_Assert(!s_perforceConn, "You may only have one Perforce component.\n"); m_shutdownThreadSignal = false; m_waitingOnTrust = false; - m_autoChangelistDescription = "*Lumberyard Auto"; + m_autoChangelistDescription = "*Open 3D Engine Auto"; m_connectionState = SourceControlState::Disabled; m_validConnection = false; m_testConnection = false; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/ComponentMimeData.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/ComponentMimeData.cpp index 442e576489..affdce6e55 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/ComponentMimeData.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/ComponentMimeData.cpp @@ -24,7 +24,7 @@ namespace AzToolsFramework { QString ComponentTypeMimeData::GetMimeType() { - return "application/x-amazon-lumberyard-editorcomponenttypes"; + return "application/x-amazon-o3de-editorcomponenttypes"; } AZStd::unique_ptr ComponentTypeMimeData::Create(const ClassDataContainer& container) @@ -99,7 +99,7 @@ namespace AzToolsFramework QString ComponentMimeData::GetMimeType() { - return "application/x-amazon-lumberyard-editorcomponentdata"; + return "application/x-amazon-o3de-editorcomponentdata"; } AZStd::unique_ptr ComponentMimeData::Create(const ComponentDataContainer& components) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorComponentBase.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorComponentBase.h index c8ee2f8c8f..e1c42ecdf6 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorComponentBase.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorComponentBase.h @@ -15,7 +15,7 @@ * Header file for the editor component base class. * Derive from this class to create a version of a component to use in the * editor, as opposed to the version of the component that is used during run time. - * To learn more about editor components, see the [Lumberyard Developer Guide] + * To learn more about editor components, see the [Open 3D Engine Developer Guide] * (http://docs.aws.amazon.com/lumberyard/latest/developerguide/component-entity-system-pg-editor-components.html). */ @@ -52,7 +52,7 @@ namespace AzToolsFramework * To create one or more game components to represent your editor component * in runtime, use BuildGameEntity(). * - * To learn more about editor components, see the [Lumberyard Developer Guide] + * To learn more about editor components, see the [Open 3D Engine Developer Guide] * (http://docs.aws.amazon.com/lumberyard/latest/developerguide/component-entity-system-pg-editor-components.html). */ class EditorComponentBase diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponent.cpp index 0119933cad..6365334502 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponent.cpp @@ -408,7 +408,7 @@ namespace AzToolsFramework QString fullLayerPath(layerFolder.filePath(myLayerFileName)); - // Lumberyard will read in the layer in whatever format it's in, so there's no need to check what the save format is set to. + // Open 3D Engine will read in the layer in whatever format it's in, so there's no need to check what the save format is set to. // The save format is also set in this object that is being loaded, so it wouldn't even be available. m_loadedLayer = AZ::Utils::LoadObjectFromFile(fullLayerPath.toUtf8().data()); @@ -1051,7 +1051,6 @@ namespace AzToolsFramework currentFailure)); // FileIO doesn't support removing directory, so use Qt. - // QDir::IsEmpty isn't available until a newer version fo Qt than Lumberyard is using. if (layerTempFolder.entryInfoList( QDir::NoDotAndDotDot | QDir::AllEntries | QDir::System | QDir::Hidden).count() == 0) { @@ -1485,7 +1484,7 @@ namespace AzToolsFramework if (!newLayerEntityId.IsValid()) { - return LayerResult(LayerResultStatus::Error, "Lumberyard was unable to create a layer entity."); + return LayerResult(LayerResultStatus::Error, "Open 3D Engine was unable to create a layer entity."); } // If this new layer has a parent, then set its parent. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponent.h index db01687768..d32ec92c76 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponent.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponent.h @@ -58,7 +58,7 @@ namespace AzToolsFramework AZ::Color m_color = AZ::Color::CreateOne(); // Default to text files, so the save history is easier to understand in source control. // This attribute only effects writing layers, and is safe to store here instead of on the component. - // When reading files off disk, Lumberyard figures out the correct format automatically. + // When reading files off disk, Open 3D Engine figures out the correct format automatically. bool m_saveAsBinary = false; // The layer entity needs to be invisible to all other systems, so they don't show up in the viewport. @@ -338,7 +338,7 @@ namespace AzToolsFramework EditorLayer* m_loadedLayer = nullptr; AZStd::string m_layerFileName; - // Lumberyard's serialization system requires everything in the editor to have a serialized to disk counterpart. + // Open 3D Engine's serialization system requires everything in the editor to have a serialized to disk counterpart. // Layers have their data split into two categories: Stuff that should save to the layer file, and stuff that should // save to the layer component in the level. To allow the layer component to edit the data that goes in the layer file, // a placeholder value is serialized. This is only used at edit time, and is copied and cleared during serialization. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp index ac1ec92049..8cc6d46da8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/LegacyFramework/Core/EditorFrameworkApplication.cpp @@ -112,7 +112,6 @@ namespace LegacyFramework m_applicationEntity = NULL; m_ptrSystemEntity = NULL; m_applicationModule[0] = 0; - m_appRoot[0] = 0; } HMODULE Application::GetMainModule() diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Logging/NewLogTabDialog.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Logging/NewLogTabDialog.cpp index 62b11a8048..4924c315b8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Logging/NewLogTabDialog.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Logging/NewLogTabDialog.cpp @@ -16,7 +16,7 @@ #include "NewLogTabDialog.h" AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags' needs to have dll-interface to be used by clients of class 'QLayoutItem' -#include +#include AZ_POP_DISABLE_WARNING #include #include @@ -97,4 +97,4 @@ namespace AzToolsFramework } // namespace LogPanel } // namespace AzToolsFramework -#include "UI/Logging/moc_NewLogTabDialog.cpp" \ No newline at end of file +#include "UI/Logging/moc_NewLogTabDialog.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp index a3a7e6ee6d..08fc764507 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp @@ -49,7 +49,7 @@ #include #include -#include +#include namespace { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp index 4fb23f2679..1e71b545b5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp @@ -644,7 +644,7 @@ namespace AzToolsFramework QString cleanAssetSafeFolder(QDir::cleanPath(assetSafeFolder.c_str())); // Compare using clean paths so slash direction does not matter. // Note that this comparison is case sensitive because some file systems - // Lumberyard supports are case sensitive. + // Open 3D Engine supports are case sensitive. if (cleanSaveAs.startsWith(cleanAssetSafeFolder)) { isPathSafeForAssets = true; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp index ec3a4addf2..55c7fb3f65 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.cpp @@ -100,7 +100,7 @@ AZ_PUSH_DISABLE_WARNING(4244 4251 4800, "-Wunknown-warning-option") // 4244: con #include AZ_POP_DISABLE_WARNING -#include +#include // This has to live outside of any namespaces due to issues on Linux with calls to Q_INIT_RESOURCE if they are inside a namespace void initEntityPropertyEditorResources() diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.hxx index d11abbc447..fed9c55f15 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.hxx @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ReflectedPropertyEditor.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ReflectedPropertyEditor.hxx index 55b2669e91..ef542074a8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ReflectedPropertyEditor.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/ReflectedPropertyEditor.hxx @@ -89,7 +89,7 @@ namespace AzToolsFramework //! When set, disables data access for this property editor. //! This prevents any value refreshes from the inspected values from occurring as well as disabling user input. void PreventDataAccess(bool shouldPrevent); - // LUMBERYARD_DEPRECATED(LY-120821) + // O3DE_DEPRECATED(LY-120821) void PreventRefresh(bool shouldPrevent){PreventDataAccess(shouldPrevent);} void SetAutoResizeLabels(bool autoResizeLabels); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Slice/SliceOverridesNotificationWindow.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Slice/SliceOverridesNotificationWindow.cpp index 14e7d96204..369bbf3065 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Slice/SliceOverridesNotificationWindow.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Slice/SliceOverridesNotificationWindow.cpp @@ -11,7 +11,7 @@ */ #include "AzToolsFramework_precompiled.h" AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags' needs to have dll-interface to be used by clients of class 'QLayoutItem' -#include "UI/Slice/ui_NotificationWindow.h" +#include AZ_POP_DISABLE_WARNING #include "UI/Slice/Constants.h" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/OverwritePromptDialog.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/OverwritePromptDialog.cpp index 1f95d01e70..af0270fdc2 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/OverwritePromptDialog.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/OverwritePromptDialog.cpp @@ -14,7 +14,7 @@ #include "OverwritePromptDialog.hxx" AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 'QLayoutItem::align': class 'QFlags' needs to have dll-interface to be used by clients of class 'QLayoutItem' -#include +#include AZ_POP_DISABLE_WARNING namespace AzToolsFramework @@ -54,4 +54,4 @@ namespace AzToolsFramework } -#include "UI/UICore/moc_OverwritePromptDialog.cpp" \ No newline at end of file +#include "UI/UICore/moc_OverwritePromptDialog.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ProgressShield.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ProgressShield.cpp index d9713adccb..637a81e14e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ProgressShield.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/ProgressShield.cpp @@ -18,7 +18,7 @@ #include AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 4251: 'QLayoutItem::align': class 'QFlags' needs to have dll-interface to be used by clients of class 'QLayoutItem' -#include +#include AZ_POP_DISABLE_WARNING namespace AzToolsFramework @@ -118,4 +118,4 @@ namespace AzToolsFramework } // namespace AzToolsFramework -#include "UI/UICore/moc_ProgressShield.cpp" \ No newline at end of file +#include "UI/UICore/moc_ProgressShield.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/SaveChangesDialog.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/SaveChangesDialog.cpp index 910f157ad1..5506b24ff6 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/SaveChangesDialog.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/UICore/SaveChangesDialog.cpp @@ -14,7 +14,7 @@ #include "SaveChangesDialog.hxx" AZ_PUSH_DISABLE_WARNING(4244 4251, "-Wunknown-warning-option") -#include +#include AZ_POP_DISABLE_WARNING namespace AzToolsFramework @@ -52,4 +52,4 @@ namespace AzToolsFramework } } -#include "UI/UICore/moc_SaveChangesDialog.cpp" \ No newline at end of file +#include "UI/UICore/moc_SaveChangesDialog.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp index 3f99277a6e..1a3bc0e5a3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.cpp @@ -246,7 +246,7 @@ namespace UnitTest R"(... client unittest_workspace)" "\r\n" R"(... status pending)" "\r\n" R"(... changeType public)" "\r\n" - R"(... desc *Lumberyard Auto)" "\r\n" + R"(... desc *Open 3D Engine Auto)" "\r\n" "\r\n"; } else if (m_commandArgs.starts_with("fstat")) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportTypes.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportTypes.h index 250adc5b86..161ca2d79f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportTypes.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportTypes.h @@ -214,7 +214,7 @@ namespace AzToolsFramework return AzFramework::ScreenPoint{qpoint.x(), qpoint.y()}; } - /// Map from Qt -> Lumberyard buttons. + /// Map from Qt -> Open 3D Engine buttons.>>>>>>> main inline AZ::u32 TranslateMouseButtons(const Qt::MouseButtons buttons) { AZ::u32 result = 0; @@ -224,7 +224,7 @@ namespace AzToolsFramework return result; } - /// Map from Qt -> Lumberyard modifiers. + /// Map from Qt -> Open 3D Engine modifiers. inline AZ::u32 TranslateKeyboardModifiers(const Qt::KeyboardModifiers modifiers) { AZ::u32 result = 0; @@ -234,13 +234,13 @@ namespace AzToolsFramework return result; } - /// Interface to translate Qt modifiers to Lumberyard modifiers. + /// Interface to translate Qt modifiers to Open 3D Engine modifiers. inline KeyboardModifiers BuildKeyboardModifiers(const Qt::KeyboardModifiers modifiers) { return KeyboardModifiers(TranslateKeyboardModifiers(modifiers)); } - /// Interface to translate Qt buttons to Lumberyard buttons. + /// Interface to translate Qt buttons to Open 3D Engine buttons. inline MouseButtons BuildMouseButtons(const Qt::MouseButtons buttons) { return MouseButtons(TranslateMouseButtons(buttons)); diff --git a/Code/Framework/GridMate/GridMate/Replica/DataSet.h b/Code/Framework/GridMate/GridMate/Replica/DataSet.h index 37393dc491..f91a86dcec 100644 --- a/Code/Framework/GridMate/GridMate/Replica/DataSet.h +++ b/Code/Framework/GridMate/GridMate/Replica/DataSet.h @@ -47,7 +47,7 @@ namespace GridMate * * By default, DataSet::BindInterface only invokes on client/non-authoritative replica chunks. * This switch enables the callback on server/authoritative replica chunks. - * Warning: this change should not be enabled on existing Lumberyard components as they were not written with this option in mind. + * Warning: this change should not be enabled on existing Open 3D Engine components as they were not written with this option in mind. * * New user custom replica chunk will work just fine. */ diff --git a/Code/Framework/Tests/OctreePerformanceTests.cpp b/Code/Framework/Tests/OctreePerformanceTests.cpp index ba18ca44fe..a1979dce8e 100644 --- a/Code/Framework/Tests/OctreePerformanceTests.cpp +++ b/Code/Framework/Tests/OctreePerformanceTests.cpp @@ -11,6 +11,7 @@ */ #include +#include #include #if defined(HAVE_BENCHMARK) @@ -33,7 +34,12 @@ namespace Benchmark m_ownsSystemAllocator = true; } + if (!AZ::NameDictionary::IsReady()) + { + AZ::NameDictionary::Create(); + } m_octreeSystemComponent = new AzFramework::OctreeSystemComponent; + m_visScene = m_octreeSystemComponent->CreateVisibilityScene(AZ::Name("OctreeBenchmarkVisibilityScene")); m_dataArray.resize(1000000); m_queryDataArray.resize(1000); @@ -72,7 +78,9 @@ namespace Benchmark void TearDown([[maybe_unused]] const ::benchmark::State& state) override { + m_octreeSystemComponent->DestroyVisibilityScene(m_visScene); delete m_octreeSystemComponent; + AZ::NameDictionary::Destroy(); m_dataArray.clear(); m_dataArray.shrink_to_fit(); @@ -89,19 +97,17 @@ namespace Benchmark void InsertEntries(uint32_t entryCount) { - AzFramework::IVisibilitySystem* visSystem = AZ::Interface::Get(); for (uint32_t i = 0; i < entryCount; ++i) { - visSystem->InsertOrUpdateEntry(m_dataArray[i]); + m_visScene->InsertOrUpdateEntry(m_dataArray[i]); } } void RemoveEntries(uint32_t entryCount) { - AzFramework::IVisibilitySystem* visSystem = AZ::Interface::Get(); for (uint32_t i = 0; i < entryCount; ++i) { - visSystem->RemoveEntry(m_dataArray[i]); + m_visScene->RemoveEntry(m_dataArray[i]); } } @@ -115,7 +121,8 @@ namespace Benchmark bool m_ownsSystemAllocator = false; AZStd::vector m_dataArray; AZStd::vector m_queryDataArray; - AzFramework::OctreeSystemComponent* m_octreeSystemComponent; + AzFramework::OctreeSystemComponent* m_octreeSystemComponent = nullptr; + AzFramework::IVisibilityScene* m_visScene = nullptr; }; BENCHMARK_F(BM_Octree, InsertDelete1000)(benchmark::State& state) @@ -166,7 +173,7 @@ namespace Benchmark { for (auto& queryData : m_queryDataArray) { - m_octreeSystemComponent->Enumerate(queryData.aabb, [](const AzFramework::IVisibilitySystem::NodeData&) {}); + m_visScene->Enumerate(queryData.aabb, [](const AzFramework::IVisibilityScene::NodeData&) {}); } } RemoveEntries(EntryCount); @@ -180,7 +187,7 @@ namespace Benchmark { for (auto& queryData : m_queryDataArray) { - m_octreeSystemComponent->Enumerate(queryData.aabb, [](const AzFramework::IVisibilitySystem::NodeData&) {}); + m_visScene->Enumerate(queryData.aabb, [](const AzFramework::IVisibilityScene::NodeData&) {}); } } RemoveEntries(EntryCount); @@ -194,7 +201,7 @@ namespace Benchmark { for (auto& queryData : m_queryDataArray) { - m_octreeSystemComponent->Enumerate(queryData.aabb, [](const AzFramework::IVisibilitySystem::NodeData&) {}); + m_visScene->Enumerate(queryData.aabb, [](const AzFramework::IVisibilityScene::NodeData&) {}); } } RemoveEntries(EntryCount); @@ -208,7 +215,7 @@ namespace Benchmark { for (auto& queryData : m_queryDataArray) { - m_octreeSystemComponent->Enumerate(queryData.aabb, [](const AzFramework::IVisibilitySystem::NodeData&) {}); + m_visScene->Enumerate(queryData.aabb, [](const AzFramework::IVisibilityScene::NodeData&) {}); } } RemoveEntries(EntryCount); @@ -222,7 +229,7 @@ namespace Benchmark { for (auto& queryData : m_queryDataArray) { - m_octreeSystemComponent->Enumerate(queryData.sphere, [](const AzFramework::IVisibilitySystem::NodeData&) {}); + m_visScene->Enumerate(queryData.sphere, [](const AzFramework::IVisibilityScene::NodeData&) {}); } } RemoveEntries(EntryCount); @@ -236,7 +243,7 @@ namespace Benchmark { for (auto& queryData : m_queryDataArray) { - m_octreeSystemComponent->Enumerate(queryData.sphere, [](const AzFramework::IVisibilitySystem::NodeData&) {}); + m_visScene->Enumerate(queryData.sphere, [](const AzFramework::IVisibilityScene::NodeData&) {}); } } RemoveEntries(EntryCount); @@ -250,7 +257,7 @@ namespace Benchmark { for (auto& queryData : m_queryDataArray) { - m_octreeSystemComponent->Enumerate(queryData.sphere, [](const AzFramework::IVisibilitySystem::NodeData&) {}); + m_visScene->Enumerate(queryData.sphere, [](const AzFramework::IVisibilityScene::NodeData&) {}); } } RemoveEntries(EntryCount); @@ -264,7 +271,7 @@ namespace Benchmark { for (auto& queryData : m_queryDataArray) { - m_octreeSystemComponent->Enumerate(queryData.sphere, [](const AzFramework::IVisibilitySystem::NodeData&) {}); + m_visScene->Enumerate(queryData.sphere, [](const AzFramework::IVisibilityScene::NodeData&) {}); } } RemoveEntries(EntryCount); @@ -278,7 +285,7 @@ namespace Benchmark { for (auto& queryData : m_queryDataArray) { - m_octreeSystemComponent->Enumerate(queryData.frustum, [](const AzFramework::IVisibilitySystem::NodeData&) {}); + m_visScene->Enumerate(queryData.frustum, [](const AzFramework::IVisibilityScene::NodeData&) {}); } } RemoveEntries(EntryCount); @@ -292,7 +299,7 @@ namespace Benchmark { for (auto& queryData : m_queryDataArray) { - m_octreeSystemComponent->Enumerate(queryData.frustum, [](const AzFramework::IVisibilitySystem::NodeData&) {}); + m_visScene->Enumerate(queryData.frustum, [](const AzFramework::IVisibilityScene::NodeData&) {}); } } RemoveEntries(EntryCount); @@ -306,7 +313,7 @@ namespace Benchmark { for (auto& queryData : m_queryDataArray) { - m_octreeSystemComponent->Enumerate(queryData.frustum, [](const AzFramework::IVisibilitySystem::NodeData&) {}); + m_visScene->Enumerate(queryData.frustum, [](const AzFramework::IVisibilityScene::NodeData&) {}); } } RemoveEntries(EntryCount); @@ -320,7 +327,7 @@ namespace Benchmark { for (auto& queryData : m_queryDataArray) { - m_octreeSystemComponent->Enumerate(queryData.frustum, [](const AzFramework::IVisibilitySystem::NodeData&) {}); + m_visScene->Enumerate(queryData.frustum, [](const AzFramework::IVisibilityScene::NodeData&) {}); } } RemoveEntries(EntryCount); diff --git a/Code/Framework/Tests/OctreeTests.cpp b/Code/Framework/Tests/OctreeTests.cpp index d7ba01a500..29c7ef3ff3 100644 --- a/Code/Framework/Tests/OctreeTests.cpp +++ b/Code/Framework/Tests/OctreeTests.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -25,8 +26,13 @@ namespace UnitTest { public: void SetUp() override - { - AllocatorsFixture::SetUp(); + { + // Create the SystemAllocator if not available + if (!AZ::AllocatorInstance::IsReady()) + { + AZ::AllocatorInstance::Create(); + m_ownsSystemAllocator = true; + } m_console = aznew AZ::Console(); AZ::Interface::Register(m_console); @@ -41,12 +47,18 @@ namespace UnitTest m_console->PerformCommand("bg_octreeNodeMinEntries 1"); m_console->PerformCommand("bg_octreeMaxWorldExtents 1"); // Create a -1,-1,-1 to 1,1,1 world volume + if (!AZ::NameDictionary::IsReady()) + { + AZ::NameDictionary::Create(); + } m_octreeSystemComponent = new OctreeSystemComponent; + IVisibilityScene* visScene = m_octreeSystemComponent->CreateVisibilityScene(AZ::Name("OctreeUnitTestScene")); + m_octreeScene = azdynamic_cast(visScene); } void TearDown() override { - // Restore octreeSystemComponent cvars for any future tests or benchmarks that might get executed + //Restore octreeSystemComponent cvars for any future tests or benchmarks that might get executed AZStd::string commandString; commandString.format("bg_octreeNodeMaxEntries %u", m_savedMaxEntries); m_console->PerformCommand(commandString.c_str()); @@ -55,17 +67,31 @@ namespace UnitTest commandString.format("bg_octreeMaxWorldExtents %f", m_savedBounds); m_console->PerformCommand(commandString.c_str()); + m_octreeSystemComponent->DestroyVisibilityScene(m_octreeScene); delete m_octreeSystemComponent; + m_octreeSystemComponent = nullptr; + + AZ::NameDictionary::Destroy(); + AZ::Interface::Unregister(m_console); delete m_console; - AllocatorsFixture::TearDown(); + m_console = nullptr; + + // Destroy system allocator only if it was created by this environment + if (m_ownsSystemAllocator) + { + AZ::AllocatorInstance::Destroy(); + m_ownsSystemAllocator = false; + } } + bool m_ownsSystemAllocator = false; OctreeSystemComponent* m_octreeSystemComponent = nullptr; + OctreeScene* m_octreeScene = nullptr; uint32_t m_savedMaxEntries = 0; uint32_t m_savedMinEntries = 0; float m_savedBounds = 0.0f; - AZ::Console* m_console = nullptr; + AZ::Console* m_console; }; TEST_F(OctreeTests, InsertDeleteSingleEntry) @@ -73,14 +99,16 @@ namespace UnitTest AzFramework::VisibilityEntry visEntry; visEntry.m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3::CreateZero(), AZ::Vector3::CreateOne()); - m_octreeSystemComponent->InsertOrUpdateEntry(visEntry); + m_octreeScene->InsertOrUpdateEntry(visEntry); EXPECT_TRUE(visEntry.m_internalNode != nullptr); EXPECT_TRUE(visEntry.m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 1); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); - m_octreeSystemComponent->RemoveEntry(visEntry); + m_octreeScene->RemoveEntry(visEntry); EXPECT_TRUE(visEntry.m_internalNode == nullptr); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 0); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 0); + + EXPECT_TRUE(true); //TEST } TEST_F(OctreeTests, InsertDeleteSplitMerge) @@ -90,37 +118,37 @@ namespace UnitTest visEntry[1].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3( 0.1f), AZ::Vector3( 0.4f)); visEntry[2].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3( 0.6f), AZ::Vector3( 0.9f)); - m_octreeSystemComponent->InsertOrUpdateEntry(visEntry[0]); + m_octreeScene->InsertOrUpdateEntry(visEntry[0]); EXPECT_TRUE(visEntry[0].m_internalNode != nullptr); EXPECT_TRUE(visEntry[0].m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 1); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); - m_octreeSystemComponent->InsertOrUpdateEntry(visEntry[1]); // This should force a split of the root node + m_octreeScene->InsertOrUpdateEntry(visEntry[1]); // This should force a split of the root node EXPECT_TRUE(visEntry[1].m_internalNode != nullptr); EXPECT_TRUE(visEntry[1].m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 2); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1 + m_octreeSystemComponent->GetChildNodeCount()); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 2); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + m_octreeScene->GetChildNodeCount()); - m_octreeSystemComponent->InsertOrUpdateEntry(visEntry[2]); // This should force a split of the roots +/+/+ child node + m_octreeScene->InsertOrUpdateEntry(visEntry[2]); // This should force a split of the roots +/+/+ child node EXPECT_TRUE(visEntry[2].m_internalNode != nullptr); EXPECT_TRUE(visEntry[2].m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 3); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1 + (2 * m_octreeSystemComponent->GetChildNodeCount())); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 3); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + (2 * m_octreeScene->GetChildNodeCount())); - m_octreeSystemComponent->RemoveEntry(visEntry[2]); + m_octreeScene->RemoveEntry(visEntry[2]); EXPECT_TRUE(visEntry[2].m_internalNode == nullptr); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 2); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1 + m_octreeSystemComponent->GetChildNodeCount()); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 2); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + m_octreeScene->GetChildNodeCount()); - m_octreeSystemComponent->RemoveEntry(visEntry[1]); + m_octreeScene->RemoveEntry(visEntry[1]); EXPECT_TRUE(visEntry[1].m_internalNode == nullptr); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 1); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); - m_octreeSystemComponent->RemoveEntry(visEntry[0]); + m_octreeScene->RemoveEntry(visEntry[0]); EXPECT_TRUE(visEntry[0].m_internalNode == nullptr); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 0); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 0); } TEST_F(OctreeTests, UpdateSingleEntry) @@ -128,23 +156,23 @@ namespace UnitTest AzFramework::VisibilityEntry visEntry; visEntry.m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3::CreateZero(), AZ::Vector3::CreateOne()); - m_octreeSystemComponent->InsertOrUpdateEntry(visEntry); + m_octreeScene->InsertOrUpdateEntry(visEntry); EXPECT_TRUE(visEntry.m_internalNode != nullptr); EXPECT_TRUE(visEntry.m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 1); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); visEntry.m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-0.5f), AZ::Vector3(0.5f)); - m_octreeSystemComponent->InsertOrUpdateEntry(visEntry); + m_octreeScene->InsertOrUpdateEntry(visEntry); EXPECT_TRUE(visEntry.m_internalNode != nullptr); EXPECT_TRUE(visEntry.m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 1); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); - m_octreeSystemComponent->RemoveEntry(visEntry); + m_octreeScene->RemoveEntry(visEntry); EXPECT_TRUE(visEntry.m_internalNode == nullptr); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 0); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 0); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); } TEST_F(OctreeTests, UpdateSplitMerge) @@ -154,92 +182,92 @@ namespace UnitTest visEntry[1].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3( 0.1f), AZ::Vector3( 0.4f)); visEntry[2].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3( 0.6f), AZ::Vector3( 0.9f)); - m_octreeSystemComponent->InsertOrUpdateEntry(visEntry[0]); + m_octreeScene->InsertOrUpdateEntry(visEntry[0]); EXPECT_TRUE(visEntry[0].m_internalNode != nullptr); EXPECT_TRUE(visEntry[0].m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 1); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); - m_octreeSystemComponent->InsertOrUpdateEntry(visEntry[1]); // This should force a split of the root node + m_octreeScene->InsertOrUpdateEntry(visEntry[1]); // This should force a split of the root node EXPECT_TRUE(visEntry[1].m_internalNode != nullptr); EXPECT_TRUE(visEntry[1].m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 2); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1 + m_octreeSystemComponent->GetChildNodeCount()); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 2); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + m_octreeScene->GetChildNodeCount()); - m_octreeSystemComponent->InsertOrUpdateEntry(visEntry[2]); // This should force a split of the roots +/+/+ child node + m_octreeScene->InsertOrUpdateEntry(visEntry[2]); // This should force a split of the roots +/+/+ child node EXPECT_TRUE(visEntry[2].m_internalNode != nullptr); EXPECT_TRUE(visEntry[2].m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 3); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1 + (2 * m_octreeSystemComponent->GetChildNodeCount())); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 3); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + (2 * m_octreeScene->GetChildNodeCount())); visEntry[1].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-0.9f), AZ::Vector3(-0.6f)); visEntry[2].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3( 0.1f), AZ::Vector3( 0.4f)); visEntry[0].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3( 0.6f), AZ::Vector3( 0.9f)); - m_octreeSystemComponent->InsertOrUpdateEntry(visEntry[0]); - m_octreeSystemComponent->InsertOrUpdateEntry(visEntry[1]); - m_octreeSystemComponent->InsertOrUpdateEntry(visEntry[2]); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 3); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1 + (2 * m_octreeSystemComponent->GetChildNodeCount())); + m_octreeScene->InsertOrUpdateEntry(visEntry[0]); + m_octreeScene->InsertOrUpdateEntry(visEntry[1]); + m_octreeScene->InsertOrUpdateEntry(visEntry[2]); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 3); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + (2 * m_octreeScene->GetChildNodeCount())); - m_octreeSystemComponent->RemoveEntry(visEntry[2]); + m_octreeScene->RemoveEntry(visEntry[2]); EXPECT_TRUE(visEntry[2].m_internalNode == nullptr); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 2); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1 + m_octreeSystemComponent->GetChildNodeCount()); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 2); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + m_octreeScene->GetChildNodeCount()); - m_octreeSystemComponent->RemoveEntry(visEntry[1]); + m_octreeScene->RemoveEntry(visEntry[1]); EXPECT_TRUE(visEntry[1].m_internalNode == nullptr); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 1); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); - m_octreeSystemComponent->RemoveEntry(visEntry[0]); + m_octreeScene->RemoveEntry(visEntry[0]); EXPECT_TRUE(visEntry[0].m_internalNode == nullptr); - EXPECT_TRUE(m_octreeSystemComponent->GetEntryCount() == 0); - EXPECT_TRUE(m_octreeSystemComponent->GetNodeCount() == 1); + EXPECT_TRUE(m_octreeScene->GetEntryCount() == 0); + EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); } - void AppendEntries(AZStd::vector& gatheredEntries, const AzFramework::IVisibilitySystem::NodeData& nodeData) + void AppendEntries(AZStd::vector& gatheredEntries, const AzFramework::IVisibilityScene::NodeData& nodeData) { gatheredEntries.insert(gatheredEntries.end(), nodeData.m_entries.begin(), nodeData.m_entries.end()); } template - void EnumerateSingleEntryHelper(OctreeSystemComponent* octreeSystemComponent, const BoundType& bounds) + void EnumerateSingleEntryHelper(IVisibilityScene* visScene, const BoundType& bounds) { AzFramework::VisibilityEntry visEntry; visEntry.m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3::CreateZero(), AZ::Vector3::CreateOne()); AZStd::vector gatheredEntries; - octreeSystemComponent->Enumerate(bounds, [&gatheredEntries](const AzFramework::IVisibilitySystem::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); + visScene->Enumerate(bounds, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); EXPECT_TRUE(gatheredEntries.empty()); - octreeSystemComponent->InsertOrUpdateEntry(visEntry); - octreeSystemComponent->Enumerate(bounds, [&gatheredEntries](const AzFramework::IVisibilitySystem::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); + visScene->InsertOrUpdateEntry(visEntry); + visScene->Enumerate(bounds, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); EXPECT_TRUE(gatheredEntries.size() == 1); EXPECT_TRUE(gatheredEntries[0] == &visEntry); visEntry.m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-0.5f), AZ::Vector3(0.5f)); - octreeSystemComponent->InsertOrUpdateEntry(visEntry); + visScene->InsertOrUpdateEntry(visEntry); gatheredEntries.clear(); - octreeSystemComponent->Enumerate(bounds, [&gatheredEntries](const AzFramework::IVisibilitySystem::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); + visScene->Enumerate(bounds, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); EXPECT_TRUE(gatheredEntries.size() == 1); EXPECT_TRUE(gatheredEntries[0] == &visEntry); - octreeSystemComponent->RemoveEntry(visEntry); + visScene->RemoveEntry(visEntry); gatheredEntries.clear(); - octreeSystemComponent->Enumerate(bounds, [&gatheredEntries](const AzFramework::IVisibilitySystem::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); + visScene->Enumerate(bounds, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); EXPECT_TRUE(gatheredEntries.empty()); } TEST_F(OctreeTests, EnumerateSphereSingleEntry) { AZ::Sphere bounds = AZ::Sphere::CreateUnitSphere(); - EnumerateSingleEntryHelper(m_octreeSystemComponent, bounds); + EnumerateSingleEntryHelper(m_octreeScene, bounds); } TEST_F(OctreeTests, EnumerateAabbSingleEntry) { AZ::Aabb bounds = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-1.0f), AZ::Vector3(1.0f)); - EnumerateSingleEntryHelper(m_octreeSystemComponent, bounds); + EnumerateSingleEntryHelper(m_octreeScene, bounds); } TEST_F(OctreeTests, EnumerateFrustumSingleEntry) @@ -248,14 +276,14 @@ namespace UnitTest AZ::Quaternion frustumDirection = AZ::Quaternion::CreateIdentity(); AZ::Transform frustumTransform = AZ::Transform::CreateFromQuaternionAndTranslation(frustumDirection, frustumOrigin); AZ::Frustum bounds = AZ::Frustum(AZ::ViewFrustumAttributes(frustumTransform, 1.0f, 2.0f * atanf(0.5f), 1.0f, 3.0f)); - EnumerateSingleEntryHelper(m_octreeSystemComponent, bounds); + EnumerateSingleEntryHelper(m_octreeScene, bounds); } // bound1 should cover the entire spatial hash // bound2 should not cross into the positive Y-axis // bound3 should only intersect the region inside 0.6, 0.6, 0.6 to 0.9, 0.9, 0.9 template - void EnumerateMultipleEntriesHelper(OctreeSystemComponent* octreeSystemComponent, const BoundType& bound1, const BoundType& bound2, const BoundType& bound3) + void EnumerateMultipleEntriesHelper(IVisibilityScene* visScene, const BoundType& bound1, const BoundType& bound2, const BoundType& bound3) { AZStd::vector gatheredEntries; @@ -264,50 +292,50 @@ namespace UnitTest visEntry[1].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3( 0.1f), AZ::Vector3( 0.4f)); visEntry[2].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3( 0.6f), AZ::Vector3( 0.9f)); - octreeSystemComponent->InsertOrUpdateEntry(visEntry[0]); - octreeSystemComponent->InsertOrUpdateEntry(visEntry[1]); - octreeSystemComponent->InsertOrUpdateEntry(visEntry[2]); + visScene->InsertOrUpdateEntry(visEntry[0]); + visScene->InsertOrUpdateEntry(visEntry[1]); + visScene->InsertOrUpdateEntry(visEntry[2]); gatheredEntries.clear(); - octreeSystemComponent->Enumerate(bound1, [&gatheredEntries](const AzFramework::IVisibilitySystem::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); + visScene->Enumerate(bound1, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); EXPECT_TRUE(gatheredEntries.size() == 3); gatheredEntries.clear(); - octreeSystemComponent->Enumerate(bound2, [&gatheredEntries](const AzFramework::IVisibilitySystem::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); + visScene->Enumerate(bound2, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); EXPECT_TRUE(gatheredEntries.size() == 1); EXPECT_TRUE(gatheredEntries[0] == &(visEntry[0])); gatheredEntries.clear(); - octreeSystemComponent->Enumerate(bound3, [&gatheredEntries](const AzFramework::IVisibilitySystem::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); + visScene->Enumerate(bound3, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); EXPECT_TRUE(gatheredEntries.size() == 1); EXPECT_TRUE(gatheredEntries[0] == &(visEntry[2])); visEntry[1].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-0.9f), AZ::Vector3(-0.6f)); visEntry[2].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3( 0.1f), AZ::Vector3( 0.4f)); visEntry[0].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3( 0.6f), AZ::Vector3( 0.9f)); - octreeSystemComponent->InsertOrUpdateEntry(visEntry[0]); - octreeSystemComponent->InsertOrUpdateEntry(visEntry[1]); - octreeSystemComponent->InsertOrUpdateEntry(visEntry[2]); + visScene->InsertOrUpdateEntry(visEntry[0]); + visScene->InsertOrUpdateEntry(visEntry[1]); + visScene->InsertOrUpdateEntry(visEntry[2]); gatheredEntries.clear(); - octreeSystemComponent->Enumerate(bound1, [&gatheredEntries](const AzFramework::IVisibilitySystem::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); + visScene->Enumerate(bound1, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); EXPECT_TRUE(gatheredEntries.size() == 3); gatheredEntries.clear(); - octreeSystemComponent->Enumerate(bound2, [&gatheredEntries](const AzFramework::IVisibilitySystem::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); + visScene->Enumerate(bound2, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); EXPECT_TRUE(gatheredEntries.size() == 1); EXPECT_TRUE(gatheredEntries[0] == &(visEntry[1])); gatheredEntries.clear(); - octreeSystemComponent->Enumerate(bound3, [&gatheredEntries](const AzFramework::IVisibilitySystem::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); + visScene->Enumerate(bound3, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); EXPECT_TRUE(gatheredEntries.size() == 1); EXPECT_TRUE(gatheredEntries[0] == &(visEntry[0])); - octreeSystemComponent->RemoveEntry(visEntry[0]); - octreeSystemComponent->RemoveEntry(visEntry[1]); - octreeSystemComponent->RemoveEntry(visEntry[2]); + visScene->RemoveEntry(visEntry[0]); + visScene->RemoveEntry(visEntry[1]); + visScene->RemoveEntry(visEntry[2]); gatheredEntries.clear(); - octreeSystemComponent->Enumerate(bound1, [&gatheredEntries](const AzFramework::IVisibilitySystem::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); + visScene->Enumerate(bound1, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) { AppendEntries(gatheredEntries, nodeData); }); EXPECT_TRUE(gatheredEntries.empty()); } @@ -316,7 +344,7 @@ namespace UnitTest AZ::Sphere bound1 = AZ::Sphere::CreateUnitSphere(); AZ::Sphere bound2 = AZ::Sphere(AZ::Vector3(-0.5f), 0.5f); AZ::Sphere bound3 = AZ::Sphere(AZ::Vector3(0.75f), 0.2f); - EnumerateMultipleEntriesHelper(m_octreeSystemComponent, bound1, bound2, bound3); + EnumerateMultipleEntriesHelper(m_octreeScene, bound1, bound2, bound3); } TEST_F(OctreeTests, EnumerateAabbMultipleEntries) @@ -324,7 +352,7 @@ namespace UnitTest AZ::Aabb bound1 = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-1.0f), AZ::Vector3( 1.0f)); AZ::Aabb bound2 = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-1.0f), AZ::Vector3(-0.5f)); AZ::Aabb bound3 = AZ::Aabb::CreateFromMinMax(AZ::Vector3( 0.6f), AZ::Vector3( 0.9f)); - EnumerateMultipleEntriesHelper(m_octreeSystemComponent, bound1, bound2, bound3); + EnumerateMultipleEntriesHelper(m_octreeScene, bound1, bound2, bound3); } TEST_F(OctreeTests, EnumerateFrustumMultipleEntries) @@ -335,6 +363,6 @@ namespace UnitTest AZ::Frustum bound1 = AZ::Frustum(AZ::ViewFrustumAttributes(frustumTransform, 1.0f, 2.0f * atanf(0.5f), 1.0f, 3.0f)); AZ::Frustum bound2 = AZ::Frustum(AZ::ViewFrustumAttributes(frustumTransform, 1.0f, 2.0f * atanf(0.5f), 1.0f, 2.0f)); AZ::Frustum bound3 = AZ::Frustum(AZ::ViewFrustumAttributes(frustumTransform, 1.0f, 2.0f * atanf(0.5f), 2.6f, 2.9f)); - EnumerateMultipleEntriesHelper(m_octreeSystemComponent, bound1, bound2, bound3); + EnumerateMultipleEntriesHelper(m_octreeScene, bound1, bound2, bound3); } } diff --git a/Code/LauncherUnified/CMakeLists.txt b/Code/LauncherUnified/CMakeLists.txt index 0d056686b8..cef937684d 100644 --- a/Code/LauncherUnified/CMakeLists.txt +++ b/Code/LauncherUnified/CMakeLists.txt @@ -67,182 +67,7 @@ if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) endif() -get_property(LY_PROJECTS_TARGET_NAME GLOBAL PROPERTY LY_PROJECTS_TARGET_NAME) -foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJECTS) - # Computes the realpath to the project - # If the project_path is relative, it is evaluated relative to the ${LY_ROOT_FOLDER} - # Otherwise the the absolute project_path is returned with symlinks resolved - file(REAL_PATH ${project_path} project_real_path BASE_DIRECTORY ${LY_ROOT_FOLDER}) - ################################################################################ - # Monolithic game - ################################################################################ - if(LY_MONOLITHIC_GAME) - - # In the monolithic case, we need to register the gem modules, to do so we will generate a StaticModules.inl - # file from StaticModules.in - - get_property(game_gem_dependencies GLOBAL PROPERTY LY_DELAYED_DEPENDENCIES_${project_name}.GameLauncher) - - unset(extern_module_declarations) - unset(module_invocations) - - foreach(game_gem_dependency ${game_gem_dependencies}) - # To match the convention on how gems targets vs gem modules are named, we remove the "Gem::" from prefix - # and remove the ".Static" from the suffix - string(REGEX REPLACE "^Gem::" "Gem_" game_gem_dependency ${game_gem_dependency}) - string(REGEX REPLACE "^Project::" "Project_" game_gem_dependency ${game_gem_dependency}) - # Replace "." with "_" - string(REPLACE "." "_" game_gem_dependency ${game_gem_dependency}) - - string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_${game_gem_dependency}();\n") - string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_${game_gem_dependency}());\n") - - endforeach() - - configure_file(StaticModules.in - ${CMAKE_CURRENT_BINARY_DIR}/${project_name}.GameLauncher/Includes/StaticModules.inl - ) - - set(game_build_dependencies - ${game_gem_dependencies} - Legacy::CrySystem - Legacy::CryFont - Legacy::Cry3DEngine - ) - - if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) - get_property(server_gem_dependencies GLOBAL PROPERTY LY_DELAYED_DEPENDENCIES_${project_name}.ServerLauncher) - - unset(extern_module_declarations) - unset(module_invocations) - - foreach(server_gem_dependency ${server_gem_dependencies}) - # To match the convention on how gems targets vs gem modules are named, we remove the "Gem::" from prefix - # and remove the ".Static" from the suffix - string(REGEX REPLACE "^Gem::" "Gem_" server_gem_dependency ${server_gem_dependency}) - string(REGEX REPLACE "^Project::" "Project_" server_gem_dependency ${server_gem_dependency}) - # Replace "." with "_" - string(REPLACE "." "_" server_gem_dependency ${server_gem_dependency}) - - string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_${server_gem_dependency}();\n") - string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_${server_gem_dependency}());\n") - - endforeach() - - configure_file(StaticModules.in - ${CMAKE_CURRENT_BINARY_DIR}/${project_name}.ServerLauncher/Includes/StaticModules.inl - ) - - set(server_build_dependencies - ${game_gem_dependencies} - Legacy::CrySystem - Legacy::CryFont - Legacy::Cry3DEngine - ) - endif() - - else() - - set(game_runtime_dependencies - Legacy::CrySystem - Legacy::CryFont - Legacy::Cry3DEngine - ) - if(PAL_TRAIT_BUILD_SERVER_SUPPORTED AND NOT LY_MONOLITHIC_GAME) # Only Atom is supported in monolithic builds - set(server_runtime_dependencies - Legacy::CryRenderNULL - ) - endif() - - endif() - - ################################################################################ - # Game - ################################################################################ - ly_add_target( - NAME ${project_name}.GameLauncher ${PAL_TRAIT_LAUNCHERUNIFIED_LAUNCHER_TYPE} - NAMESPACE AZ - FILES_CMAKE - launcher_project_files.cmake - PLATFORM_INCLUDE_FILES - ${pal_dir}/launcher_project_${PAL_PLATFORM_NAME_LOWERCASE}.cmake - COMPILE_DEFINITIONS - PRIVATE - # Adds the name of the project/game - LY_PROJECT_NAME="${project_name}" - # Adds the project path supplied to CMake during configuration - # This is used as a fallback to launch the AssetProcessor - LY_PROJECT_CMAKE_PATH="${project_path}" - # Adds the ${project_name}_GameLauncher target as a define so for the Settings Registry to use - # when loading .setreg file specializations - # This is needed so that only gems for the project game launcher are loaded - LY_CMAKE_TARGET="${project_name}_GameLauncher" - INCLUDE_DIRECTORIES - PRIVATE - . - ${CMAKE_CURRENT_BINARY_DIR}/${project_name}.GameLauncher/Includes # required for StaticModules.inl - BUILD_DEPENDENCIES - PRIVATE - AZ::Launcher.Static - AZ::Launcher.Game.Static - ${game_build_dependencies} - RUNTIME_DEPENDENCIES - ${game_runtime_dependencies} - ) - # Needs to be set manually after ly_add_target to prevent the default location overriding it - set_target_properties(${project_name}.GameLauncher - PROPERTIES - FOLDER ${project_name} - ) - - ################################################################################ - # Server - ################################################################################ - if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) - - get_property(server_projects GLOBAL PROPERTY LY_LAUNCHER_SERVER_PROJECTS) - if(${project_name} IN_LIST server_projects) - - ly_add_target( - NAME ${project_name}.ServerLauncher APPLICATION - NAMESPACE AZ - FILES_CMAKE - launcher_project_files.cmake - PLATFORM_INCLUDE_FILES - ${pal_dir}/launcher_project_${PAL_PLATFORM_NAME_LOWERCASE}.cmake - COMPILE_DEFINITIONS - PRIVATE - # Adds the name of the project/game - LY_PROJECT_NAME="${project_name}" - # Adds the project path supplied to CMake during configuration - # This is used as a fallback to launch the AssetProcessor - LY_PROJECT_CMAKE_PATH="${project_path}" - # Adds the ${project_name}_ServerLauncher target as a define so for the Settings Registry to use - # when loading .setreg file specializations - # This is needed so that only gems for the project server launcher are loaded - LY_CMAKE_TARGET="${project_name}_ServerLauncher" - INCLUDE_DIRECTORIES - PRIVATE - . - ${CMAKE_CURRENT_BINARY_DIR}/${project_name}.ServerLauncher/Includes # required for StaticModules.inl - BUILD_DEPENDENCIES - PRIVATE - AZ::Launcher.Static - AZ::Launcher.Server.Static - ${server_build_dependencies} - RUNTIME_DEPENDENCIES - ${server_runtime_dependencies} - ) - # Needs to be set manually after ly_add_target to prevent the default location overriding it - set_target_properties(${project_name}.ServerLauncher - PROPERTIES - FOLDER ${project_name} - ) - endif() - - endif() - -endforeach() +include(${CMAKE_CURRENT_LIST_DIR}/launcher_generator.cmake) ################################################################################ # Tests diff --git a/Code/LauncherUnified/FindLauncherGenerator.cmake b/Code/LauncherUnified/FindLauncherGenerator.cmake new file mode 100644 index 0000000000..0a975776b8 --- /dev/null +++ b/Code/LauncherUnified/FindLauncherGenerator.cmake @@ -0,0 +1,14 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +set(pal_dir ${LY_ROOT_FOLDER}/LauncherGenerator/Platform/${PAL_PLATFORM_NAME}) +include(${pal_dir}/LauncherUnified_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) +include(${LY_ROOT_FOLDER}/LauncherGenerator/launcher_generator.cmake) \ No newline at end of file diff --git a/Code/LauncherUnified/Game.cpp b/Code/LauncherUnified/Game.cpp index c101dd4efa..3d4cb4769f 100644 --- a/Code/LauncherUnified/Game.cpp +++ b/Code/LauncherUnified/Game.cpp @@ -12,7 +12,7 @@ #include -namespace LumberyardLauncher +namespace O3DELauncher { bool WaitForAssetProcessorConnect() { diff --git a/Code/LauncherUnified/Launcher.cpp b/Code/LauncherUnified/Launcher.cpp index c00bb06be3..cd9d73421b 100644 --- a/Code/LauncherUnified/Launcher.cpp +++ b/Code/LauncherUnified/Launcher.cpp @@ -18,7 +18,8 @@ #include #include #include -#include +#include +#include #include #include @@ -230,7 +231,7 @@ namespace } -namespace LumberyardLauncher +namespace O3DELauncher { AZ_CVAR(bool, bg_ConnectToAssetProcessor, true, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "If true, the process will launch and connect to the asset processor"); @@ -357,9 +358,9 @@ namespace LumberyardLauncher return connectedToAssetProcessor; } - //! Compiles the critical assets that are within the Engine directory of Lumberyard + //! Compiles the critical assets that are within the Engine directory of Open 3D Engine //! This code should be in a centralized location, but doesn't belong in AzFramework - //! since it is specific to how Lumberyard projects has assets setup + //! since it is specific to how Open 3D Engine projects has assets setup void CompileCriticalAssets() { // VERY early on, as soon as we can, request that the asset system make sure the following assets take priority over others, @@ -385,79 +386,86 @@ namespace LumberyardLauncher AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey, "remote_filesystem"); if (allowRemoteFilesystem != 0) { - // The SetInstance calls below will assert if this has already been set and we don't clear first // Application::StartCommon will set a LocalFileIO base first. // This provides an opportunity for the RemoteFileIO to override the direct instance - auto remoteFileIo = new AZ::IO::RemoteFileIO(AZ::IO::FileIOBase::GetDirectInstance()); // Wrap AZ:I::LocalFileIO the direct instance + auto remoteFileIo = new AZ::IO::RemoteFileIO(AZ::IO::FileIOBase::GetDirectInstance()); // Wrap LocalFileIO the direct instance AZ::IO::FileIOBase::SetDirectInstance(nullptr); // Wrap AZ:IO::LocalFileIO the direct instance AZ::IO::FileIOBase::SetDirectInstance(remoteFileIo); } } - //! Add the GameProjectName and Launcher build target name into the settings registry - void AddProjectMetadataToSettingsRegistry(AZ::SettingsRegistryInterface& settingsRegistry, AZ::CommandLine& commandLine) + ReturnCode Run(const PlatformMainInfo& mainInfo) { - // Inject the Project Path and Project into the CommandLine parameters to beginning of the command line - // in order to allow it to used as a fallback if the parameters aren't supplied launch parameters already - // Command Line parameters are the bootstrap settings into the Settings Registry, so they precedence - auto projectPathKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) - + "/project_path"; - auto projectNameKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey) - + "/project_name"; + if (mainInfo.m_updateResourceLimits + && !mainInfo.m_updateResourceLimits()) + { + return ReturnCode::ErrResourceLimit; + } + + // Game Application (AzGameFramework) + int gameArgC = mainInfo.m_argC; + char** gameArgV = const_cast(mainInfo.m_argV); + constexpr size_t MaxCommandArgsCount = 128; + using ArgumentContainer = AZStd::fixed_vector; + ArgumentContainer argContainer(gameArgV, gameArgV + gameArgC); - AZ::CommandLine::ParamContainer commandLineArgs; - commandLine.Dump(commandLineArgs); + using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString; + // Inject the Engine Path, Project Path and Project Name into the CommandLine parameters to the command line + // in order to be used in the Settings Registry + + // The command line overrides are stored in the following fixed strings + // until the ComponentApplication constructor can parse the command line parameters + FixedValueString projectNameOptionOverride; + FixedValueString projectPathOptionOverride; + FixedValueString enginePathOptionOverride; // Insert the project_name option to the front const AZStd::string_view launcherProjectName = GetProjectName(); if (!launcherProjectName.empty()) { - auto projectNameOptionOverride = AZ::SettingsRegistryInterface::FixedValueString::format(R"(--regset="%s=%.*s")", + const auto projectNameKey = FixedValueString(AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey) + "/project_name"; + projectNameOptionOverride = FixedValueString::format(R"(--regset="%s=%.*s")", projectNameKey.c_str(), aznumeric_cast(launcherProjectName.size()), launcherProjectName.data()); - commandLineArgs.emplace(commandLineArgs.begin(), projectNameOptionOverride); + argContainer.emplace_back(projectNameOptionOverride.data()); } - // Insert the project_path option to the front - const AZStd::string_view projectPath = GetProjectPath(); - if (!projectPath.empty()) + // Non-host platforms cannot use the project path that is #defined within the launcher. + // In this case the the result of AZ::Utils::GetDefaultAppRoot is used instead + AZStd::string_view projectPath; +#if AZ_TRAIT_OS_IS_HOST_OS_PLATFORM + // Insert the project_path option to the front of the command line arguments + projectPath = GetProjectPath(); +#else + // Make sure the defaultAppRootPath variable is in scope long enough until the projectPath string_view is used below + AZStd::optional defaultAppRootPath = AZ::Utils::GetDefaultAppRootPath(); + if (defaultAppRootPath.has_value()) { - auto projectPathOptionOverride = AZ::SettingsRegistryInterface::FixedValueString::format(R"(--regset="%s=%.*s")", - projectPathKey.c_str(), aznumeric_cast(projectPath.size()), projectPath.data()); - commandLineArgs.emplace(commandLineArgs.begin(), projectPathOptionOverride); + projectPath = *defaultAppRootPath; } - - commandLine.Parse(commandLineArgs); - - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_CommandLine(settingsRegistry, commandLine, false); - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(settingsRegistry); - - const AZStd::string_view buildTargetName = LumberyardLauncher::GetBuildTargetName(); - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddBuildSystemTargetSpecialization(settingsRegistry, buildTargetName); - - AZ_TracePrintf("Launcher", R"(Running project "%.*s.)" "\n" - R"(The project name value has been successfully set in the Settings Registry at key "%s/project_name" for Launcher target "%.*s")" "\n", - aznumeric_cast(launcherProjectName.size()), launcherProjectName.data(), - AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey, - aznumeric_cast(buildTargetName.size()), buildTargetName.data()); - } - - ReturnCode Run(const PlatformMainInfo& mainInfo) - { - if (mainInfo.m_updateResourceLimits - && !mainInfo.m_updateResourceLimits()) +#endif + if (!projectPath.empty()) { - return ReturnCode::ErrResourceLimit; + const auto projectPathKey = FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + + "/project_path"; + projectPathOptionOverride = FixedValueString::format(R"(--regset="%s=%.*s")", + projectPathKey.c_str(), aznumeric_cast(projectPath.size()), projectPath.data()); + argContainer.emplace_back(projectPathOptionOverride.data()); + + // For non-host platforms set the engine root to be the project root + // Since the directories available during execution are limited on those platforms +#if !AZ_TRAIT_OS_IS_HOST_OS_PLATFORM + AZStd::string_view enginePath = projectPath; + const auto enginePathKey = FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + + "/engine_path"; + enginePathOptionOverride = FixedValueString ::format(R"(--regset="%s=%.*s")", + enginePathKey.c_str(), aznumeric_cast(enginePath.size()), enginePath.data()); + argContainer.emplace_back(enginePathOptionOverride.data()); +#endif } - // Game Application (AzGameFramework) - int gameArgC = mainInfo.m_argC; - char** gameArgV = const_cast(mainInfo.m_argV); - int* argCParam = (gameArgC > 0) ? &gameArgC : nullptr; - char*** argVParam = (gameArgC > 0) ? &gameArgV : nullptr; - - AzGameFramework::GameApplication gameApplication(argCParam, argVParam); + AzGameFramework::GameApplication gameApplication(aznumeric_cast(argContainer.size()), argContainer.data()); // The settings registry has been created by the AZ::ComponentApplication constructor at this point auto settingsRegistry = AZ::SettingsRegistry::Get(); if (settingsRegistry == nullptr) @@ -466,9 +474,15 @@ namespace LumberyardLauncher return ReturnCode::ErrValidation; } - // Inject the ${LY_GAMEFOLDER} project name define that from the Launcher build target - // into the settings registry - AddProjectMetadataToSettingsRegistry(*settingsRegistry, *gameApplication.GetAzCommandLine()); + const AZStd::string_view buildTargetName = GetBuildTargetName(); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddBuildSystemTargetSpecialization(*settingsRegistry, buildTargetName); + + AZ_TracePrintf("Launcher", R"(Running project "%.*s.)" "\n" + R"(The project name value has been successfully set in the Settings Registry at key "%s/project_name)" + R"( for Launcher target "%.*s")" "\n", + aznumeric_cast(launcherProjectName.size()), launcherProjectName.data(), + AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey, + aznumeric_cast(buildTargetName.size()), buildTargetName.data()); AZ::SettingsRegistryInterface::FixedValueString pathToAssets; if (!settingsRegistry->Get(pathToAssets, AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder)) @@ -487,7 +501,7 @@ namespace LumberyardLauncher CryAllocatorsRAII cryAllocatorsRAII; - // System Init Params ("Legacy" Lumberyard) + // System Init Params ("Legacy" Open 3D Engine) SSystemInitParams systemInitParams; memset(&systemInitParams, 0, sizeof(SSystemInitParams)); diff --git a/Code/LauncherUnified/Launcher.h b/Code/LauncherUnified/Launcher.h index 49f6a33f3c..5186517898 100644 --- a/Code/LauncherUnified/Launcher.h +++ b/Code/LauncherUnified/Launcher.h @@ -18,7 +18,7 @@ struct IOutputPrintSink; -namespace LumberyardLauncher +namespace O3DELauncher { struct CryAllocatorsRAII { @@ -98,7 +98,7 @@ namespace LumberyardLauncher const char* GetReturnCodeString(ReturnCode code); - //! The main entry point for all lumberyard launchers + //! The main entry point for all O3DE launchers ReturnCode Run(const PlatformMainInfo& mainInfo = PlatformMainInfo()); ////////////////////////////////////////////////////////////////////////// diff --git a/Code/LauncherUnified/LauncherProject.cpp b/Code/LauncherUnified/LauncherProject.cpp index ebcabb3ffc..e7832cc99f 100644 --- a/Code/LauncherUnified/LauncherProject.cpp +++ b/Code/LauncherUnified/LauncherProject.cpp @@ -16,7 +16,7 @@ #include #endif // defined(AZ_MONOLITHIC_BUILD) -namespace LumberyardLauncher +namespace O3DELauncher { //! This file is to be added only to the ${project}.[Game|Server]Launcher build target //! This function returns the build system target name diff --git a/Code/LauncherUnified/Platform/Android/Launcher_Android.cpp b/Code/LauncherUnified/Platform/Android/Launcher_Android.cpp index 9eac3bb2b2..6455373e58 100644 --- a/Code/LauncherUnified/Platform/Android/Launcher_Android.cpp +++ b/Code/LauncherUnified/Platform/Android/Launcher_Android.cpp @@ -357,7 +357,7 @@ void android_main(android_app* appState) AZ::Android::Utils::ShowSplashScreen(); // run the Lumberyard application - using namespace LumberyardLauncher; + using namespace O3DELauncher; PlatformMainInfo mainInfo; mainInfo.m_updateResourceLimits = IncreaseResourceLimits; diff --git a/Code/LauncherUnified/Platform/Common/Apple/Launcher_Apple.h b/Code/LauncherUnified/Platform/Common/Apple/Launcher_Apple.h index 9aa7bb9945..7f2c04e687 100644 --- a/Code/LauncherUnified/Platform/Common/Apple/Launcher_Apple.h +++ b/Code/LauncherUnified/Platform/Common/Apple/Launcher_Apple.h @@ -12,7 +12,7 @@ #pragma once -namespace LumberyardLauncher +namespace O3DELauncher { const char* GetAppResourcePath(); } diff --git a/Code/LauncherUnified/Platform/Common/Apple/Launcher_Apple.mm b/Code/LauncherUnified/Platform/Common/Apple/Launcher_Apple.mm index 75d029fd4d..523871746e 100644 --- a/Code/LauncherUnified/Platform/Common/Apple/Launcher_Apple.mm +++ b/Code/LauncherUnified/Platform/Common/Apple/Launcher_Apple.mm @@ -17,7 +17,7 @@ #include -namespace LumberyardLauncher +namespace O3DELauncher { const char* GetAppResourcePath() { diff --git a/Code/LauncherUnified/Platform/Common/UnixLike/Launcher_UnixLike.cpp b/Code/LauncherUnified/Platform/Common/UnixLike/Launcher_UnixLike.cpp index 475ea050e5..5d32bbae3a 100644 --- a/Code/LauncherUnified/Platform/Common/UnixLike/Launcher_UnixLike.cpp +++ b/Code/LauncherUnified/Platform/Common/UnixLike/Launcher_UnixLike.cpp @@ -70,7 +70,7 @@ namespace } -namespace LumberyardLauncher +namespace O3DELauncher { bool IncreaseResourceLimits() { diff --git a/Code/LauncherUnified/Platform/Common/UnixLike/Launcher_UnixLike.h b/Code/LauncherUnified/Platform/Common/UnixLike/Launcher_UnixLike.h index 20df31c9b1..aa9c21adc0 100644 --- a/Code/LauncherUnified/Platform/Common/UnixLike/Launcher_UnixLike.h +++ b/Code/LauncherUnified/Platform/Common/UnixLike/Launcher_UnixLike.h @@ -13,7 +13,7 @@ #include -namespace LumberyardLauncher +namespace O3DELauncher { // Increase the core and stack limits bool IncreaseResourceLimits(); diff --git a/Code/LauncherUnified/Platform/Linux/Launcher_Linux.cpp b/Code/LauncherUnified/Platform/Linux/Launcher_Linux.cpp index 15bcad695f..0c422877b1 100644 --- a/Code/LauncherUnified/Platform/Linux/Launcher_Linux.cpp +++ b/Code/LauncherUnified/Platform/Linux/Launcher_Linux.cpp @@ -87,7 +87,7 @@ int main(int argc, char** argv) InitStackTracer(); - using namespace LumberyardLauncher; + using namespace O3DELauncher; #if !defined(AZ_MONOLITHIC_BUILD) char exePath[AZ_MAX_PATH_LEN] = { 0 }; diff --git a/Code/LauncherUnified/Platform/Mac/Launcher_Mac.mm b/Code/LauncherUnified/Platform/Mac/Launcher_Mac.mm index 4977af99d0..1a491d66ad 100644 --- a/Code/LauncherUnified/Platform/Mac/Launcher_Mac.mm +++ b/Code/LauncherUnified/Platform/Mac/Launcher_Mac.mm @@ -11,7 +11,7 @@ */ #include -#include +#include #include <../Common/Apple/Launcher_Apple.h> #include <../Common/UnixLike/Launcher_UnixLike.h> @@ -20,7 +20,7 @@ int main(int argc, char* argv[]) { // TODO: Implement for Mac - return static_cast(LumberyardLauncher::ReturnCode::ErrUnitTestNotSupported); + return static_cast(O3DELauncher::ReturnCode::ErrUnitTestNotSupported); } #else @@ -32,8 +32,8 @@ int main(int argc, char* argv[]) // Create a memory pool, a custom AppKit application, and a custom AppKit application delegate. NSAutoreleasePool* autoreleasePool = [[NSAutoreleasePool alloc] init]; - [LumberyardApplication_Mac sharedApplication]; - [NSApp setDelegate: [[LumberyardApplicationDelegate_Mac alloc] init]]; + [O3DEApplication_Mac sharedApplication]; + [NSApp setDelegate: [[O3DEApplicationDelegate_Mac alloc] init]]; // Register some default application behaviours [[NSUserDefaults standardUserDefaults] registerDefaults: @@ -46,8 +46,8 @@ int main(int argc, char* argv[]) [NSApp finishLaunching]; [autoreleasePool release]; - // run the Lumberyard application - using namespace LumberyardLauncher; + // run the Open 3D Engine application + using namespace O3DELauncher; PlatformMainInfo mainInfo; mainInfo.m_updateResourceLimits = IncreaseResourceLimits; diff --git a/Code/LauncherUnified/Platform/Mac/LumberyardApplication_Mac.mm b/Code/LauncherUnified/Platform/Mac/O3DEApplicationDelegate_Mac.mm similarity index 80% rename from Code/LauncherUnified/Platform/Mac/LumberyardApplication_Mac.mm rename to Code/LauncherUnified/Platform/Mac/O3DEApplicationDelegate_Mac.mm index f7fe2a5867..981ea33283 100644 --- a/Code/LauncherUnified/Platform/Mac/LumberyardApplication_Mac.mm +++ b/Code/LauncherUnified/Platform/Mac/O3DEApplicationDelegate_Mac.mm @@ -11,9 +11,9 @@ */ #include -#include +#include -@implementation LumberyardApplication_Mac +@implementation O3DEApplicationDelegate_Mac -@end // LumberyardApplication_Mac Implementation +@end // O3DEApplicationDelegate_Mac Implementation diff --git a/Code/LauncherUnified/Platform/Mac/LumberyardApplication_Mac.h b/Code/LauncherUnified/Platform/Mac/O3DEApplication_Mac.h similarity index 71% rename from Code/LauncherUnified/Platform/Mac/LumberyardApplication_Mac.h rename to Code/LauncherUnified/Platform/Mac/O3DEApplication_Mac.h index 99492c57cf..6dbfa032c1 100644 --- a/Code/LauncherUnified/Platform/Mac/LumberyardApplication_Mac.h +++ b/Code/LauncherUnified/Platform/Mac/O3DEApplication_Mac.h @@ -12,14 +12,14 @@ #include -@interface LumberyardApplication_Mac : NSApplication +@interface O3DEApplication_Mac : NSApplication { } -@end // LumberyardApplication_Mac Interface +@end // O3DEApplication_Mac Interface -@interface LumberyardApplicationDelegate_Mac : NSObject +@interface O3DEApplicationDelegate_Mac : NSObject { } -@end // LumberyardApplicationDelegate_Mac Interface +@end // O3DEApplicationDelegate_Mac Interface diff --git a/Code/LauncherUnified/Platform/Mac/LumberyardApplicationDelegate_Mac.mm b/Code/LauncherUnified/Platform/Mac/O3DEApplication_Mac.mm similarity index 79% rename from Code/LauncherUnified/Platform/Mac/LumberyardApplicationDelegate_Mac.mm rename to Code/LauncherUnified/Platform/Mac/O3DEApplication_Mac.mm index b671bd56a1..f202d01134 100644 --- a/Code/LauncherUnified/Platform/Mac/LumberyardApplicationDelegate_Mac.mm +++ b/Code/LauncherUnified/Platform/Mac/O3DEApplication_Mac.mm @@ -11,9 +11,9 @@ */ #include -#include +#include -@implementation LumberyardApplicationDelegate_Mac +@implementation O3DEApplication_Mac -@end // LumberyardApplicationDelegate_Mac Implementation +@end // O3DEApplication_Mac Implementation diff --git a/Code/LauncherUnified/Platform/Mac/platform_mac_files.cmake b/Code/LauncherUnified/Platform/Mac/platform_mac_files.cmake index 4da929db3b..15acfb550e 100644 --- a/Code/LauncherUnified/Platform/Mac/platform_mac_files.cmake +++ b/Code/LauncherUnified/Platform/Mac/platform_mac_files.cmake @@ -13,9 +13,9 @@ set(FILES Launcher_Mac.mm Launcher_Traits_Mac.h Launcher_Traits_Platform.h - LumberyardApplication_Mac.h - LumberyardApplication_Mac.mm - LumberyardApplicationDelegate_Mac.mm + O3DEApplication_Mac.h + O3DEApplication_Mac.mm + O3DEApplicationDelegate_Mac.mm ../Common/Apple/Launcher_Apple.mm ../Common/Apple/Launcher_Apple.h ../Common/UnixLike/Launcher_UnixLike.cpp diff --git a/Code/LauncherUnified/Platform/Windows/Launcher_Windows.cpp b/Code/LauncherUnified/Platform/Windows/Launcher_Windows.cpp index a9556d4490..b7f04a7e10 100644 --- a/Code/LauncherUnified/Platform/Windows/Launcher_Windows.cpp +++ b/Code/LauncherUnified/Platform/Windows/Launcher_Windows.cpp @@ -17,7 +17,7 @@ int APIENTRY WinMain([[maybe_unused]] HINSTANCE hInstance, [[maybe_unused]] HINS { InitRootDir(); - using namespace LumberyardLauncher; + using namespace O3DELauncher; PlatformMainInfo mainInfo; diff --git a/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake b/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake index fe5183e2f5..93a839ae47 100644 --- a/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake +++ b/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake @@ -29,7 +29,7 @@ endif() if(EXISTS ${ICON_FILE}) set(target_file ${CMAKE_CURRENT_BINARY_DIR}/${project_name}.GameLauncher.rc) - configure_file(Platform/Windows/Launcher.rc.in + configure_file(${CMAKE_CURRENT_LIST_DIR}/Launcher.rc.in ${target_file} @ONLY ) diff --git a/Code/LauncherUnified/Platform/iOS/Launcher_iOS.mm b/Code/LauncherUnified/Platform/iOS/Launcher_iOS.mm index 2531f616a9..52c616fe64 100644 --- a/Code/LauncherUnified/Platform/iOS/Launcher_iOS.mm +++ b/Code/LauncherUnified/Platform/iOS/Launcher_iOS.mm @@ -18,8 +18,8 @@ int main(int argc, char* argv[]) NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; UIApplicationMain(argc, argv, - @"LumberyardApplication_iOS", - @"LumberyardApplicationDelegate_iOS"); + @"O3DEApplication_iOS", + @"O3DEApplicationDelegate_iOS"); [pool release]; return 0; } diff --git a/Code/LauncherUnified/Server.cpp b/Code/LauncherUnified/Server.cpp index 842356d2f4..207cf697a4 100644 --- a/Code/LauncherUnified/Server.cpp +++ b/Code/LauncherUnified/Server.cpp @@ -12,7 +12,7 @@ #include -namespace LumberyardLauncher +namespace O3DELauncher { bool WaitForAssetProcessorConnect() { diff --git a/Code/LauncherUnified/Tests/LauncherUnifiedTests.cpp b/Code/LauncherUnified/Tests/LauncherUnifiedTests.cpp index 204c12fcf5..35ea6b486d 100644 --- a/Code/LauncherUnified/Tests/LauncherUnifiedTests.cpp +++ b/Code/LauncherUnified/Tests/LauncherUnifiedTests.cpp @@ -26,7 +26,7 @@ protected: TEST_F(UnifiedLauncherTestFixture, PlatformMainInfoAddArgument_NoCommandLineFunctions_Success) { - LumberyardLauncher::PlatformMainInfo test; + O3DELauncher::PlatformMainInfo test; EXPECT_STREQ(test.m_commandLine, ""); EXPECT_EQ(test.m_argC, 0); @@ -34,7 +34,7 @@ TEST_F(UnifiedLauncherTestFixture, PlatformMainInfoAddArgument_NoCommandLineFunc TEST_F(UnifiedLauncherTestFixture, PlatformMainInfoAddArgument_ValidParams_Success) { - LumberyardLauncher::PlatformMainInfo test; + O3DELauncher::PlatformMainInfo test; const char* testArguments[] = { "-arg", "value1", "-arg2", "value2", "-argspace", "value one"}; for (const char* testArgument : testArguments) @@ -55,7 +55,7 @@ TEST_F(UnifiedLauncherTestFixture, PlatformMainInfoAddArgument_ValidParams_Succe TEST_F(UnifiedLauncherTestFixture, PlatformMainInfoCopyCommandLineArgCArgV_ValidParams_Success) { - LumberyardLauncher::PlatformMainInfo test; + O3DELauncher::PlatformMainInfo test; const char* constTestArguments[] = { "-arg", "value1", "-arg2", "value2", "-argspace", "value one" }; char** testArguments = const_cast(constTestArguments); diff --git a/Code/LauncherUnified/Tests/Test.cpp b/Code/LauncherUnified/Tests/Test.cpp index 86b13250a4..07529b2b0b 100644 --- a/Code/LauncherUnified/Tests/Test.cpp +++ b/Code/LauncherUnified/Tests/Test.cpp @@ -12,7 +12,7 @@ #include -namespace LumberyardLauncher +namespace O3DELauncher { bool WaitForAssetProcessorConnect() { diff --git a/Code/LauncherUnified/launcher_generator.cmake b/Code/LauncherUnified/launcher_generator.cmake new file mode 100644 index 0000000000..b9abfe13b5 --- /dev/null +++ b/Code/LauncherUnified/launcher_generator.cmake @@ -0,0 +1,190 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +# Launcher targets for a project need to be generated when configuring a project. +# When building the engine source, this file will be included by LauncherUnified's CMakeLists.txt +# When using an installed engine, this file will be included by the FindLauncherGenerator.cmake script +get_property(LY_PROJECTS_TARGET_NAME GLOBAL PROPERTY LY_PROJECTS_TARGET_NAME) +foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJECTS) + # Computes the realpath to the project + # If the project_path is relative, it is evaluated relative to the ${LY_ROOT_FOLDER} + # Otherwise the the absolute project_path is returned with symlinks resolved + file(REAL_PATH ${project_path} project_real_path BASE_DIRECTORY ${LY_ROOT_FOLDER}) + ################################################################################ + # Monolithic game + ################################################################################ + if(LY_MONOLITHIC_GAME) + + # In the monolithic case, we need to register the gem modules, to do so we will generate a StaticModules.inl + # file from StaticModules.in + + get_property(game_gem_dependencies GLOBAL PROPERTY LY_DELAYED_DEPENDENCIES_${project_name}.GameLauncher) + + unset(extern_module_declarations) + unset(module_invocations) + + foreach(game_gem_dependency ${game_gem_dependencies}) + # To match the convention on how gems targets vs gem modules are named, we remove the "Gem::" from prefix + # and remove the ".Static" from the suffix + string(REGEX REPLACE "^Gem::" "Gem_" game_gem_dependency ${game_gem_dependency}) + string(REGEX REPLACE "^Project::" "Project_" game_gem_dependency ${game_gem_dependency}) + # Replace "." with "_" + string(REPLACE "." "_" game_gem_dependency ${game_gem_dependency}) + + string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_${game_gem_dependency}();\n") + string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_${game_gem_dependency}());\n") + + endforeach() + + configure_file(StaticModules.in + ${CMAKE_CURRENT_BINARY_DIR}/${project_name}.GameLauncher/Includes/StaticModules.inl + ) + + set(game_build_dependencies + ${game_gem_dependencies} + Legacy::CrySystem + Legacy::CryFont + Legacy::Cry3DEngine + ) + + if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) + get_property(server_gem_dependencies GLOBAL PROPERTY LY_DELAYED_DEPENDENCIES_${project_name}.ServerLauncher) + + unset(extern_module_declarations) + unset(module_invocations) + + foreach(server_gem_dependency ${server_gem_dependencies}) + # To match the convention on how gems targets vs gem modules are named, we remove the "Gem::" from prefix + # and remove the ".Static" from the suffix + string(REGEX REPLACE "^Gem::" "Gem_" server_gem_dependency ${server_gem_dependency}) + string(REGEX REPLACE "^Project::" "Project_" server_gem_dependency ${server_gem_dependency}) + # Replace "." with "_" + string(REPLACE "." "_" server_gem_dependency ${server_gem_dependency}) + + string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_${server_gem_dependency}();\n") + string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_${server_gem_dependency}());\n") + + endforeach() + + configure_file(StaticModules.in + ${CMAKE_CURRENT_BINARY_DIR}/${project_name}.ServerLauncher/Includes/StaticModules.inl + ) + + set(server_build_dependencies + ${game_gem_dependencies} + Legacy::CrySystem + Legacy::CryFont + Legacy::Cry3DEngine + ) + endif() + + else() + + set(game_runtime_dependencies + Legacy::CrySystem + Legacy::CryFont + Legacy::Cry3DEngine + ) + if(PAL_TRAIT_BUILD_SERVER_SUPPORTED AND NOT LY_MONOLITHIC_GAME) # Only Atom is supported in monolithic builds + set(server_runtime_dependencies + Legacy::CryRenderNULL + ) + endif() + + endif() + + ################################################################################ + # Game + ################################################################################ + ly_add_target( + NAME ${project_name}.GameLauncher ${PAL_TRAIT_LAUNCHERUNIFIED_LAUNCHER_TYPE} + NAMESPACE AZ + FILES_CMAKE + ${CMAKE_CURRENT_LIST_DIR}/launcher_project_files.cmake + PLATFORM_INCLUDE_FILES + ${pal_dir}/launcher_project_${PAL_PLATFORM_NAME_LOWERCASE}.cmake + COMPILE_DEFINITIONS + PRIVATE + # Adds the name of the project/game + LY_PROJECT_NAME="${project_name}" + # Adds the project path supplied to CMake during configuration + # This is used as a fallback to launch the AssetProcessor + LY_PROJECT_CMAKE_PATH="${project_path}" + # Adds the ${project_name}_GameLauncher target as a define so for the Settings Registry to use + # when loading .setreg file specializations + # This is needed so that only gems for the project game launcher are loaded + LY_CMAKE_TARGET="${project_name}_GameLauncher" + INCLUDE_DIRECTORIES + PRIVATE + . + ${CMAKE_CURRENT_BINARY_DIR}/${project_name}.GameLauncher/Includes # required for StaticModules.inl + BUILD_DEPENDENCIES + PRIVATE + AZ::Launcher.Static + AZ::Launcher.Game.Static + ${game_build_dependencies} + RUNTIME_DEPENDENCIES + ${game_runtime_dependencies} + ) + # Needs to be set manually after ly_add_target to prevent the default location overriding it + set_target_properties(${project_name}.GameLauncher + PROPERTIES + FOLDER ${project_name} + ) + + ################################################################################ + # Server + ################################################################################ + if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) + + get_property(server_projects GLOBAL PROPERTY LY_LAUNCHER_SERVER_PROJECTS) + if(${project_name} IN_LIST server_projects) + + ly_add_target( + NAME ${project_name}.ServerLauncher APPLICATION + NAMESPACE AZ + FILES_CMAKE + ${CMAKE_CURRENT_LIST_DIR}/launcher_project_files.cmake + PLATFORM_INCLUDE_FILES + ${pal_dir}/launcher_project_${PAL_PLATFORM_NAME_LOWERCASE}.cmake + COMPILE_DEFINITIONS + PRIVATE + # Adds the name of the project/game + LY_PROJECT_NAME="${project_name}" + # Adds the project path supplied to CMake during configuration + # This is used as a fallback to launch the AssetProcessor + LY_PROJECT_CMAKE_PATH="${project_path}" + # Adds the ${project_name}_ServerLauncher target as a define so for the Settings Registry to use + # when loading .setreg file specializations + # This is needed so that only gems for the project server launcher are loaded + LY_CMAKE_TARGET="${project_name}_ServerLauncher" + INCLUDE_DIRECTORIES + PRIVATE + . + ${CMAKE_CURRENT_BINARY_DIR}/${project_name}.ServerLauncher/Includes # required for StaticModules.inl + BUILD_DEPENDENCIES + PRIVATE + AZ::Launcher.Static + AZ::Launcher.Server.Static + ${server_build_dependencies} + RUNTIME_DEPENDENCIES + ${server_runtime_dependencies} + ) + # Needs to be set manually after ly_add_target to prevent the default location overriding it + set_target_properties(${project_name}.ServerLauncher + PROPERTIES + FOLDER ${project_name} + ) + endif() + + endif() + +endforeach() \ No newline at end of file diff --git a/Code/Sandbox/Editor/AboutDialog.cpp b/Code/Sandbox/Editor/AboutDialog.cpp index ac77eaed07..e1cd4c7bb0 100644 --- a/Code/Sandbox/Editor/AboutDialog.cpp +++ b/Code/Sandbox/Editor/AboutDialog.cpp @@ -55,7 +55,7 @@ CAboutDialog::CAboutDialog(QString versionText, QString richTextCopyrightNotice, QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_1_27.png")); m_backgroundImage = QPixmap::fromImage(backgroundImage.scaled(m_enforcedWidth, m_enforcedHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - // Draw the Lumberyard logo from svg + // Draw the Open 3D Engine logo from svg m_ui->m_logo->load(QStringLiteral(":/StartupLogoDialog/lumberyard_logo.svg")); // Prevent re-sizing diff --git a/Code/Sandbox/Editor/AboutDialog.ui b/Code/Sandbox/Editor/AboutDialog.ui index 9a92770c52..0eb2881600 100644 --- a/Code/Sandbox/Editor/AboutDialog.ui +++ b/Code/Sandbox/Editor/AboutDialog.ui @@ -29,7 +29,7 @@ - About Lumberyard Editor + About Open 3D Engine Editor background-color: transparent @@ -92,7 +92,7 @@ - Lumberyard Editor + Open 3D Engine Editor Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop diff --git a/Code/Sandbox/Editor/Alembic/AlembicCompiler.cpp b/Code/Sandbox/Editor/Alembic/AlembicCompiler.cpp index 98013b0bb7..1fd5c1bca8 100644 --- a/Code/Sandbox/Editor/Alembic/AlembicCompiler.cpp +++ b/Code/Sandbox/Editor/Alembic/AlembicCompiler.cpp @@ -153,6 +153,6 @@ void CAlembicCompiler::AddSourceFileOpeners(const char* fullSourceFileName, [[ma } }; - openers.push_back({ "Lumberyard_AlembicCompiler", "Open In Alembic Compiler...", QIcon(), alembicCallback }); + openers.push_back({ "O3DE_AlembicCompiler", "Open In Alembic Compiler...", QIcon(), alembicCallback }); } } diff --git a/Code/Sandbox/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp b/Code/Sandbox/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp index 4a21ae5833..0c99e63c47 100644 --- a/Code/Sandbox/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp +++ b/Code/Sandbox/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp @@ -283,7 +283,7 @@ void AzAssetBrowserRequestHandler::AddContextMenuActions(QWidget* caller, QMenu* // Add the "Open" menu item. // Note that source file openers are allowed to "veto" the showing of the "Open" menu if it is 100% known that they aren't openable! - // for example, custom data formats that are made by Lumberyard that can not have a program associated in the operating system to view them. + // for example, custom data formats that are made by Open 3D Engine that can not have a program associated in the operating system to view them. // If the only opener that can open that file has no m_opener, then it is not openable. SourceFileOpenerList openers; AssetBrowserInteractionNotificationBus::Broadcast(&AssetBrowserInteractionNotificationBus::Events::AddSourceFileOpeners, fullFilePath.c_str(), sourceID, openers); @@ -553,11 +553,11 @@ void AzAssetBrowserRequestHandler::AddSourceFileOpeners(const char* fullSourceFi if (AZStd::wildcard_match("*.lua", fullSourceFileName)) { AZStd::string fullName(fullSourceFileName); - // LUA files can be opened with the lumberyard LUA editor. + // LUA files can be opened with the O3DE LUA editor. openers.push_back( { - "Lumberyard_LUA_Editor", - "Open in Lumberyard LUA Editor...", + "O3DE_LUA_Editor", + "Open in Open 3D Engine LUA Editor...", QIcon(), [](const char* fullSourceFileNameInCallback, const AZ::Uuid& /*sourceUUID*/) { diff --git a/Code/Sandbox/Editor/CMakeLists.txt b/Code/Sandbox/Editor/CMakeLists.txt index 1e623c4144..726f7ac2c7 100644 --- a/Code/Sandbox/Editor/CMakeLists.txt +++ b/Code/Sandbox/Editor/CMakeLists.txt @@ -135,7 +135,7 @@ ly_add_source_properties( SOURCES CryEdit.cpp PROPERTY COMPILE_DEFINITIONS VALUES - LUMBERYARD_COPYRIGHT_YEAR=${LY_VERSION_COPYRIGHT_YEAR} + O3DE_COPYRIGHT_YEAR=${LY_VERSION_COPYRIGHT_YEAR} LY_BUILD=${LY_VERSION_BUILD_NUMBER} ${LY_PAL_TOOLS_DEFINES} ) diff --git a/Code/Sandbox/Editor/Controls/ColorGradientCtrl.cpp b/Code/Sandbox/Editor/Controls/ColorGradientCtrl.cpp index 17675bd072..edbf20531b 100644 --- a/Code/Sandbox/Editor/Controls/ColorGradientCtrl.cpp +++ b/Code/Sandbox/Editor/Controls/ColorGradientCtrl.cpp @@ -137,10 +137,6 @@ void CColorGradientCtrl::PointToTimeValue(QPoint point, float& time, ISplineInte float CColorGradientCtrl::XOfsToTime(int x) { return m_grid.ClientToWorld(QPoint(x, 0)).x; - - // m_fMinTime to m_fMaxTime time range. - float time = m_fMinTime + (float)((m_fMaxTime - m_fMinTime) * (x - m_rcGradient.left())) / m_rcGradient.width(); - return time; } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Sandbox/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp b/Code/Sandbox/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp index cfca9cd19f..92610021b9 100644 --- a/Code/Sandbox/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp +++ b/Code/Sandbox/Editor/Controls/ReflectedPropertyControl/ReflectedPropertyCtrl.cpp @@ -672,7 +672,6 @@ CReflectedVar * ReflectedPropertyControl::GetReflectedVarFromCallbackInstance(Az return reinterpret_cast(pNode->GetInstance(0)); else return GetReflectedVarFromCallbackInstance(pNode->GetParent()); - return nullptr; } diff --git a/Code/Sandbox/Editor/Core/LevelEditorMenuHandler.cpp b/Code/Sandbox/Editor/Core/LevelEditorMenuHandler.cpp index 91d0d0acef..1c9e7d90d2 100644 --- a/Code/Sandbox/Editor/Core/LevelEditorMenuHandler.cpp +++ b/Code/Sandbox/Editor/Core/LevelEditorMenuHandler.cpp @@ -918,15 +918,15 @@ QMenu* LevelEditorMenuHandler::CreateHelpMenu() QUrl docSearchUrl("https://docs.aws.amazon.com/search/doc-search.html"); QUrlQuery docSearchQuery; - QString lumberyardProductString = QUrl::toPercentEncoding("Amazon Lumberyard"); + QString o3deProductString = QUrl::toPercentEncoding("Open 3D Engine"); // The order of these QueryItems matters. wiki Search URL Formatting docSearchQuery.addQueryItem("searchPath", "documentation-product"); docSearchQuery.addQueryItem("searchQuery", text); - docSearchQuery.addQueryItem("this_doc_product", lumberyardProductString); + docSearchQuery.addQueryItem("this_doc_product", o3deProductString); docSearchQuery.addQueryItem("ref", "lye"); docSearchQuery.addQueryItem("ev", productVersionString); docSearchUrl.setQuery(docSearchQuery); - docSearchUrl.setFragment(QString("facet_doc_product=%1").arg(lumberyardProductString)); + docSearchUrl.setFragment(QString("facet_doc_product=%1").arg(o3deProductString)); QDesktopServices::openUrl(docSearchUrl); } lineEdit->clear(); @@ -948,8 +948,8 @@ QMenu* LevelEditorMenuHandler::CreateHelpMenu() // Glossary documentationMenu.AddAction(ID_DOCUMENTATION_GLOSSARY); - // Lumberyard Documentation - documentationMenu.AddAction(ID_DOCUMENTATION_LUMBERYARD); + // Open 3D Engine Documentation + documentationMenu.AddAction(ID_DOCUMENTATION_O3DE); // GameLift Documentation documentationMenu.AddAction(ID_DOCUMENTATION_GAMELIFT); @@ -980,7 +980,7 @@ QMenu* LevelEditorMenuHandler::CreateHelpMenu() // Report a Bug??? // auto reportBugMenu = helpMenu.Get()->addAction(tr("Report a Bug")); - // About Lumberyard + // About Open 3D Engine helpMenu.AddAction(ID_APP_ABOUT); // Welcome dialog diff --git a/Code/Sandbox/Editor/Core/QtEditorApplication.cpp b/Code/Sandbox/Editor/Core/QtEditorApplication.cpp index fa5c982fc8..7086990643 100644 --- a/Code/Sandbox/Editor/Core/QtEditorApplication.cpp +++ b/Code/Sandbox/Editor/Core/QtEditorApplication.cpp @@ -35,7 +35,7 @@ // AzQtComponents #include -#include +#include #include #include @@ -53,7 +53,7 @@ enum UninitializedFrequency = 9999, }; -Q_LOGGING_CATEGORY(InputDebugging, "lumberyard.editor.input") +Q_LOGGING_CATEGORY(InputDebugging, "o3de.editor.input") // internal, private namespace: namespace @@ -249,17 +249,17 @@ namespace Editor EditorQtApplication::EditorQtApplication(int& argc, char** argv) : QApplication(argc, argv) , m_inWinEventFilter(false) - , m_stylesheet(new AzQtComponents::LumberyardStylesheet(this)) + , m_stylesheet(new AzQtComponents::O3DEStylesheet(this)) , m_idleTimer(new QTimer(this)) { m_idleTimer->setInterval(UninitializedFrequency); - setWindowIcon(QIcon(":/Application/res/lyeditor.ico")); + setWindowIcon(QIcon(":/Application/res/o3de_editor.ico")); // set the default key store for our preferences: setOrganizationName("Amazon"); setOrganizationDomain("amazon.com"); - setApplicationName("Lumberyard"); + setApplicationName("Open 3D Engine"); connect(m_idleTimer, &QTimer::timeout, this, &EditorQtApplication::maybeProcessIdle); @@ -267,7 +267,7 @@ namespace Editor installEventFilter(this); // Disable our debugging input helpers by default - QLoggingCategory::setFilterRules(QStringLiteral("lumberyard.editor.input.*=false")); + QLoggingCategory::setFilterRules(QStringLiteral("o3de.editor.input.*=false")); // Initialize our stylesheet here to allow Gems to register stylesheets when their system components activate. AZ::IO::FixedMaxPath engineRootPath; diff --git a/Code/Sandbox/Editor/Core/QtEditorApplication.h b/Code/Sandbox/Editor/Core/QtEditorApplication.h index 37947bf777..8aa0dca038 100644 --- a/Code/Sandbox/Editor/Core/QtEditorApplication.h +++ b/Code/Sandbox/Editor/Core/QtEditorApplication.h @@ -32,7 +32,7 @@ class QByteArray; namespace AzQtComponents { - class LumberyardStylesheet; + class O3DEStylesheet; } enum EEditorNotifyEvent; @@ -118,7 +118,7 @@ namespace Editor void UninstallFilters(); void maybeProcessIdle(); - AzQtComponents::LumberyardStylesheet* m_stylesheet; + AzQtComponents::O3DEStylesheet* m_stylesheet; bool m_inWinEventFilter = false; diff --git a/Code/Sandbox/Editor/CryEdit.cpp b/Code/Sandbox/Editor/CryEdit.cpp index ee8dc989b4..6f311fe9ac 100644 --- a/Code/Sandbox/Editor/CryEdit.cpp +++ b/Code/Sandbox/Editor/CryEdit.cpp @@ -187,8 +187,8 @@ AZ_POP_DISABLE_WARNING #include -static const char lumberyardEditorClassName[] = "LumberyardEditorClass"; -static const char lumberyardApplicationName[] = "LumberyardApplication"; +static const char O3DEEditorClassName[] = "O3DEEditorClass"; +static const char O3DEApplicationName[] = "O3DEApplication"; static AZ::EnvironmentVariable inEditorBatchMode = nullptr; @@ -378,7 +378,7 @@ void CCryEditApp::RegisterActionHandlers() ON_COMMAND(ID_DOCUMENTATION_GETTINGSTARTEDGUIDE, OnDocumentationGettingStartedGuide) ON_COMMAND(ID_DOCUMENTATION_TUTORIALS, OnDocumentationTutorials) ON_COMMAND(ID_DOCUMENTATION_GLOSSARY, OnDocumentationGlossary) - ON_COMMAND(ID_DOCUMENTATION_LUMBERYARD, OnDocumentationLumberyard) + ON_COMMAND(ID_DOCUMENTATION_O3DE, OnDocumentationO3DE) ON_COMMAND(ID_DOCUMENTATION_GAMELIFT, OnDocumentationGamelift) ON_COMMAND(ID_DOCUMENTATION_RELEASENOTES, OnDocumentationReleaseNotes) ON_COMMAND(ID_DOCUMENTATION_GAMEDEVBLOG, OnDocumentationGameDevBlog) @@ -639,7 +639,7 @@ public: QString appRootOverride; parser.addHelpOption(); parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions); - parser.setApplicationDescription(QObject::tr("Amazon Lumberyard")); + parser.setApplicationDescription(QObject::tr("Open 3D Engine")); // nsDocumentRevisionDebugMode is an argument that the macOS system passed into an App bundle that is being debugged. // Need to include it here so that Qt argument parser does not error out. bool nsDocumentRevisionsDebugMode = false; @@ -758,13 +758,13 @@ struct SharedData // article Q141752 to locate the previous instance of the application. . BOOL CCryEditApp::FirstInstance(bool bForceNewInstance) { - QSystemSemaphore sem(QString(lumberyardApplicationName) + "_sem", 1); + QSystemSemaphore sem(QString(O3DEApplicationName) + "_sem", 1); sem.acquire(); { - FixDanglingSharedMemory(lumberyardEditorClassName); + FixDanglingSharedMemory(O3DEEditorClassName); } sem.release(); - m_mutexApplication = new QSharedMemory(lumberyardEditorClassName); + m_mutexApplication = new QSharedMemory(O3DEEditorClassName); if (!m_mutexApplication->create(sizeof(SharedData)) && !bForceNewInstance) { m_mutexApplication->attach(); @@ -789,7 +789,7 @@ BOOL CCryEditApp::FirstInstance(bool bForceNewInstance) sem.release(); QTimer* t = new QTimer(this); connect(t, &QTimer::timeout, this, [this]() { - QSystemSemaphore sem(QString(lumberyardApplicationName) + "_sem", 1); + QSystemSemaphore sem(QString(O3DEApplicationName) + "_sem", 1); sem.acquire(); SharedData* data = reinterpret_cast(m_mutexApplication->data()); QString preview = QString::fromLatin1(data->text); @@ -1018,9 +1018,9 @@ QString FormatRichTextCopyrightNotice() { // copyright symbol is HTML Entity = © QString copyrightHtmlSymbol = "©"; - QString copyrightString = QObject::tr("Lumberyard and related materials Copyright %1 %2 Amazon Web Services, Inc., its affiliates or licensors.
By accessing or using these materials, you agree to the terms of the AWS Customer Agreement."); + QString copyrightString = QObject::tr("Open 3D Engine and related materials Copyright %1 %2 Amazon Web Services, Inc., its affiliates or licensors.
By accessing or using these materials, you agree to the terms of the AWS Customer Agreement."); - return copyrightString.arg(copyrightHtmlSymbol).arg(LUMBERYARD_COPYRIGHT_YEAR); + return copyrightString.arg(copyrightHtmlSymbol).arg(O3DE_COPYRIGHT_YEAR); } ///////////////////////////////////////////////////////////////////////////// @@ -1180,8 +1180,8 @@ BOOL CCryEditApp::CheckIfAlreadyRunning() if (!m_bPreviewMode) { - FixDanglingSharedMemory(lumberyardApplicationName); - m_mutexApplication = new QSharedMemory(lumberyardApplicationName); + FixDanglingSharedMemory(O3DEApplicationName); + m_mutexApplication = new QSharedMemory(O3DEApplicationName); if (!m_mutexApplication->create(16)) { // Don't prompt the user in non-interactive export mode. Instead, default to allowing multiple instances to @@ -1189,7 +1189,7 @@ BOOL CCryEditApp::CheckIfAlreadyRunning() // NOTE: If you choose to do this, be sure to export *different* levels, since nothing prevents multiple runs // from trying to write to the same level at the same time. // If we're running interactively, let's ask and make sure the user actually intended to do this. - if (!m_bExportMode && QMessageBox::question(AzToolsFramework::GetActiveWindow(), QObject::tr("Too many apps"), QObject::tr("There is already a Lumberyard application running\nDo you want to start another one?")) != QMessageBox::Yes) + if (!m_bExportMode && QMessageBox::question(AzToolsFramework::GetActiveWindow(), QObject::tr("Too many apps"), QObject::tr("There is already an Open 3D Engine application running\nDo you want to start another one?")) != QMessageBox::Yes) { return false; } @@ -1798,7 +1798,7 @@ BOOL CCryEditApp::InitInstance() GetIEditor()->GetCommandManager()->RegisterAutoCommands(); GetIEditor()->AddUIEnums(); - mainWindowWrapper->enableSaveRestoreGeometry("amazon", "lumberyard", "mainWindowGeometry"); + mainWindowWrapper->enableSaveRestoreGeometry("amazon", "O3DE", "mainWindowGeometry"); m_pDocManager->OnFileNew(); if (IsInRegularEditorMode()) @@ -2090,7 +2090,7 @@ void CCryEditApp::OnAppAbout() aboutDlg.exec(); } -// App command to run the Welcome to Lumberyard dialog +// App command to run the Welcome to Open 3D Engine dialog void CCryEditApp::OnAppShowWelcomeScreen() { // This logic is a simplified version of the startup @@ -2182,7 +2182,7 @@ void CCryEditApp::OnDocumentationGlossary() QDesktopServices::openUrl(QUrl(webLink)); } -void CCryEditApp::OnDocumentationLumberyard() +void CCryEditApp::OnDocumentationO3DE() { QString webLink = tr("https://docs.aws.amazon.com/lumberyard/userguide"); QDesktopServices::openUrl(QUrl(webLink)); @@ -5399,7 +5399,7 @@ void CCryEditApp::SetEditorWindowTitle(QString sTitleStr, QString sPreTitleStr, if (sTitleStr.isEmpty()) { - sTitleStr = QObject::tr("Lumberyard Editor Beta %1 - Build %2").arg(platform).arg(LY_BUILD); + sTitleStr = QObject::tr("Open 3D Engine Editor Beta %1 - Build %2").arg(platform).arg(LY_BUILD); } if (!sPreTitleStr.isEmpty()) diff --git a/Code/Sandbox/Editor/CryEdit.h b/Code/Sandbox/Editor/CryEdit.h index 2ec5010df4..7480b34e5a 100644 --- a/Code/Sandbox/Editor/CryEdit.h +++ b/Code/Sandbox/Editor/CryEdit.h @@ -196,7 +196,7 @@ public: void OnUpdateShowWelcomeScreen(QAction* action); void OnDocumentationTutorials(); void OnDocumentationGlossary(); - void OnDocumentationLumberyard(); + void OnDocumentationO3DE(); void OnDocumentationGamelift(); void OnDocumentationReleaseNotes(); void OnDocumentationGameDevBlog(); diff --git a/Code/Sandbox/Editor/DatabaseFrameWnd.cpp b/Code/Sandbox/Editor/DatabaseFrameWnd.cpp index e8936c9337..89843c8247 100644 --- a/Code/Sandbox/Editor/DatabaseFrameWnd.cpp +++ b/Code/Sandbox/Editor/DatabaseFrameWnd.cpp @@ -1336,7 +1336,7 @@ bool LibraryItemTreeModel::DoesGroupExist([[maybe_unused]] const QString& groupN QStringList LibraryItemTreeModel::mimeTypes() const { QStringList mimeTypes; - mimeTypes << QStringLiteral("application/x-lumberyard-libraryitems"); + mimeTypes << QStringLiteral("application/x-o3de-libraryitems"); return mimeTypes; } @@ -1412,9 +1412,9 @@ bool LibraryItemTreeModel::MoveItem(CBaseLibraryItem* item, const QModelIndex& t bool LibraryItemTreeModel::dropMimeData(const QMimeData* data, [[maybe_unused]] Qt::DropAction action, [[maybe_unused]] int row, [[maybe_unused]] int column, const QModelIndex& index) { - if (data->hasFormat("application/x-lumberyard-libraryitems")) + if (data->hasFormat("application/x-o3de-libraryitems")) { - QByteArray array = data->data("application/x-lumberyard-libraryitems"); + QByteArray array = data->data("application/x-o3de-libraryitems"); QModelIndex targetParent = index; @@ -1474,7 +1474,7 @@ QMimeData* LibraryItemTreeModel::mimeData(const QModelIndexList& indexes) const } QMimeData* data = new QMimeData; - data->setData(QStringLiteral("application/x-lumberyard-libraryitems"), array); + data->setData(QStringLiteral("application/x-o3de-libraryitems"), array); return data; } diff --git a/Code/Sandbox/Editor/EditorCryEdit.rc b/Code/Sandbox/Editor/EditorCryEdit.rc index ce178d32ce..76d5d53476 100644 --- a/Code/Sandbox/Editor/EditorCryEdit.rc +++ b/Code/Sandbox/Editor/EditorCryEdit.rc @@ -1 +1 @@ -IDI_ICON1 ICON DISCARDABLE "res\\lyeditor.ico" \ No newline at end of file +IDI_ICON1 ICON DISCARDABLE "res\\o3de_editor.ico" \ No newline at end of file diff --git a/Code/Sandbox/Editor/EditorPanelUtils.cpp b/Code/Sandbox/Editor/EditorPanelUtils.cpp index 9757aeef70..06c7056a47 100644 --- a/Code/Sandbox/Editor/EditorPanelUtils.cpp +++ b/Code/Sandbox/Editor/EditorPanelUtils.cpp @@ -242,7 +242,7 @@ public: virtual bool HotKey_LoadExisting() override { - QSettings settings("Amazon", "Lumberyard"); + QSettings settings("Amazon", "O3DE"); QString group = "Hotkeys/"; HotKey_BuildDefaults(); @@ -278,7 +278,7 @@ public: virtual void HotKey_SaveCurrent() override { - QSettings settings("Amazon", "Lumberyard"); + QSettings settings("Amazon", "O3DE"); QString group = "Hotkeys/"; settings.remove("Hotkeys/"); settings.sync(); diff --git a/Code/Sandbox/Editor/EditorPreferencesPageGeneral.cpp b/Code/Sandbox/Editor/EditorPreferencesPageGeneral.cpp index 4f960d5b74..b10d564031 100644 --- a/Code/Sandbox/Editor/EditorPreferencesPageGeneral.cpp +++ b/Code/Sandbox/Editor/EditorPreferencesPageGeneral.cpp @@ -101,10 +101,10 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize) ->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_stylusMode, "Stylus Mode", "Stylus Mode for tablets and other pointing devices") ->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_restoreViewportCamera, EditorPreferencesGeneralRestoreViewportCameraSettingName, "Keep the original editor viewport transform when exiting game mode.") ->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_enableSceneInspector, "Enable Scene Inspector (EXPERIMENTAL)", "Enable the option to inspect the internal data loaded from scene files like .fbx. This is an experimental feature. Restart the Scene Settings if the option is not visible under the Help menu.") - ->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_enablePrefabSystem, "Enable Prefab System (EXPERIMENTAL)", "Enable this option to preview Lumberyard's new prefab system. Enabling this setting removes slice support for level entities; you will need to restart the Editor for the change to take effect."); + ->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_enablePrefabSystem, "Enable Prefab System (EXPERIMENTAL)", "Enable this option to preview Open 3D Engine's new prefab system. Enabling this setting removes slice support for level entities; you will need to restart the Editor for the change to take effect."); editContext->Class("Messaging", "") - ->DataElement(AZ::Edit::UIHandlers::CheckBox, &Messaging::m_showDashboard, "Show Welcome to Lumberyard at startup", "Show Welcome to Lumberyard at startup") + ->DataElement(AZ::Edit::UIHandlers::CheckBox, &Messaging::m_showDashboard, "Show Welcome to Open 3D Engine at startup", "Show Welcome to Open 3D Engine at startup") ->DataElement(AZ::Edit::UIHandlers::CheckBox, &Messaging::m_showCircularDependencyError, "Show Error: Circular dependency", "Show an error message when adding a slice instance to the target slice would create a cyclic asset dependency. All other valid overrides will be saved even if this is turned off."); editContext->Class("Undo", "") diff --git a/Code/Sandbox/Editor/FeedbackDialog/FeedbackDialog.cpp b/Code/Sandbox/Editor/FeedbackDialog/FeedbackDialog.cpp index 90a0c55ca3..34206ba89c 100644 --- a/Code/Sandbox/Editor/FeedbackDialog/FeedbackDialog.cpp +++ b/Code/Sandbox/Editor/FeedbackDialog/FeedbackDialog.cpp @@ -21,10 +21,10 @@ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING namespace { QString feedbackText = "

We love getting feedback from our customers.

" - "Feedback from our community helps us to constantly improve Lumberyard.

" + "Feedback from our community helps us to constantly improve Open 3D Engine.

" "In addition to using our forums and AWS support channels, you can always email us with your comments and suggestions at " - "lumberyard-feedback@amazon.com. " - "While we do not respond to everyone who submits feedback, we read everything and aspire to use your feedback to improve Lumberyard for everyone."; + "o3de-feedback@amazon.com. " + "While we do not respond to everyone who submits feedback, we read everything and aspire to use your feedback to improve Open 3D Engine for everyone."; } diff --git a/Code/Sandbox/Editor/GraphicsSettingsDialog.cpp b/Code/Sandbox/Editor/GraphicsSettingsDialog.cpp index a4e404bcfb..516e723d6b 100644 --- a/Code/Sandbox/Editor/GraphicsSettingsDialog.cpp +++ b/Code/Sandbox/Editor/GraphicsSettingsDialog.cpp @@ -151,7 +151,7 @@ GraphicsSettingsDialog::GraphicsSettingsDialog(QWidget* parent /* = nullptr */) m_ui->m_platformEntry->addItem(platform); } - QSettings settings("Amazon", "Lumberyard"); + QSettings settings("Amazon", "O3DE"); settings.beginGroup("GraphicsSettingsDialog"); if (settings.contains("Platform")) @@ -179,7 +179,7 @@ GraphicsSettingsDialog::GraphicsSettingsDialog(QWidget* parent /* = nullptr */) GraphicsSettingsDialog::~GraphicsSettingsDialog() { - QSettings settings("Amazon", "Lumberyard"); + QSettings settings("Amazon", "O3DE"); settings.beginGroup("GraphicsSettingsDialog"); auto platformCheck = [this](AZStd::pair& stringConfigPair) { return stringConfigPair.second == m_currentPlatform; }; @@ -561,7 +561,7 @@ void GraphicsSettingsDialog::LoadPlatformConfigurations() setUpdatesEnabled(true); - QSettings settings("Amazon", "Lumberyard"); + QSettings settings("Amazon", "O3DE"); settings.beginGroup("GraphicsSettingsDialog"); settings.beginGroup("cvarGroup"); @@ -624,7 +624,7 @@ void GraphicsSettingsDialog::CleanUI() { setUpdatesEnabled(false); - QSettings settings("Amazon", "Lumberyard"); + QSettings settings("Amazon", "O3DE"); settings.beginGroup("GraphicsSettingsDialog"); settings.beginGroup("cvarGroup"); diff --git a/Code/Sandbox/Editor/IEditorImpl.cpp b/Code/Sandbox/Editor/IEditorImpl.cpp index f9878b2c8d..4a0a73c9ac 100644 --- a/Code/Sandbox/Editor/IEditorImpl.cpp +++ b/Code/Sandbox/Editor/IEditorImpl.cpp @@ -1432,10 +1432,10 @@ AZStd::string CEditorImpl::LoadProjectIdFromProjectData() QByteArray editorProjectNameUtf8 = editorProjectName.toUtf8(); AZ::Uuid id = AZ::Uuid::CreateName(editorProjectNameUtf8.constData()); - // The projects that Lumberyard ships with had their project IDs hand-generated based on the name of the level. + // The projects that Open 3D Engine ships with had their project IDs hand-generated based on the name of the level. // Therefore, if the UUID from the project name is the same as the UUID in the file, it's one of our projects // and we can therefore send the name back, making it easier for Metrics to determine which level it was. - // We are checking to see if this is a project we ship with Lumberyard, and therefore we can unobfuscate non-customer information. + // We are checking to see if this is a project we ship with Open 3D Engine, and therefore we can unobfuscate non-customer information. if (id != AZ::Uuid(projectId.data())) { return projectId; @@ -2097,7 +2097,7 @@ namespace void CEditorImpl::LoadSettings() { - QSettings settings(QStringLiteral("Amazon"), QStringLiteral("Lumberyard")); + QSettings settings(QStringLiteral("Amazon"), QStringLiteral("O3DE")); settings.beginGroup(QStringLiteral("Editor")); settings.beginGroup(QStringLiteral("CoordSys")); @@ -2116,7 +2116,7 @@ void CEditorImpl::LoadSettings() void CEditorImpl::SaveSettings() const { - QSettings settings(QStringLiteral("Amazon"), QStringLiteral("Lumberyard")); + QSettings settings(QStringLiteral("Amazon"), QStringLiteral("O3DE")); settings.beginGroup(QStringLiteral("Editor")); settings.beginGroup(QStringLiteral("CoordSys")); diff --git a/Code/Sandbox/Editor/KeyboardCustomizationSettings.cpp b/Code/Sandbox/Editor/KeyboardCustomizationSettings.cpp index ce76beae6f..279fd7a99f 100644 --- a/Code/Sandbox/Editor/KeyboardCustomizationSettings.cpp +++ b/Code/Sandbox/Editor/KeyboardCustomizationSettings.cpp @@ -109,7 +109,7 @@ void KeyboardCustomizationSettings::LoadDefaults() void KeyboardCustomizationSettings::Load() { - QSettings settings(QStringLiteral("Amazon"), QStringLiteral("Lumberyard")); + QSettings settings(QStringLiteral("Amazon"), QStringLiteral("O3DE")); settings.beginGroup(QStringLiteral("Keyboard Shortcuts")); settings.beginGroup(m_group); @@ -156,7 +156,7 @@ void KeyboardCustomizationSettings::LoadFromSnapshot(const Snapshot& snapshot) void KeyboardCustomizationSettings::Save() { - QSettings settings(QStringLiteral("Amazon"), QStringLiteral("Lumberyard")); + QSettings settings(QStringLiteral("Amazon"), QStringLiteral("O3DE")); settings.beginGroup(QStringLiteral("Keyboard Shortcuts")); settings.beginGroup(m_group); @@ -189,7 +189,7 @@ KeyboardCustomizationSettings::Snapshot KeyboardCustomizationSettings::CreateSna void KeyboardCustomizationSettings::ExportToFile(QWidget* parent) { - QString fileName = QFileDialog::getSaveFileName(parent, QObject::tr("Export Keyboard Shortcuts"), QStringLiteral("lumberyard.keys"), QObject::tr("Keyboard Settings (*.keys)")); + QString fileName = QFileDialog::getSaveFileName(parent, QObject::tr("Export Keyboard Shortcuts"), QStringLiteral("o3de.keys"), QObject::tr("Keyboard Settings (*.keys)")); if (fileName.isEmpty()) { return; @@ -205,7 +205,7 @@ void KeyboardCustomizationSettings::ExportToFile(QWidget* parent) QJsonObject store; store.insert("version", "1.0"); - store.insert("Content-Type", "application/x-lumberyard-sdk-keyboard-settings+json"); + store.insert("Content-Type", "application/x-o3de-sdk-keyboard-settings+json"); QJsonObject groups; for (auto instance = m_instances.constBegin(); instance != m_instances.constEnd(); instance++) @@ -262,7 +262,7 @@ void KeyboardCustomizationSettings::ImportFromFile(QWidget* parent) QJsonDocument imported(QJsonDocument::fromJson(rawData)); QJsonObject store = imported.object(); - if (store.value("Content-Type") != "application/x-lumberyard-sdk-keyboard-settings+json" || store.value("version") != "1.0") + if (store.value("Content-Type") != "application/x-o3de-sdk-keyboard-settings+json" || store.value("version") != "1.0") { QMessageBox::critical(parent, QObject::tr("Shortcut Import Error"), QObject::tr("\"%1\" doesn't appear to contain keyboard settings").arg(fileName)); return; diff --git a/Code/Sandbox/Editor/LensFlareEditor/LensFlareAtomicList.cpp b/Code/Sandbox/Editor/LensFlareEditor/LensFlareAtomicList.cpp index ebf4b5d285..d30db3f5f3 100644 --- a/Code/Sandbox/Editor/LensFlareEditor/LensFlareAtomicList.cpp +++ b/Code/Sandbox/Editor/LensFlareEditor/LensFlareAtomicList.cpp @@ -292,7 +292,7 @@ QLensFlareAtomicListModel::Item* QLensFlareAtomicListModel::ItemFromIndex(QModel QStringList QLensFlareAtomicListModel::mimeTypes() const { return { - QStringLiteral("application/x-lumberyard-flaretypes") + QStringLiteral("application/x-o3de-flaretypes") }; } @@ -308,7 +308,7 @@ QMimeData* QLensFlareAtomicListModel::mimeData(const QModelIndexList& indexes) c stream << static_cast(FlareTypeFromIndex(index)); } - data->setData(QStringLiteral("application/x-lumberyard-flaretypes"), encoded); + data->setData(QStringLiteral("application/x-o3de-flaretypes"), encoded); return data; } diff --git a/Code/Sandbox/Editor/LensFlareEditor/LensFlareEditor.cpp b/Code/Sandbox/Editor/LensFlareEditor/LensFlareEditor.cpp index 81604703f5..763b5bf19b 100644 --- a/Code/Sandbox/Editor/LensFlareEditor/LensFlareEditor.cpp +++ b/Code/Sandbox/Editor/LensFlareEditor/LensFlareEditor.cpp @@ -1173,7 +1173,7 @@ LensFlareItemTreeModel::LensFlareItemTreeModel(CDatabaseFrameWnd* pParent) QStringList LensFlareItemTreeModel::mimeTypes() const { QStringList mimeTypes = LibraryItemTreeModel::mimeTypes(); - mimeTypes << QStringLiteral("application/x-lumberyard-flaretypes"); + mimeTypes << QStringLiteral("application/x-o3de-flaretypes"); return mimeTypes; } @@ -1184,9 +1184,9 @@ bool LensFlareItemTreeModel::dropMimeData(const QMimeData* data, Qt::DropAction return true; } - if (data->hasFormat(QStringLiteral("application/x-lumberyard-flaretypes"))) + if (data->hasFormat(QStringLiteral("application/x-o3de-flaretypes"))) { - QByteArray encoded = data->data(QStringLiteral("application/x-lumberyard-flaretypes")); + QByteArray encoded = data->data(QStringLiteral("application/x-o3de-flaretypes")); QDataStream stream(&encoded, QIODevice::ReadOnly); while (!stream.atEnd()) diff --git a/Code/Sandbox/Editor/LensFlareEditor/LensFlareElementTree.cpp b/Code/Sandbox/Editor/LensFlareEditor/LensFlareElementTree.cpp index 019f9bd050..be687a5469 100644 --- a/Code/Sandbox/Editor/LensFlareEditor/LensFlareElementTree.cpp +++ b/Code/Sandbox/Editor/LensFlareEditor/LensFlareElementTree.cpp @@ -737,8 +737,8 @@ bool LensFlareElementTreeModel::removeRows(int row, int count, const QModelIndex QStringList LensFlareElementTreeModel::mimeTypes() const { QStringList types; - types << QStringLiteral("application/x-lumberyard-flareelements"); - types << QStringLiteral("application/x-lumberyard-flaretypes"); + types << QStringLiteral("application/x-o3de-flareelements"); + types << QStringLiteral("application/x-o3de-flaretypes"); return types; } @@ -754,7 +754,7 @@ QMimeData* LensFlareElementTreeModel::mimeData(const QModelIndexList& indexes) c array.append(reinterpret_cast(&pElement), sizeof(CLensFlareElement*)); } - data->setData(QStringLiteral("application/x-lumberyard-flareelements"), array); + data->setData(QStringLiteral("application/x-o3de-flareelements"), array); return data; } @@ -1052,11 +1052,11 @@ bool LensFlareElementTreeModel::MoveElement(CLensFlareElement* pElement, int row bool LensFlareElementTreeModel::dropMimeData(const QMimeData* data, [[maybe_unused]] Qt::DropAction action, int row, [[maybe_unused]] int column, const QModelIndex& parent) { - if (data->hasFormat(QStringLiteral("application/x-lumberyard-flaretypes"))) + if (data->hasFormat(QStringLiteral("application/x-o3de-flaretypes"))) { // drop from atomic list - QByteArray encoded = data->data(QStringLiteral("application/x-lumberyard-flaretypes")); + QByteArray encoded = data->data(QStringLiteral("application/x-o3de-flaretypes")); QDataStream stream(&encoded, QIODevice::ReadOnly); while (!stream.atEnd()) @@ -1070,9 +1070,9 @@ bool LensFlareElementTreeModel::dropMimeData(const QMimeData* data, [[maybe_unus return true; } - else if (data->hasFormat(QStringLiteral("application/x-lumberyard-flareelements"))) + else if (data->hasFormat(QStringLiteral("application/x-o3de-flareelements"))) { - QByteArray array = data->data("application/x-lumberyard-flareelements"); + QByteArray array = data->data("application/x-o3de-flareelements"); int count = array.size() / sizeof(CLensFlareElement*); auto ppElements = reinterpret_cast(array.data()); diff --git a/Code/Sandbox/Editor/MainWindow.cpp b/Code/Sandbox/Editor/MainWindow.cpp index 2534fd8796..ab5e0cf559 100644 --- a/Code/Sandbox/Editor/MainWindow.cpp +++ b/Code/Sandbox/Editor/MainWindow.cpp @@ -406,7 +406,7 @@ MainWindow::MainWindow(QWidget* parent) , m_undoStateAdapter(new UndoStackStateAdapter(this)) , m_keyboardCustomization(nullptr) , m_activeView(nullptr) - , m_settings("amazon", "lumberyard") // TODO_KDAB: Replace with a central settings class + , m_settings("amazon", "O3DE") // TODO_KDAB: Replace with a central settings class , m_toolbarManager(new ToolbarManager(m_actionManager, this)) , m_assetImporterManager(new AssetImporterManager(this)) , m_levelEditorMenuHandler(new LevelEditorMenuHandler(this, m_viewPaneManager, m_settings)) @@ -1373,7 +1373,7 @@ void MainWindow::InitActions() am->AddAction(ID_DOCUMENTATION_GLOSSARY, tr("Glossary")) .SetReserved(); - am->AddAction(ID_DOCUMENTATION_LUMBERYARD, tr("Lumberyard Documentation")) + am->AddAction(ID_DOCUMENTATION_O3DE, tr("Open 3D Engine Documentation")) .SetReserved(); am->AddAction(ID_DOCUMENTATION_GAMELIFT, tr("GameLift Documentation")) .SetReserved(); @@ -1391,11 +1391,11 @@ void MainWindow::InitActions() am->AddAction(ID_DOCUMENTATION_FEEDBACK, tr("Give Us Feedback")) .SetReserved(); - am->AddAction(ID_APP_ABOUT, tr("&About Lumberyard")) + am->AddAction(ID_APP_ABOUT, tr("&About Open 3D Engine")) .SetStatusTip(tr("Display program information, version number and copyright")) .SetReserved(); am->AddAction(ID_APP_SHOW_WELCOME, tr("&Welcome")) - .SetStatusTip(tr("Show the Welcome to Lumberyard dialog box")) + .SetStatusTip(tr("Show the Welcome to Open 3D Engine dialog box")) .RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateShowWelcomeScreen); // Editors Toolbar actions diff --git a/Code/Sandbox/Editor/MainWindow.qrc b/Code/Sandbox/Editor/MainWindow.qrc index b064460638..476159fbfd 100644 --- a/Code/Sandbox/Editor/MainWindow.qrc +++ b/Code/Sandbox/Editor/MainWindow.qrc @@ -75,7 +75,7 @@ res/source_control-warning_v2.svg - res/lyeditor.ico + res/o3de_editor.ico res/Eye.svg diff --git a/Code/Sandbox/Editor/Material/MaterialManager.cpp b/Code/Sandbox/Editor/Material/MaterialManager.cpp index e1daf65666..8f4269bb3e 100644 --- a/Code/Sandbox/Editor/Material/MaterialManager.cpp +++ b/Code/Sandbox/Editor/Material/MaterialManager.cpp @@ -665,7 +665,7 @@ void CMaterialManager::AddSourceFileOpeners(const char* fullSourceFileName, [[ma } }; - openers.push_back({ "Lumberyard_MaterialEditor", "Open In Material Editor...", QIcon(), materialCallback }); + openers.push_back({ "O3DE_MaterialEditor", "Open In Material Editor...", QIcon(), materialCallback }); } } diff --git a/Code/Sandbox/Editor/Material/MaterialPythonFuncs.cpp b/Code/Sandbox/Editor/Material/MaterialPythonFuncs.cpp index 3c80f7c5e7..5de75a7c39 100644 --- a/Code/Sandbox/Editor/Material/MaterialPythonFuncs.cpp +++ b/Code/Sandbox/Editor/Material/MaterialPythonFuncs.cpp @@ -393,8 +393,6 @@ namespace return EFTT_SPECULAR_2; } throw std::runtime_error("Invalid texture name."); - - return EFTT_MAX; } template diff --git a/Code/Sandbox/Editor/PluginManager.cpp b/Code/Sandbox/Editor/PluginManager.cpp index b618c6443f..252118bdd2 100644 --- a/Code/Sandbox/Editor/PluginManager.cpp +++ b/Code/Sandbox/Editor/PluginManager.cpp @@ -184,7 +184,7 @@ bool CPluginManager::LoadPlugins(const char* pPathWithMask) continue; } - // Lumberyard: + // Open 3D Engine: // Query the plugin settings, check for manual load... TPfnQueryPluginSettings pfnQuerySettings = reinterpret_cast(hPlugin->resolve("QueryPluginSettings")); diff --git a/Code/Sandbox/Editor/Resource.h b/Code/Sandbox/Editor/Resource.h index 9f0a858b40..a4bd2c1143 100644 --- a/Code/Sandbox/Editor/Resource.h +++ b/Code/Sandbox/Editor/Resource.h @@ -373,7 +373,7 @@ #define ID_DOCUMENTATION_GETTINGSTARTEDGUIDE 36023 #define ID_DOCUMENTATION_TUTORIALS 36024 #define ID_DOCUMENTATION_GLOSSARY 36025 -#define ID_DOCUMENTATION_LUMBERYARD 36026 +#define ID_DOCUMENTATION_O3DE 36026 #define ID_DOCUMENTATION_GAMELIFT 36027 #define ID_DOCUMENTATION_RELEASENOTES 36028 #define ID_DOCUMENTATION_GAMEDEVBLOG 36029 diff --git a/Code/Sandbox/Editor/Settings.cpp b/Code/Sandbox/Editor/Settings.cpp index cd95eef5ea..0f25b6ac6d 100644 --- a/Code/Sandbox/Editor/Settings.cpp +++ b/Code/Sandbox/Editor/Settings.cpp @@ -1090,7 +1090,7 @@ void SEditorSettings::ConvertPath(const AZStd::string_view sourcePath, AZStd::st { // This API accepts pipe-separated paths like "Category1|Category2|AttributeName" // But the SettingsManager requires 2 arguments, a Category like "Category1\Category2" and an attribute "AttributeName" - // The reason for the difference is to have this API be consistent with the path syntax in Lumberyard Python APIs. + // The reason for the difference is to have this API be consistent with the path syntax in Open 3D Engine Python APIs. // Find the last pipe separator ("|") in the path int lastSeparator = sourcePath.find_last_of("|"); diff --git a/Code/Sandbox/Editor/ShortcutDispatcher.h b/Code/Sandbox/Editor/ShortcutDispatcher.h index dbd3e40077..51a2eb0749 100644 --- a/Code/Sandbox/Editor/ShortcutDispatcher.h +++ b/Code/Sandbox/Editor/ShortcutDispatcher.h @@ -45,10 +45,10 @@ class QKeyEvent; More documentation on Qt shortcuts ------------------------------------------- - Here's some more detailed info regarding shortcuts in Qt. Not specific Lumberyard but + Here's some more detailed info regarding shortcuts in Qt. Not specific Open 3D Engine but useful as not explained in Qt docs much. - P.S.: The following text details the strategy used in an earlier Lumberyard version. Not sure which + P.S.: The following text details the strategy used in an earlier Open 3D Engine version. Not sure which shortcut context type it uses nowadays, but eitherway, the following text is educational, and all the traps still exist in current Qt (5.11). diff --git a/Code/Sandbox/Editor/StartupLogoDialog.cpp b/Code/Sandbox/Editor/StartupLogoDialog.cpp index 36cd223be7..38cf1bc5f6 100644 --- a/Code/Sandbox/Editor/StartupLogoDialog.cpp +++ b/Code/Sandbox/Editor/StartupLogoDialog.cpp @@ -48,14 +48,14 @@ CStartupLogoDialog::CStartupLogoDialog(QString versionText, QString richTextCopy QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_1_27.png")); m_backgroundImage = QPixmap::fromImage(backgroundImage.scaled(m_enforcedWidth, m_enforcedHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - // Draw the Lumberyard logo from svg + // Draw the Open 3D Engine logo from svg m_ui->m_logo->load(QStringLiteral(":/StartupLogoDialog/lumberyard_logo.svg")); m_ui->m_TransparentConfidential->setObjectName("copyrightNotice"); m_ui->m_TransparentConfidential->setTextFormat(Qt::RichText); m_ui->m_TransparentConfidential->setText(richTextCopyrightNotice); - setWindowTitle(tr("Starting Lumberyard Editor")); + setWindowTitle(tr("Starting Open 3D Engine Editor")); setStyleSheet( "CStartupLogoDialog > QLabel { background: transparent; color: 'white' }\ CStartupLogoDialog > QLabel#copyrightNotice { color: #AAAAAA; font-size: 9px; } "); diff --git a/Code/Sandbox/Editor/ThumbnailGenerator.cpp b/Code/Sandbox/Editor/ThumbnailGenerator.cpp index 2c6bb67960..c2f03a1944 100644 --- a/Code/Sandbox/Editor/ThumbnailGenerator.cpp +++ b/Code/Sandbox/Editor/ThumbnailGenerator.cpp @@ -193,45 +193,6 @@ void CThumbnailGenerator::GenerateForDirectory(const QString& path) //GetIEditor()->ShowConsole( false ); } -void CThumbnailGenerator::GenerateForFile(const QString& fileName) +void CThumbnailGenerator::GenerateForFile([[maybe_unused]] const QString& fileName) { - return; - - I3DEngine* engine = GetIEditor()->Get3DEngine(); - - int thumbSize = 128; - CImageEx image; - image.Allocate(thumbSize, thumbSize); - - char drive[_MAX_DRIVE]; - char fdir[_MAX_DIR]; - char fname[_MAX_FNAME]; - char fext[_MAX_EXT]; - char bmpFile[1024]; - - _splitpath_s(fileName.toUtf8().data(), drive, fdir, fname, fext); - - _makepath_s(bmpFile, drive, fdir, fname, ".tmb"); - FileTimeType ft1, ft2; - GetThumbFileTime(fileName.toUtf8().data(), ft1); - GetThumbFileTime(bmpFile, ft2); - // Both cgf and bmp have same time stamp. - if (ThumbFileTimeIsEqual(ft1, ft2)) - { - return; - } - - _smart_ptr obj = engine->LoadStatObjAutoRef(fileName.toUtf8().data(), NULL, NULL, false); - if (obj) - { - assert(!"IStatObj::MakeObjectPicture does not exist anymore"); - // obj->MakeObjectPicture( (unsigned char*)image.GetData(),thumbSize ); - - CImageUtil::SaveBitmap(bmpFile, image); - SetThumbFileTime(bmpFile, ft1); -#if defined(AZ_PLATFORM_WINDOWS) - SetFileAttributes(bmpFile, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED); -#endif - obj->Release(); - } } diff --git a/Code/Sandbox/Editor/ToolbarManager.cpp b/Code/Sandbox/Editor/ToolbarManager.cpp index 5a131b494a..4679f9cb6a 100644 --- a/Code/Sandbox/Editor/ToolbarManager.cpp +++ b/Code/Sandbox/Editor/ToolbarManager.cpp @@ -217,7 +217,7 @@ public: ToolbarManager::ToolbarManager(ActionManager* actionManager, MainWindow* mainWindow) : m_mainWindow(mainWindow) , m_actionManager(actionManager) - , m_settings("amazon", "lumberyard") + , m_settings("amazon", "O3DE") , m_expanderWatcher(new AmazonToolBarExpanderWatcher()) { // Note that we don't actually save/load from AmazonToolbar::List diff --git a/Code/Sandbox/Editor/TrackView/TrackViewDialog.cpp b/Code/Sandbox/Editor/TrackView/TrackViewDialog.cpp index 391c5bf7f4..a7a801e35a 100644 --- a/Code/Sandbox/Editor/TrackView/TrackViewDialog.cpp +++ b/Code/Sandbox/Editor/TrackView/TrackViewDialog.cpp @@ -1870,7 +1870,7 @@ void CTrackViewDialog::ReadMiscSettings() ////////////////////////////////////////////////////////////////////////// void CTrackViewDialog::SaveLayouts() { - QSettings settings("Amazon", "Lumberyard"); + QSettings settings("Amazon", "O3DE"); settings.beginGroup("TrackView"); QByteArray stateData = this->saveState(); settings.setValue("layout", stateData); @@ -1886,7 +1886,7 @@ void CTrackViewDialog::SaveLayouts() ////////////////////////////////////////////////////////////////////////// void CTrackViewDialog::ReadLayouts() { - QSettings settings("Amazon", "Lumberyard"); + QSettings settings("Amazon", "O3DE"); settings.beginGroup("TrackView"); setViewMode(static_cast(settings.value("lastViewMode").toInt())); diff --git a/Code/Sandbox/Editor/TrackView/TrackViewPythonFuncs.cpp b/Code/Sandbox/Editor/TrackView/TrackViewPythonFuncs.cpp index 35f1a74340..a031b0d930 100644 --- a/Code/Sandbox/Editor/TrackView/TrackViewPythonFuncs.cpp +++ b/Code/Sandbox/Editor/TrackView/TrackViewPythonFuncs.cpp @@ -481,8 +481,6 @@ namespace default: throw std::runtime_error("Unsupported key type"); } - - return AZStd::any(); } AZStd::any PyTrackViewGetKeyValue(const char* paramName, int trackIndex, int keyIndex, const char* nodeName, const char* parentDirectorName) diff --git a/Code/Sandbox/Editor/Util/ImageUtil.cpp b/Code/Sandbox/Editor/Util/ImageUtil.cpp index c451e9d18e..ae44833a75 100644 --- a/Code/Sandbox/Editor/Util/ImageUtil.cpp +++ b/Code/Sandbox/Editor/Util/ImageUtil.cpp @@ -288,8 +288,6 @@ bool CImageUtil::LoadImage(const QString& fileName, CImageEx& image, bool* pQual { return CImageUtil::Load(fileName, image); } - - return false; } ////////////////////////////////////////////////////////////////////////// @@ -320,8 +318,6 @@ bool CImageUtil::SaveImage(const QString& fileName, CImageEx& image) { return Save(fileName, image); } - - return false; } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Sandbox/Editor/ViewportTitleDlg.cpp b/Code/Sandbox/Editor/ViewportTitleDlg.cpp index 305d4cdf6a..5d558eba98 100644 --- a/Code/Sandbox/Editor/ViewportTitleDlg.cpp +++ b/Code/Sandbox/Editor/ViewportTitleDlg.cpp @@ -980,7 +980,7 @@ void CViewportTitleDlg::UpdateSearchOptionsText() void CViewportTitleDlg::LoadCustomPresets(const QString& section, const QString& keyName, QStringList& outCustompresets) { - QSettings settings("Amazon", "Lumberyard"); // Temporary solution until we have the global Settings class. + QSettings settings("Amazon", "O3DE"); // Temporary solution until we have the global Settings class. settings.beginGroup(section); outCustompresets = settings.value(keyName).toStringList(); settings.endGroup(); @@ -988,7 +988,7 @@ void CViewportTitleDlg::LoadCustomPresets(const QString& section, const QString& void CViewportTitleDlg::SaveCustomPresets(const QString& section, const QString& keyName, const QStringList& custompresets) { - QSettings settings("Amazon", "Lumberyard"); // Temporary solution until we have the global Settings class. + QSettings settings("Amazon", "O3DE"); // Temporary solution until we have the global Settings class. settings.beginGroup(section); settings.setValue(keyName, custompresets); settings.endGroup(); diff --git a/Code/Sandbox/Editor/WelcomeScreen/WelcomeScreenDialog.ui b/Code/Sandbox/Editor/WelcomeScreen/WelcomeScreenDialog.ui index e7adc1bade..be0d175a09 100644 --- a/Code/Sandbox/Editor/WelcomeScreen/WelcomeScreenDialog.ui +++ b/Code/Sandbox/Editor/WelcomeScreen/WelcomeScreenDialog.ui @@ -32,7 +32,7 @@ Qt::TabFocus
- Welcome to Lumberyard + Welcome to Open 3D Engine diff --git a/Code/Sandbox/Editor/res/lyeditor.ico b/Code/Sandbox/Editor/res/lyeditor.ico deleted file mode 100644 index 532ca4d19c..0000000000 --- a/Code/Sandbox/Editor/res/lyeditor.ico +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2c9a6ddbfc423c717a03dacab45e134166a1b06030b4caf418d0a6a69c2d82d2 -size 114333 diff --git a/Code/Sandbox/Editor/res/o3de_editor.ico b/Code/Sandbox/Editor/res/o3de_editor.ico new file mode 100644 index 0000000000..0680ceea19 --- /dev/null +++ b/Code/Sandbox/Editor/res/o3de_editor.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c042fce57915fc749abc7b37de765fd697c3c4d7de045a3d44805aa0ce29901a +size 107016 diff --git a/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp b/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp index 2710b7acf1..4a03dcd7dc 100644 --- a/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp +++ b/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp @@ -438,45 +438,8 @@ void CComponentEntityObject::OnEntityIconChanged(const AZ::Data::AssetId& entity SetupEntityIcon(); } -void CComponentEntityObject::OnParentChanged([[maybe_unused]] AZ::EntityId oldParent, AZ::EntityId newParent) +void CComponentEntityObject::OnParentChanged([[maybe_unused]] AZ::EntityId oldParent, [[maybe_unused]] AZ::EntityId newParent) { - return; - - if (m_parentingReentryGuard) // Ignore if action originated from Sandbox. - { - EditorActionScope parentChange(m_parentingReentryGuard); - - CComponentEntityObject* currentParent = static_cast(GetParent()); - - if (!currentParent && !newParent.IsValid()) - { - // No change in parent. - return; - } - - if (currentParent && currentParent->GetAssociatedEntityId() == newParent) - { - // No change in parent. - return; - } - - DetachThis(); - - if (newParent.IsValid()) - { - CComponentEntityObject* componentEntity = CComponentEntityObject::FindObjectForEntity(newParent); - - if (componentEntity) - { - // The action is originating from Sandbox, so ignore the return events. - EditorActionScope transformChange(m_transformReentryGuard); - - componentEntity->AttachChild(this); - } - } - - InvalidateTM(0); - } } void CComponentEntityObject::OnMeshCreated(const AZ::Data::Asset& asset) diff --git a/Code/Sandbox/Plugins/EditorAssetImporter/AssetBrowserContextProvider.cpp b/Code/Sandbox/Plugins/EditorAssetImporter/AssetBrowserContextProvider.cpp index 5713e14a36..0e94ff80cf 100644 --- a/Code/Sandbox/Plugins/EditorAssetImporter/AssetBrowserContextProvider.cpp +++ b/Code/Sandbox/Plugins/EditorAssetImporter/AssetBrowserContextProvider.cpp @@ -75,7 +75,7 @@ namespace AZ return; } - openers.push_back({ "Lumberyard_FBX_Settings_Edit", "Edit Settings...", QIcon(), [](const char* fullSourceFileNameInCallback, const AZ::Uuid& /*sourceUUID*/) + openers.push_back({ "O3DE_FBX_Settings_Edit", "Edit Settings...", QIcon(), [](const char* fullSourceFileNameInCallback, const AZ::Uuid& /*sourceUUID*/) { AZStd::string sourceName(fullSourceFileNameInCallback); // because the below call absolutely requires a AZStd::string. AssetImporterPlugin::GetInstance()->EditImportSettings(sourceName); diff --git a/Code/Sandbox/Plugins/EditorAssetImporter/AssetImporterPlugin.cpp b/Code/Sandbox/Plugins/EditorAssetImporter/AssetImporterPlugin.cpp index dbe3b343a0..c04f81f50c 100644 --- a/Code/Sandbox/Plugins/EditorAssetImporter/AssetImporterPlugin.cpp +++ b/Code/Sandbox/Plugins/EditorAssetImporter/AssetImporterPlugin.cpp @@ -88,6 +88,12 @@ AZStd::unique_ptr AssetImporterPlugin::LoadSceneLibrary void AssetImporterPlugin::EditImportSettings(const AZStd::string& sourceFilePath) { const QtViewPane* assetImporterPane = GetIEditor()->OpenView(m_toolName.c_str()); + + if(!assetImporterPane) + { + return; + } + AssetImporterWindow* assetImporterWindow = qobject_cast(assetImporterPane->Widget()); if (!assetImporterWindow) { diff --git a/Code/Sandbox/Plugins/EditorCommon/EditorCommon.rc b/Code/Sandbox/Plugins/EditorCommon/EditorCommon.rc index 1e1917e8c2f5f0bbc4bfc5076444762dc73015fc..715fc2952c60834133b0468573b2657f18e7b88b 100644 GIT binary patch delta 73 ycmaDM{6lyHAFH%KLjgl7LmqWa?%`)@o+F3f6O2G6Dcg#1AGetCamera()->SetApertureMode(FbxCamera::eVertical); entityData.keyValue = aznumeric_cast(pNode->GetCamera()->ComputeFieldOfView(entityData.keyValue)); } @@ -821,7 +821,7 @@ bool CFBXExporter::ImportFromFile(const char* filename, Export::IData* pData) return false; } - // record the original axis system used in the import file and then convert the file to Lumberyard's coord system, + // record the original axis system used in the import file and then convert the file to Open 3D Engine's coord system, // which matches Max's (Z-Up, negative Y-forward cameras) int upSign = 1; FbxAxisSystem importFileAxisSystem = pFBXScene->GetGlobalSettings().GetAxisSystem(); @@ -877,13 +877,13 @@ bool CFBXExporter::ImportFromFile(const char* filename, Export::IData* pData) if (pCamera) { - // Converts Y-Up, -Z-forward cameras to Lumberyards Z-Up, Y-forward cameras + // Converts Y-Up, -Z-forward cameras to Open 3D Engine Z-Up, Y-forward cameras // It is needed regardless of the scene up vector pNode->SetPostRotation(FbxNode::eSourcePivot, s_POST_ROTATION_FOR_ZFORWARD_CAMERAS); } else { - // Objects from a Y-Up scene (i.e. not cameras). 'undo' the extra transform that the Lumberyard Tool + // Objects from a Y-Up scene (i.e. not cameras). 'undo' the extra transform that the Open 3D Engine Tool // bakes in to .cgf files from YUp scenes. pNode->SetPostRotation(FbxNode::eSourcePivot, s_POST_ROTATION_FOR_YUP_OBJECTS); } diff --git a/Code/Sandbox/Plugins/ProjectSettingsTool/PlatformSettings_Ios.h b/Code/Sandbox/Plugins/ProjectSettingsTool/PlatformSettings_Ios.h index 38187414e1..79243d5208 100644 --- a/Code/Sandbox/Plugins/ProjectSettingsTool/PlatformSettings_Ios.h +++ b/Code/Sandbox/Plugins/ProjectSettingsTool/PlatformSettings_Ios.h @@ -131,7 +131,7 @@ namespace ProjectSettingsTool : m_bundleName("") , m_bundleDisplayName("") , m_executableName("") - , m_bundleIdentifier("com.amazon.lumberyard.UnknownProject") + , m_bundleIdentifier("com.amazon.o3de.UnknownProject") , m_versionName("1.0.0") , m_versionNumber("1.0.0") , m_developmentRegion("en_US") diff --git a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSNativeSDKInit.h b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSNativeSDKInit.h index 1203c77b21..3c7baab241 100644 --- a/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSNativeSDKInit.h +++ b/Code/Tools/AWSNativeSDKInit/include/AWSNativeSDKInit/AWSNativeSDKInit.h @@ -28,7 +28,7 @@ AZ_POP_DISABLE_WARNING namespace AWSNativeSDKInit { - // Entry point for Lumberyard managing the AWSNativeSDK's initialization and shutdown requirements + // Entry point for Open 3D Engine managing the AWSNativeSDK's initialization and shutdown requirements // Use an AZ::Environment variable to enforce only one init and shutdown class InitializationManager { @@ -38,7 +38,7 @@ namespace AWSNativeSDKInit InitializationManager(); ~InitializationManager(); - // Call to guarantee that the API is initialized with proper Lumberyard settings. + // Call to guarantee that the API is initialized with proper Open 3D Engine settings. // It's fine to call this from every module which needs to use the NativeSDK // Creates a static shared pointer using the AZ EnvironmentVariable system. // This will prevent a the AWS SDK from going through the shutdown routine until all references are gone, or diff --git a/Code/Tools/AssetBundler/assetbundlerbatch_exe_files.cmake b/Code/Tools/AssetBundler/assetbundlerbatch_exe_files.cmake index 3be5b791f4..be746ff05c 100644 --- a/Code/Tools/AssetBundler/assetbundlerbatch_exe_files.cmake +++ b/Code/Tools/AssetBundler/assetbundlerbatch_exe_files.cmake @@ -11,4 +11,5 @@ set(FILES source/main.cpp + source/AssetBundlerBatch.rc ) diff --git a/Code/Tools/AssetBundler/source/AssetBundlerBatch.ico b/Code/Tools/AssetBundler/source/AssetBundlerBatch.ico new file mode 100644 index 0000000000..51eae6ce2b --- /dev/null +++ b/Code/Tools/AssetBundler/source/AssetBundlerBatch.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe5b63adf64ca5b940bb9ff35a198e41f956e248b0c9bff349d36885a8e6bfcf +size 103824 diff --git a/Code/Tools/AssetBundler/source/AssetBundlerBatch.rc b/Code/Tools/AssetBundler/source/AssetBundlerBatch.rc new file mode 100644 index 0000000000..32d4affb51 --- /dev/null +++ b/Code/Tools/AssetBundler/source/AssetBundlerBatch.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "AssetBundlerBatch.ico" diff --git a/Code/Tools/AssetBundler/source/utils/applicationManager.cpp b/Code/Tools/AssetBundler/source/utils/applicationManager.cpp index 4c551463f5..bb4fee2ceb 100644 --- a/Code/Tools/AssetBundler/source/utils/applicationManager.cpp +++ b/Code/Tools/AssetBundler/source/utils/applicationManager.cpp @@ -2619,9 +2619,9 @@ namespace AssetBundler AZ_Printf(AppWindowName, "\n"); AZ_Printf(AppWindowName, "Some args in this tool take paths as arguments, and there are two main types:\n"); AZ_Printf(AppWindowName, " \"path\" - This refers to an Engine-Root-Relative path.\n"); - AZ_Printf(AppWindowName, " - Example: \"C:\\Lumberyard\\dev\\AutomatedTesting\\test.txt\" can be represented as \"AutomatedTesting\\test.txt\".\n"); + AZ_Printf(AppWindowName, " - Example: \"C:\\O3DE\\dev\\SamplesProject\\test.txt\" can be represented as \"SamplesProject\\test.txt\".\n"); AZ_Printf(AppWindowName, " \"cache path\" - This refers to a Cache-Relative path.\n"); - AZ_Printf(AppWindowName, " - Example: \"C:\\Lumberyard\\dev\\AutomatedTesting\\Cache\\pc\\animations\\skeletonlist.xml\" is represented as \"animations\\skeletonlist.xml\".\n"); + AZ_Printf(AppWindowName, " - Example: \"C:\\O3DE\\dev\\Cache\\SamplesProject\\pc\\samplesproject\\animations\\skeletonlist.xml\" is represented as \"animations\\skeletonlist.xml\".\n"); AZ_Printf(AppWindowName, "\n"); OutputHelpSeeds(); @@ -2678,7 +2678,7 @@ namespace AssetBundler AZ_Printf(AppWindowName, " --%-25s-The specified files and all dependencies will be ignored when generating the Asset List file.\n", SkipArg); AZ_Printf(AppWindowName, "%-31s---Takes in a comma-separated list of either: cache paths to pre-processed assets, or wildcard patterns.\n", ""); AZ_Printf(AppWindowName, " --%-25s-Automatically include all default Seed List files in generated Asset List File.\n", AddDefaultSeedListFilesFlag); - AZ_Printf(AppWindowName, "%-31s---This will include Seed List files for the Lumberyard Engine and all enabled Gems.\n", ""); + AZ_Printf(AppWindowName, "%-31s---This will include Seed List files for the Open 3D Engine Engine and all enabled Gems.\n", ""); AZ_Printf(AppWindowName, " --%-25s-Specifies the platform(s) to generate an Asset List file for.\n", PlatformArg); AZ_Printf(AppWindowName, "%-31s---Requires an existing cache of assets for the input platform(s).\n", ""); AZ_Printf(AppWindowName, "%-31s---Defaults to all enabled platforms. Platforms can be changed by modifying AssetProcessorPlatformConfig.setreg.\n", ""); @@ -2757,7 +2757,7 @@ namespace AssetBundler AZ_Printf(AppWindowName, " --%-25s-[Required] Specifies the Bundle Settings file to operate on by path. Must include (.%s) file extension.\n", BundleSettingsFileArg, AssetBundleSettings::GetBundleSettingsFileExtension()); AZ_Printf(AppWindowName, " --%-25s-Sets the Asset List file to use for Bundle generation. Must include (.%s) file extension.\n", AssetListFileArg, AssetSeedManager::GetAssetListFileExtension()); AZ_Printf(AppWindowName, " --%-25s-Sets the path where generated Bundles will be stored. Must include (.%s) file extension.\n", OutputBundlePathArg, AssetBundleSettings::GetBundleFileExtension()); - AZ_Printf(AppWindowName, " --%-25s-Determines which version of Lumberyard Bundles to generate. Current version is (%i).\n", BundleVersionArg, AzFramework::AssetBundleManifest::CurrentBundleVersion); + AZ_Printf(AppWindowName, " --%-25s-Determines which version of Open 3D Engine Bundles to generate. Current version is (%i).\n", BundleVersionArg, AzFramework::AssetBundleManifest::CurrentBundleVersion); AZ_Printf(AppWindowName, " --%-25s-Sets the maximum size for a single Bundle (in MB). Default size is (%i MB).\n", MaxBundleSizeArg, AssetBundleSettings::GetMaxBundleSizeInMB()); AZ_Printf(AppWindowName, "%-31s---Bundles larger than this limit will be divided into a series of smaller Bundles and named accordingly.\n", ""); AZ_Printf(AppWindowName, " --%-25s-Specifies the platform(s) referenced by all Bundle Settings operations.\n", PlatformArg); @@ -2774,7 +2774,7 @@ namespace AssetBundler AZ_Printf(AppWindowName, "%-31s---If any other args are specified, they will override the values stored inside this file.\n", ""); AZ_Printf(AppWindowName, " --%-25s-Sets the Asset List files to use for Bundle generation. Must include (.%s) file extension.\n", AssetListFileArg, AssetSeedManager::GetAssetListFileExtension()); AZ_Printf(AppWindowName, " --%-25s-Sets the paths where generated Bundles will be stored. Must include (.%s) file extension.\n", OutputBundlePathArg, AssetBundleSettings::GetBundleFileExtension()); - AZ_Printf(AppWindowName, " --%-25s-Determines which versions of Lumberyard Bundles to generate. Current version is (%i).\n", BundleVersionArg, AzFramework::AssetBundleManifest::CurrentBundleVersion); + AZ_Printf(AppWindowName, " --%-25s-Determines which versions of Open 3D Engine Bundles to generate. Current version is (%i).\n", BundleVersionArg, AzFramework::AssetBundleManifest::CurrentBundleVersion); AZ_Printf(AppWindowName, " --%-25s-Sets the maximum size for Bundles (in MB). Default size is (%i MB).\n", MaxBundleSizeArg, AssetBundleSettings::GetMaxBundleSizeInMB()); AZ_Printf(AppWindowName, "%-31s---Bundles larger than this limit will be divided into a series of smaller Bundles and named accordingly.\n", ""); AZ_Printf(AppWindowName, " --%-25s-Specifies the platform(s) that will be referenced when generating Bundles.\n", PlatformArg); @@ -2791,7 +2791,7 @@ namespace AssetBundler AZ_Printf(AppWindowName, "%-31s---Takes in a cache path to a pre-processed asset. A cache path is a path relative to \"ProjectPath\\Cache\\platform\\\"\n", ""); AZ_Printf(AppWindowName, " --%-25s-Specifies the Bundle Settings file to operate on by path. Must include (.%s) file extension.\n", BundleSettingsFileArg, AssetBundleSettings::GetBundleSettingsFileExtension()); AZ_Printf(AppWindowName, " --%-25s-Sets the path where generated Bundles will be stored. Must include (.%s) file extension.\n", OutputBundlePathArg, AssetBundleSettings::GetBundleFileExtension()); - AZ_Printf(AppWindowName, " --%-25s-Determines which version of Lumberyard Bundles to generate. Current version is (%i).\n", BundleVersionArg, AzFramework::AssetBundleManifest::CurrentBundleVersion); + AZ_Printf(AppWindowName, " --%-25s-Determines which version of Open 3D Engine Bundles to generate. Current version is (%i).\n", BundleVersionArg, AzFramework::AssetBundleManifest::CurrentBundleVersion); AZ_Printf(AppWindowName, " --%-25s-Sets the maximum size for a single Bundle (in MB). Default size is (%i MB).\n", MaxBundleSizeArg, AssetBundleSettings::GetMaxBundleSizeInMB()); AZ_Printf(AppWindowName, "%-31s---Bundles larger than this limit will be divided into a series of smaller Bundles and named accordingly.\n", ""); AZ_Printf(AppWindowName, " --%-25s-Specifies the platform(s) that will be referenced when generating Bundles.\n", PlatformArg); diff --git a/Code/Tools/AssetBundler/source/utils/utils.cpp b/Code/Tools/AssetBundler/source/utils/utils.cpp index 35c46f4227..b1595f7dd8 100644 --- a/Code/Tools/AssetBundler/source/utils/utils.cpp +++ b/Code/Tools/AssetBundler/source/utils/utils.cpp @@ -485,7 +485,7 @@ namespace AssetBundler return AZ::Failure(AZStd::string::format( "Unable to locate the Project Cache path from Settings Registry at key %s." - " Please run the Lumberyard Asset Processor to generate a Cache and build assets.", + " Please run the Open 3D Engine Asset Processor to generate a Cache and build assets.", AZ::SettingsRegistryMergeUtils::FilePathKey_CacheProjectRootFolder)); } @@ -503,7 +503,7 @@ namespace AssetBundler if (tempPlatformList.empty()) { - return AZ::Failure(AZStd::string("Cache is empty. Please run the Lumberyard Asset Processor to generate a Cache and build assets.")); + return AZ::Failure(AZStd::string("Cache is empty. Please run the Open 3D Engine Asset Processor to generate a Cache and build assets.")); } for (const QString& platform : tempPlatformList) @@ -520,7 +520,7 @@ namespace AssetBundler if (assetCatalogFilePath.empty()) { return AZ::Failure(AZStd::string::format( - "Unable to retrieve cache platform path from Settings Registry at key: %s. Please run the Lumberyard Asset Processor to generate platform-specific cache folders and build assets.", + "Unable to retrieve cache platform path from Settings Registry at key: %s. Please run the Open 3D Engine Asset Processor to generate platform-specific cache folders and build assets.", AZ::SettingsRegistryMergeUtils::FilePathKey_CacheProjectRootFolder)); } diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilder.ico b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilder.ico new file mode 100644 index 0000000000..78908a8b37 --- /dev/null +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilder.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5bb66cade9f4f42c6db0a4e43f0c2be87b185d788353330c4165ace4f8c44289 +size 107101 diff --git a/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilder.rc b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilder.rc new file mode 100644 index 0000000000..fdc805bf52 --- /dev/null +++ b/Code/Tools/AssetProcessor/AssetBuilder/AssetBuilder.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "AssetBuilder.ico" diff --git a/Code/Tools/AssetProcessor/AssetBuilder/asset_builder_files.cmake b/Code/Tools/AssetProcessor/AssetBuilder/asset_builder_files.cmake index 2ce16735af..32a6097d89 100644 --- a/Code/Tools/AssetProcessor/AssetBuilder/asset_builder_files.cmake +++ b/Code/Tools/AssetProcessor/AssetBuilder/asset_builder_files.cmake @@ -19,4 +19,5 @@ set(FILES AssetBuilderInfo.cpp TraceMessageHook.h TraceMessageHook.cpp + AssetBuilder.rc ) \ No newline at end of file diff --git a/Code/Tools/AssetProcessor/Platform/Linux/AssetProcessor_Traits_Linux.h b/Code/Tools/AssetProcessor/Platform/Linux/AssetProcessor_Traits_Linux.h index 09c255b487..3fd8d357e6 100644 --- a/Code/Tools/AssetProcessor/Platform/Linux/AssetProcessor_Traits_Linux.h +++ b/Code/Tools/AssetProcessor/Platform/Linux/AssetProcessor_Traits_Linux.h @@ -11,5 +11,5 @@ */ #pragma once -#define ASSETPROCESSOR_TRAIT_LEGACY_RC_RELATIVE_PATH "/rc" -#define ASSETPROCESSOR_TRAIT_CASE_SENSITIVE_FILESYSTEM true \ No newline at end of file +#define ASSETPROCESSOR_TRAIT_LEGACY_RC_RELATIVE_PATH "rc" +#define ASSETPROCESSOR_TRAIT_CASE_SENSITIVE_FILESYSTEM true diff --git a/Code/Tools/AssetProcessor/Platform/Mac/AssetProcessor_Traits_Mac.h b/Code/Tools/AssetProcessor/Platform/Mac/AssetProcessor_Traits_Mac.h index b6803bd9c4..1aa7306fda 100644 --- a/Code/Tools/AssetProcessor/Platform/Mac/AssetProcessor_Traits_Mac.h +++ b/Code/Tools/AssetProcessor/Platform/Mac/AssetProcessor_Traits_Mac.h @@ -11,5 +11,5 @@ */ #pragma once -#define ASSETPROCESSOR_TRAIT_LEGACY_RC_RELATIVE_PATH "/rc" -#define ASSETPROCESSOR_TRAIT_CASE_SENSITIVE_FILESYSTEM false \ No newline at end of file +#define ASSETPROCESSOR_TRAIT_LEGACY_RC_RELATIVE_PATH "rc" +#define ASSETPROCESSOR_TRAIT_CASE_SENSITIVE_FILESYSTEM false diff --git a/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessor.rc b/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessor.rc index 94fb086867..a87b910e24 100644 --- a/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessor.rc +++ b/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessor.rc @@ -1 +1 @@ -IDI_ICON1 ICON DISCARDABLE "../../native/ui/style/lyassetprocessor.ico" +IDI_ICON1 ICON DISCARDABLE "../../native/ui/style/o3de_assetprocessor.ico" diff --git a/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessorBatch.ico b/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessorBatch.ico new file mode 100644 index 0000000000..b0df71b8d6 --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessorBatch.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c05ee28bfca3a0411afd13fb2b5fcecd5ca9b5e74627e5f6837d3c9cea25b715 +size 107497 diff --git a/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessorBatch.rc b/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessorBatch.rc new file mode 100644 index 0000000000..0dfb493fb2 --- /dev/null +++ b/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessorBatch.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "AssetProcessorBatch.ico" diff --git a/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessor_Traits_Windows.h b/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessor_Traits_Windows.h index 929f955f3c..3c0bcfe52d 100644 --- a/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessor_Traits_Windows.h +++ b/Code/Tools/AssetProcessor/Platform/Windows/AssetProcessor_Traits_Windows.h @@ -11,5 +11,5 @@ */ #pragma once -#define ASSETPROCESSOR_TRAIT_LEGACY_RC_RELATIVE_PATH "/rc.exe" -#define ASSETPROCESSOR_TRAIT_CASE_SENSITIVE_FILESYSTEM false \ No newline at end of file +#define ASSETPROCESSOR_TRAIT_LEGACY_RC_RELATIVE_PATH "rc.exe" +#define ASSETPROCESSOR_TRAIT_CASE_SENSITIVE_FILESYSTEM false diff --git a/Code/Tools/AssetProcessor/assetprocessor_batch_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_batch_files.cmake index 1089f6dda4..dfc2832e18 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_batch_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_batch_files.cmake @@ -12,4 +12,5 @@ set(FILES native/main_batch.cpp native/AssetProcessorBatchBuildTarget.cpp + Platform/Windows/AssetProcessorBatch.rc ) diff --git a/Code/Tools/AssetProcessor/native/AssetManager/FileStateCache.cpp b/Code/Tools/AssetProcessor/native/AssetManager/FileStateCache.cpp index 7bd5f58b69..b1384df0c2 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/FileStateCache.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/FileStateCache.cpp @@ -149,7 +149,10 @@ namespace AssetProcessor { return normalized.toLower(); } - return normalized; + else + { + return normalized; + } } void FileStateCache::AddOrUpdateFileInternal(QFileInfo fileInfo) diff --git a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp index a8e03bd3ac..d403b97359 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp @@ -476,7 +476,9 @@ namespace AssetProcessor // CheckDeletedSourceFile actually expects the database name as the second value // iter.key is the full path normalized. iter.value is the database path. // we need the relative path too, which involves removing the scan folder outputprefix it present: - CheckDeletedSourceFile(iter.key(), iter.value().m_sourceRelativeToWatchFolder, iter.value().m_sourceDatabaseName); + CheckDeletedSourceFile( + iter.key(), iter.value().m_sourceRelativeToWatchFolder, iter.value().m_sourceDatabaseName, + AZStd::chrono::system_clock::now()); } // we want to remove any left over scan folders from the database only after @@ -1524,7 +1526,7 @@ namespace AssetProcessor // even if the entry already exists, // overwrite the entry here, so if you modify, then delete it, its the latest action thats always on the list. - m_filesToExamine[normalizedFilePath] = FileEntry(normalizedFilePath, source.m_isDelete, source.m_isFromScanner); + m_filesToExamine[normalizedFilePath] = FileEntry(normalizedFilePath, source.m_isDelete, source.m_isFromScanner, source.m_initialProcessTime); // this block of code adds anything which DEPENDS ON the file that was changed, back into the queue so that files // that depend on it also re-analyze in case they need rebuilding. However, files that are deleted will be added @@ -1773,40 +1775,31 @@ namespace AssetProcessor return successfullyRemoved; } - void AssetProcessorManager::CheckDeletedSourceFile(QString normalizedPath, QString relativePath, QString databaseSourceFile) + void AssetProcessorManager::CheckDeletedSourceFile(QString normalizedPath, QString relativePath, QString databaseSourceFile, + AZStd::chrono::system_clock::time_point initialProcessTime) { // getting here means an input asset has been deleted // and no overrides exist for it. // we must delete its products. using namespace AzToolsFramework::AssetDatabase; + + // If we fail to delete a product, the deletion event gets requeued + // To avoid retrying forever, we keep track of the time of the first deletion failure and only retry + // if less than this amount of time has passed. + constexpr int MaxRetryPeriodMS = 500; + AZStd::chrono::duration duration = AZStd::chrono::system_clock::now() - initialProcessTime; - // Check if this file causes any file types to be re-evaluated - CheckMetaDataRealFiles(normalizedPath); - - // when a source is deleted, we also have to queue anything that depended on it, for re-processing: - SourceFileDependencyEntryContainer results; - m_stateData->GetSourceFileDependenciesByDependsOnSource(databaseSourceFile, SourceFileDependencyEntry::DEP_Any, results); - // the jobIdentifiers that have identified it as a job dependency - for (SourceFileDependencyEntry& existingEntry : results) + if (initialProcessTime > AZStd::chrono::system_clock::time_point{} + && duration >= AZStd::chrono::milliseconds(MaxRetryPeriodMS)) { - // this row is [Source] --> [Depends on Source]. - QString absolutePath = m_platformConfig->FindFirstMatchingFile(QString::fromUtf8(existingEntry.m_source.c_str())); - if (!absolutePath.isEmpty()) - { - AssessFileInternal(absolutePath, false); - } - // also, update it in the database to be missing, ie, add the "missing file" prefix: - existingEntry.m_dependsOnSource = QString(PlaceHolderFileName + relativePath).toUtf8().constData(); - m_stateData->RemoveSourceFileDependency(existingEntry.m_sourceDependencyID); - m_stateData->SetSourceFileDependency(existingEntry); + AZ_Warning(AssetProcessor::ConsoleChannel, false, "Failed to delete product(s) from source file `%s` after retrying for %fms. Giving up.", + normalizedPath.toUtf8().constData(), duration.count()); + return; } - // now that the right hand column (in terms of [thing] -> [depends on thing]) has been updated, eliminate anywhere its on the left hand side: - results.clear(); - m_stateData->GetDependsOnSourceBySource(databaseSourceFile.toUtf8().constData(), SourceFileDependencyEntry::DEP_Any, results); - m_stateData->RemoveSourceFileDependencies(results); - + bool deleteFailure = false; AzToolsFramework::AssetDatabase::SourceDatabaseEntryContainer sources; + if (m_stateData->GetSourcesBySourceName(databaseSourceFile, sources)) { for (const auto& source : sources) @@ -1827,7 +1820,13 @@ namespace AssetProcessor { // DeleteProducts will make an attempt to retry deleting each product // We can't just re-queue the whole file with CheckSource because we're deleting bits from the database as we go - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Delete failed on %s.\n", normalizedPath.toUtf8().constData()); + deleteFailure = true; + CheckSource(FileEntry( + normalizedPath, true, false, + initialProcessTime > AZStd::chrono::system_clock::time_point{} ? initialProcessTime + : AZStd::chrono::system_clock::now())); + AZ_TracePrintf(AssetProcessor::ConsoleChannel, "Delete failed on %s. Will retry!\n", normalizedPath.toUtf8().constData()); + continue; } } else @@ -1843,13 +1842,48 @@ namespace AssetProcessor Q_EMIT JobRemoved(jobInfo); } } - // delete the source from the database too since otherwise it believes we have no products. - m_stateData->RemoveSource(source.m_sourceID); + + if (!deleteFailure) + { + // delete the source from the database too since otherwise it believes we have no products. + m_stateData->RemoveSource(source.m_sourceID); + } } } + if(deleteFailure) + { + return; + } + + // Check if this file causes any file types to be re-evaluated + CheckMetaDataRealFiles(normalizedPath); + + // when a source is deleted, we also have to queue anything that depended on it, for re-processing: + SourceFileDependencyEntryContainer results; + m_stateData->GetSourceFileDependenciesByDependsOnSource(databaseSourceFile, SourceFileDependencyEntry::DEP_Any, results); + // the jobIdentifiers that have identified it as a job dependency + for (SourceFileDependencyEntry& existingEntry : results) + { + // this row is [Source] --> [Depends on Source]. + QString absolutePath = m_platformConfig->FindFirstMatchingFile(QString::fromUtf8(existingEntry.m_source.c_str())); + if (!absolutePath.isEmpty()) + { + AssessFileInternal(absolutePath, false); + } + // also, update it in the database to be missing, ie, add the "missing file" prefix: + existingEntry.m_dependsOnSource = QString(PlaceHolderFileName + relativePath).toUtf8().constData(); + m_stateData->RemoveSourceFileDependency(existingEntry.m_sourceDependencyID); + m_stateData->SetSourceFileDependency(existingEntry); + } + + // now that the right hand column (in terms of [thing] -> [depends on thing]) has been updated, eliminate anywhere its on the left + // hand side: + results.clear(); + m_stateData->GetDependsOnSourceBySource(databaseSourceFile.toUtf8().constData(), SourceFileDependencyEntry::DEP_Any, results); + m_stateData->RemoveSourceFileDependencies(results); - Q_EMIT SourceDeleted(databaseSourceFile); // note that this removes it from the RC Queue Model, also + Q_EMIT SourceDeleted(databaseSourceFile); // note that this removes it from the RC Queue Model, also } void AssetProcessorManager::AddKnownFoldersRecursivelyForFile(QString fullFile, QString root) @@ -2568,7 +2602,7 @@ namespace AssetProcessor jobdetail.m_jobParam[AZ_CRC(AutoFailReasonKey)] = AZStd::string::format( "Source file ( %s ) contains non ASCII characters.\n" - "Lumberyard currently only supports file paths having ASCII characters and therefore asset processor will not be able to process this file.\n" + "Open 3D Engine currently only supports file paths having ASCII characters and therefore asset processor will not be able to process this file.\n" "Please rename the source file to fix this error.\n", normalizedPath.toUtf8().data()); @@ -2641,7 +2675,7 @@ namespace AssetProcessor AZ::Uuid sourceUUID = AssetUtilities::CreateSafeSourceUUIDFromName(databasePathToFile.toUtf8().data()); AzToolsFramework::AssetSystem::SourceFileNotificationMessage message(AZ::OSString(sourceFile.toUtf8().constData()), AZ::OSString(scanFolderInfo->ScanPath().toUtf8().constData()), AzToolsFramework::AssetSystem::SourceFileNotificationMessage::FileRemoved, sourceUUID); EBUS_EVENT(AssetProcessor::ConnectionBus, Send, 0, message); - CheckDeletedSourceFile(normalizedPath, relativePathToFile, databasePathToFile); + CheckDeletedSourceFile(normalizedPath, relativePathToFile, databasePathToFile, examineFile.m_initialProcessTime); } else { diff --git a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.h b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.h index c4d82d57d0..4c203567e9 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.h +++ b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.h @@ -116,13 +116,15 @@ namespace AssetProcessor QString m_fileName; bool m_isDelete = false; bool m_isFromScanner = false; + AZStd::chrono::system_clock::time_point m_initialProcessTime{}; FileEntry() = default; - FileEntry(const QString& fileName, bool isDelete, bool isFromScanner=false) + FileEntry(const QString& fileName, bool isDelete, bool isFromScanner = false, AZStd::chrono::system_clock::time_point initialProcessTime = {}) : m_fileName(fileName) , m_isDelete(isDelete) , m_isFromScanner(isFromScanner) + , m_initialProcessTime(initialProcessTime) { } @@ -305,7 +307,9 @@ namespace AssetProcessor void CheckSource(const FileEntry& source); void CheckMissingJobs(QString relativeSourceFile, const ScanFolderInfo* scanFolder, const AZStd::vector& jobsThisTime); void CheckDeletedProductFile(QString normalizedPath); - void CheckDeletedSourceFile(QString normalizedPath, QString relativePath, QString databaseSourceFile); + void CheckDeletedSourceFile( + QString normalizedPath, QString relativePath, QString databaseSourceFile, + AZStd::chrono::system_clock::time_point initialProcessTime); void CheckModifiedSourceFile(QString normalizedPath, QString databaseSourceFile, const ScanFolderInfo* scanFolderInfo); bool AnalyzeJob(JobDetails& details); void CheckDeletedCacheFolder(QString normalizedPath); diff --git a/Code/Tools/AssetProcessor/native/resourcecompiler/RCBuilder.cpp b/Code/Tools/AssetProcessor/native/resourcecompiler/RCBuilder.cpp index 8a8e7d6b08..30a7978c50 100644 --- a/Code/Tools/AssetProcessor/native/resourcecompiler/RCBuilder.cpp +++ b/Code/Tools/AssetProcessor/native/resourcecompiler/RCBuilder.cpp @@ -424,12 +424,12 @@ namespace AssetProcessor bool InternalRecognizerBasedBuilder::FindRC(QString& rcAbsolutePathOut) { - char executableDirectory[AZ_MAX_PATH_LEN]; - if (AZ::Utils::GetExecutableDirectory(executableDirectory, AZStd::size(executableDirectory)) == AZ::Utils::ExecutablePathResult::Success) + AZ::IO::FixedMaxPath executableDirectory = AZ::Utils::GetExecutableDirectory(); + executableDirectory /= ASSETPROCESSOR_TRAIT_LEGACY_RC_RELATIVE_PATH; + if (AZ::IO::SystemFile::Exists(executableDirectory.c_str())) { - rcAbsolutePathOut = QString("%1/%2").arg(executableDirectory).arg(QString(ASSETPROCESSOR_TRAIT_LEGACY_RC_RELATIVE_PATH)); - - return AZ::IO::SystemFile::Exists(rcAbsolutePathOut.toUtf8().data()); + rcAbsolutePathOut = QString::fromUtf8(executableDirectory.c_str(), executableDirectory.Native().size()); + return true; } return false; diff --git a/Code/Tools/AssetProcessor/native/tests/assetdatabase/AssetDatabaseTest.cpp b/Code/Tools/AssetProcessor/native/tests/assetdatabase/AssetDatabaseTest.cpp index d057e06a9f..12b202e804 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetdatabase/AssetDatabaseTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/assetdatabase/AssetDatabaseTest.cpp @@ -81,7 +81,7 @@ namespace UnitTests // Product: "someproduct4.dds" subid: 4 void CreateCoverageTestData() { - m_data->m_scanFolder = { "c:/lumberyard/dev", "dev", "rootportkey", "" }; + m_data->m_scanFolder = { "c:/O3DE/dev", "dev", "rootportkey", "" }; ASSERT_TRUE(m_data->m_connection.SetScanFolder(m_data->m_scanFolder)); m_data->m_sourceFile1 = { m_data->m_scanFolder.m_scanFolderID, "somefile.tif", AZ::Uuid::CreateRandom(), "AnalysisFingerprint1"}; @@ -239,7 +239,7 @@ namespace UnitTests // we'll create all of those first (except product) before starting the product test. //add a scanfolder. None of this has to exist in real disk, this is a db test only. - ScanFolderDatabaseEntry scanFolder {"c:/lumberyard/dev", "dev", "rootportkey", ""}; + ScanFolderDatabaseEntry scanFolder {"c:/O3DE/dev", "dev", "rootportkey", ""}; EXPECT_TRUE(m_data->m_connection.SetScanFolder(scanFolder)); ASSERT_NE(scanFolder.m_scanFolderID, AzToolsFramework::AssetDatabase::InvalidEntryId); @@ -278,7 +278,7 @@ namespace UnitTests // to add a product legitimately you have to have a full chain of primary keys, chain is: // ScanFolder --> Source --> job --> product. // we'll create all of those first (except product) before starting the product test. - ScanFolderDatabaseEntry scanFolder{ "c:/lumberyard/dev", "dev", "rootportkey", "" }; + ScanFolderDatabaseEntry scanFolder{ "c:/O3DE/dev", "dev", "rootportkey", "" }; ASSERT_TRUE(m_data->m_connection.SetScanFolder(scanFolder)); SourceDatabaseEntry sourceEntry{ scanFolder.m_scanFolderID, "somefile.tif", AZ::Uuid::CreateRandom(), "fingerprint1" }; @@ -323,7 +323,7 @@ namespace UnitTests // this is actually a very common case (same job id, same subID) TEST_F(AssetDatabaseTest, SetProduct_SpecificPK_Succeeds_SameSubID_SameJobID) { - ScanFolderDatabaseEntry scanFolder{ "c:/lumberyard/dev", "dev", "rootportkey", "" }; + ScanFolderDatabaseEntry scanFolder{ "c:/O3DE/dev", "dev", "rootportkey", "" }; ASSERT_TRUE(m_data->m_connection.SetScanFolder(scanFolder)); SourceDatabaseEntry sourceEntry{ scanFolder.m_scanFolderID, "somefile.tif", AZ::Uuid::CreateRandom(), "fingerprint1" }; ASSERT_TRUE(m_data->m_connection.SetSource(sourceEntry)); diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp index 6c2bf754c1..d8afda1b2c 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp @@ -4540,9 +4540,17 @@ void ModtimeScanningTest::TearDown() void ModtimeScanningTest::ProcessAssetJobs() { + m_data->m_productPaths.clear(); + for (const auto& processResult : m_data->m_processResults) { auto file = QDir(processResult.m_destinationPath).absoluteFilePath(processResult.m_jobEntry.m_databaseSourceName + ".arc1"); + m_data->m_productPaths.emplace( + QDir(processResult.m_jobEntry.m_watchFolderPath) + .absoluteFilePath(processResult.m_jobEntry.m_databaseSourceName) + .toUtf8() + .constData(), + file); // Create the file on disk ASSERT_TRUE(UnitTestUtils::CreateDummyFile(file, "products.")); @@ -4793,6 +4801,123 @@ TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyFile_AndThenRevert_ProcessesAg ExpectWork(2, 2); } +struct LockedFileTest + : ModtimeScanningTest + , AssetProcessor::ConnectionBus::Handler +{ + MOCK_METHOD3(SendRaw, size_t (unsigned, unsigned, const QByteArray&)); + MOCK_METHOD3(SendPerPlatform, size_t (unsigned, const AzFramework::AssetSystem::BaseAssetProcessorMessage&, const QString&)); + MOCK_METHOD4(SendRawPerPlatform, size_t (unsigned, unsigned, const QByteArray&, const QString&)); + MOCK_METHOD2(SendRequest, unsigned (const AzFramework::AssetSystem::BaseAssetProcessorMessage&, const ResponseCallback&)); + MOCK_METHOD2(SendResponse, size_t (unsigned, const AzFramework::AssetSystem::BaseAssetProcessorMessage&)); + MOCK_METHOD1(RemoveResponseHandler, void (unsigned)); + + size_t Send(unsigned, const AzFramework::AssetSystem::BaseAssetProcessorMessage&) override + { + if(m_callback) + { + m_callback(); + } + + return 0; + } + + void SetUp() override + { + ModtimeScanningTest::SetUp(); + + ConnectionBus::Handler::BusConnect(0); + } + + void TearDown() override + { + ConnectionBus::Handler::BusDisconnect(); + + ModtimeScanningTest::TearDown(); + } + + AZStd::function m_callback; +}; + +TEST_F(LockedFileTest, DeleteFile_LockedProduct_DeleteFails) +{ + auto theFile = m_data->m_absolutePath[1].toUtf8(); + const char* theFileString = theFile.constData(); + auto [sourcePath, productPath] = *m_data->m_productPaths.find(theFileString); + + { + QFile file(theFileString); + file.remove(); + } + + ASSERT_GT(m_data->m_productPaths.size(), 0); + QFile product(productPath); + + ASSERT_TRUE(product.open(QIODevice::ReadOnly)); + + // Check if we can delete the file now, if we can't, proceed with the test + // If we can, it means the OS running this test doesn't lock open files so there's nothing to test + if (!AZ::IO::SystemFile::Delete(productPath.toUtf8().constData())) + { + QMetaObject::invokeMethod( + m_assetProcessorManager.get(), "AssessDeletedFile", Qt::QueuedConnection, Q_ARG(QString, QString(theFileString))); + + EXPECT_TRUE(BlockUntilIdle(5000)); + + EXPECT_TRUE(QFile::exists(productPath)); + EXPECT_EQ(m_data->m_deletedSources.size(), 0); + } + else + { + SUCCEED() << "Skipping test. OS does not lock open files."; + } +} + +TEST_F(LockedFileTest, DeleteFile_LockedProduct_DeletesWhenReleased) +{ + auto theFile = m_data->m_absolutePath[1].toUtf8(); + const char* theFileString = theFile.constData(); + auto [sourcePath, productPath] = *m_data->m_productPaths.find(theFileString); + + { + QFile file(theFileString); + file.remove(); + } + + ASSERT_GT(m_data->m_productPaths.size(), 0); + QFile product(productPath); + + ASSERT_TRUE(product.open(QIODevice::ReadOnly)); + + // Check if we can delete the file now, if we can't, proceed with the test + // If we can, it means the OS running this test doesn't lock open files so there's nothing to test + if (!AZ::IO::SystemFile::Delete(productPath.toUtf8().constData())) + { + AZStd::thread workerThread; + + m_callback = [&product, &workerThread]() { + workerThread = AZStd::thread([&product]() { + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(60)); + product.close(); + }); + }; + + QMetaObject::invokeMethod( + m_assetProcessorManager.get(), "AssessDeletedFile", Qt::QueuedConnection, Q_ARG(QString, QString(theFileString))); + + EXPECT_TRUE(BlockUntilIdle(5000)); + + EXPECT_FALSE(QFile::exists(productPath)); + EXPECT_EQ(m_data->m_deletedSources.size(), 1); + + workerThread.join(); + } + else + { + SUCCEED() << "Skipping test. OS does not lock open files."; + } +} + TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyFilesSameHash_BothProcess) { using namespace AzToolsFramework::AssetSystem; diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h index fafb2f4ec3..3c61e87e5d 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.h @@ -174,6 +174,7 @@ struct ModtimeScanningTest QString m_relativePathFromWatchFolder[3]; AZStd::vector m_absolutePath; AZStd::vector m_processResults; + AZStd::unordered_multimap m_productPaths; AZStd::vector m_deletedSources; AZStd::shared_ptr m_builderTxtBuilder; MockBuilderInfoHandler m_mockBuilderInfoHandler; diff --git a/Code/Tools/AssetProcessor/native/ui/ProductAssetDetailsPanel.cpp b/Code/Tools/AssetProcessor/native/ui/ProductAssetDetailsPanel.cpp index 02615c2416..a57bdf8be6 100644 --- a/Code/Tools/AssetProcessor/native/ui/ProductAssetDetailsPanel.cpp +++ b/Code/Tools/AssetProcessor/native/ui/ProductAssetDetailsPanel.cpp @@ -112,7 +112,7 @@ namespace AssetProcessor [&](AzToolsFramework::AssetDatabase::SourceDatabaseEntry& sourceEntry) { assetId = AZ::Data::AssetId(sourceEntry.m_sourceGuid, productItemData->m_databaseInfo.m_subID); - // Use a decimal value to display the sub ID and not hex. Lumberyard is not consistent about + // Use a decimal value to display the sub ID and not hex. Open 3D Engine is not consistent about // how sub IDs are displayed, so it's important to double check what format a sub ID is in before using it elsewhere. m_ui->productAssetIdValueLabel->setText(assetId.ToString(AZ::Data::AssetId::SubIdDisplayType::Decimal).c_str()); diff --git a/Code/Tools/AssetProcessor/native/ui/SourceAssetTreeModel.cpp b/Code/Tools/AssetProcessor/native/ui/SourceAssetTreeModel.cpp index dfb97a4e9d..4d7711acad 100644 --- a/Code/Tools/AssetProcessor/native/ui/SourceAssetTreeModel.cpp +++ b/Code/Tools/AssetProcessor/native/ui/SourceAssetTreeModel.cpp @@ -76,7 +76,7 @@ namespace AssetProcessor AzFramework::StringFunc::AssetDatabasePath::Join(scanFolder.m_scanFolder.c_str(), fullPath.c_str(), fullPath, true, false); - // It's common for Lumberyard game projects and scan folders to be in a subfolder + // It's common for Open 3D Engine game projects and scan folders to be in a subfolder // of the engine install. To improve readability of the source files, strip out // that portion of the path if it overlaps. if (!m_assetRootSet) diff --git a/Code/Tools/AssetProcessor/native/ui/style/AssetProcessor.qrc b/Code/Tools/AssetProcessor/native/ui/style/AssetProcessor.qrc index ef8f688f8b..564d7a2132 100644 --- a/Code/Tools/AssetProcessor/native/ui/style/AssetProcessor.qrc +++ b/Code/Tools/AssetProcessor/native/ui/style/AssetProcessor.qrc @@ -16,6 +16,6 @@ AssetProcessor_arrow_down.svg AssetProcessor_arrow_up.svg AssetProcessor_refresh.png - lyassetprocessor.png + o3de_assetprocessor.png diff --git a/Code/Tools/AssetProcessor/native/ui/style/lyassetprocessor.ico b/Code/Tools/AssetProcessor/native/ui/style/lyassetprocessor.ico deleted file mode 100644 index b9c9e924ee..0000000000 --- a/Code/Tools/AssetProcessor/native/ui/style/lyassetprocessor.ico +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9965c02521822e92baad09dde15064ac0f326d861533725de283bac6e0ce3618 -size 108108 diff --git a/Code/Tools/AssetProcessor/native/ui/style/lyassetprocessor.png b/Code/Tools/AssetProcessor/native/ui/style/lyassetprocessor.png deleted file mode 100644 index 1f8ba21e9a..0000000000 --- a/Code/Tools/AssetProcessor/native/ui/style/lyassetprocessor.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:68f33fe204a433f8c765d524c9b9e42963f5d16c3442f36df87185bcb4555111 -size 8686 diff --git a/Code/Tools/AssetProcessor/native/ui/style/o3de_assetprocessor.ico b/Code/Tools/AssetProcessor/native/ui/style/o3de_assetprocessor.ico new file mode 100644 index 0000000000..2980b6e386 --- /dev/null +++ b/Code/Tools/AssetProcessor/native/ui/style/o3de_assetprocessor.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:424c7e9a5bc4819e838e142ae87c987ce96ef40ff853d4a2610d7f068d635851 +size 107989 diff --git a/Code/Tools/AssetProcessor/native/ui/style/o3de_assetprocessor.png b/Code/Tools/AssetProcessor/native/ui/style/o3de_assetprocessor.png new file mode 100644 index 0000000000..50610c7ff4 --- /dev/null +++ b/Code/Tools/AssetProcessor/native/ui/style/o3de_assetprocessor.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f16c891aaa1686a3735fe84c7a69c3cef24e68af7baa86bf2f54ab4d51b71e8 +size 8489 diff --git a/Code/Tools/AssetProcessor/native/unittests/AssetProcessingStateDataUnitTests.cpp b/Code/Tools/AssetProcessor/native/unittests/AssetProcessingStateDataUnitTests.cpp index bbbea4f170..1ece24210a 100644 --- a/Code/Tools/AssetProcessor/native/unittests/AssetProcessingStateDataUnitTests.cpp +++ b/Code/Tools/AssetProcessor/native/unittests/AssetProcessingStateDataUnitTests.cpp @@ -148,7 +148,7 @@ void AssetProcessingStateDataUnitTest::DataTest(AssetProcessor::AssetDatabaseCon scanFolders.clear(); //add a scanfolder - scanFolder = ScanFolderDatabaseEntry("c:/lumberyard/dev", "dev", "rootportkey", ""); + scanFolder = ScanFolderDatabaseEntry("c:/O3DE/dev", "dev", "rootportkey", ""); UNIT_TEST_EXPECT_TRUE(stateData->SetScanFolder(scanFolder)); if (scanFolder.m_scanFolderID == AzToolsFramework::AssetDatabase::InvalidEntryId) { @@ -158,7 +158,7 @@ void AssetProcessingStateDataUnitTest::DataTest(AssetProcessor::AssetDatabaseCon //add the same folder again, should not add another because it already exists, so we should get the same id // not only that, but the path should update. - ScanFolderDatabaseEntry dupeScanFolder = ScanFolderDatabaseEntry("c:/lumberyard/dev2", "dev", "rootportkey", ""); + ScanFolderDatabaseEntry dupeScanFolder = ScanFolderDatabaseEntry("c:/O3DE/dev2", "dev", "rootportkey", ""); dupeScanFolder.m_scanFolderID = AzToolsFramework::AssetDatabase::InvalidEntryId; UNIT_TEST_EXPECT_TRUE(stateData->SetScanFolder(dupeScanFolder)); if (!(dupeScanFolder == scanFolder)) @@ -174,7 +174,7 @@ void AssetProcessingStateDataUnitTest::DataTest(AssetProcessor::AssetDatabaseCon scanFolders.clear(); UNIT_TEST_EXPECT_TRUE(stateData->GetScanFolders(scanFolders)); UNIT_TEST_EXPECT_TRUE(scanFolders.size() == 1); - UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanPath(scanFolders, "c:/lumberyard/dev2")); + UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanPath(scanFolders, "c:/O3DE/dev2")); UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanFolderID(scanFolders, scanFolder.m_scanFolderID)); UNIT_TEST_EXPECT_TRUE(ScanFoldersContainPortableKey(scanFolders, scanFolder.m_portableKey.c_str())); UNIT_TEST_EXPECT_TRUE(ScanFoldersContainPortableKey(scanFolders, "rootportkey")); @@ -200,7 +200,7 @@ void AssetProcessingStateDataUnitTest::DataTest(AssetProcessor::AssetDatabaseCon } //add another folder - ScanFolderDatabaseEntry gameScanFolderEntry("c:/lumberyard/game", "game", "gameportkey", ""); + ScanFolderDatabaseEntry gameScanFolderEntry("c:/O3DE/game", "game", "gameportkey", ""); UNIT_TEST_EXPECT_TRUE(stateData->SetScanFolder(gameScanFolderEntry)); if (gameScanFolderEntry.m_scanFolderID == AzToolsFramework::AssetDatabase::InvalidEntryId || gameScanFolderEntry.m_scanFolderID == scanFolder.m_scanFolderID) @@ -213,8 +213,8 @@ void AssetProcessingStateDataUnitTest::DataTest(AssetProcessor::AssetDatabaseCon scanFolders.clear(); UNIT_TEST_EXPECT_TRUE(stateData->GetScanFolders(scanFolders)); UNIT_TEST_EXPECT_TRUE(scanFolders.size() == 2); - UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanPath(scanFolders, "c:/lumberyard/dev2")); - UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanPath(scanFolders, "c:/lumberyard/game")); + UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanPath(scanFolders, "c:/O3DE/dev2")); + UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanPath(scanFolders, "c:/O3DE/game")); UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanFolderID(scanFolders, scanFolder.m_scanFolderID)); UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanFolderID(scanFolders, gameScanFolderEntry.m_scanFolderID)); @@ -226,11 +226,11 @@ void AssetProcessingStateDataUnitTest::DataTest(AssetProcessor::AssetDatabaseCon scanFolders.clear(); UNIT_TEST_EXPECT_TRUE(stateData->GetScanFolders(scanFolders)); UNIT_TEST_EXPECT_TRUE(scanFolders.size() == 1); - UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanPath(scanFolders, "c:/lumberyard/dev2")); + UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanPath(scanFolders, "c:/O3DE/dev2")); UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanFolderID(scanFolders, scanFolder.m_scanFolderID)); //add another folder again - gameScanFolderEntry = ScanFolderDatabaseEntry("c:/lumberyard/game", "game", "gameportkey2", ""); + gameScanFolderEntry = ScanFolderDatabaseEntry("c:/O3DE/game", "game", "gameportkey2", ""); UNIT_TEST_EXPECT_TRUE(stateData->SetScanFolder(gameScanFolderEntry)); if (gameScanFolderEntry.m_scanFolderID == AzToolsFramework::AssetDatabase::InvalidEntryId || gameScanFolderEntry.m_scanFolderID == scanFolder.m_scanFolderID) @@ -243,8 +243,8 @@ void AssetProcessingStateDataUnitTest::DataTest(AssetProcessor::AssetDatabaseCon scanFolders.clear(); UNIT_TEST_EXPECT_TRUE(stateData->GetScanFolders(scanFolders)); UNIT_TEST_EXPECT_TRUE(scanFolders.size() == 2); - UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanPath(scanFolders, "c:/lumberyard/dev2")); - UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanPath(scanFolders, "c:/lumberyard/game")); + UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanPath(scanFolders, "c:/O3DE/dev2")); + UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanPath(scanFolders, "c:/O3DE/game")); UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanFolderID(scanFolders, scanFolder.m_scanFolderID)); UNIT_TEST_EXPECT_TRUE(ScanFoldersContainScanFolderID(scanFolders, gameScanFolderEntry.m_scanFolderID)); @@ -258,7 +258,7 @@ void AssetProcessingStateDataUnitTest::DataTest(AssetProcessor::AssetDatabaseCon /////////////////////////////////////////////////////////// //setup for sources tests //for the rest of the test lets add the original scan folder - scanFolder = ScanFolderDatabaseEntry("c:/lumberyard/dev", "dev", "devkey2", ""); + scanFolder = ScanFolderDatabaseEntry("c:/O3DE/dev", "dev", "devkey2", ""); UNIT_TEST_EXPECT_TRUE(stateData->SetScanFolder(scanFolder)); /////////////////////////////////////////////////////////// @@ -370,7 +370,7 @@ void AssetProcessingStateDataUnitTest::DataTest(AssetProcessor::AssetDatabaseCon UNIT_TEST_EXPECT_TRUE(SourcesContainSourceGuid(sources, source.m_sourceGuid)); //add the same source again, but change the scan folder. This should NOT add a new source - even if we don't know what the sourceID is: - ScanFolderDatabaseEntry scanfolder2 = ScanFolderDatabaseEntry("c:/lumberyard/dev2", "dev2", "devkey3", ""); + ScanFolderDatabaseEntry scanfolder2 = ScanFolderDatabaseEntry("c:/O3DE/dev2", "dev2", "devkey3", ""); UNIT_TEST_EXPECT_TRUE(stateData->SetScanFolder(scanfolder2)); SourceDatabaseEntry dupeSource2(source); @@ -554,7 +554,7 @@ void AssetProcessingStateDataUnitTest::DataTest(AssetProcessor::AssetDatabaseCon //////////////////////////////////////////////////////////////// //Setup for jobs tests by having a scan folder and some sources //Add a scan folder - scanFolder = ScanFolderDatabaseEntry("c:/lumberyard/dev", "dev", "devkey3", ""); + scanFolder = ScanFolderDatabaseEntry("c:/O3DE/dev", "dev", "devkey3", ""); UNIT_TEST_EXPECT_TRUE(stateData->SetScanFolder(scanFolder)); //Add some sources diff --git a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp index dc0786d918..10000298c7 100644 --- a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.cpp @@ -115,9 +115,6 @@ ApplicationManager::BeforeRunStatus GUIApplicationManager::BeforeRun() #endif AssetProcessor::MessageInfoBus::Handler::BusConnect(); - QString bootstrapPath = devRoot.filePath("bootstrap.cfg"); - m_qtFileWatcher.addPath(bootstrapPath); - // we have to monitor both the cache folder and the database file and restart AP if either of them gets deleted // It is important to note that we are monitoring the parent folder and not the actual cache folder itself since // we want to handle the use case on Mac OS if the user moves the cache folder to the trash. @@ -135,33 +132,6 @@ ApplicationManager::BeforeRunStatus GUIApplicationManager::BeforeRun() QObject::connect(&m_qtFileWatcher, &QFileSystemWatcher::fileChanged, this, &GUIApplicationManager::FileChanged); QObject::connect(&m_qtFileWatcher, &QFileSystemWatcher::directoryChanged, this, &GUIApplicationManager::DirectoryChanged); - // Register a notifier for when the project_path property changes within the SettingsRegistry - if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) - { - // Needs to be updated to project_path. - auto OnProjectPathChanged = [this, cachedProjectPath = projectPath](AZStd::string_view path, AZ::SettingsRegistryInterface::Type) - { - constexpr auto projectPathKey = - AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) - + "/project_path"; - if (projectPathKey == path) - { - AZ::SettingsRegistryInterface::FixedValueString newProjectPath; - if (auto registry = AZ::SettingsRegistry::Get(); registry && registry->Get(newProjectPath, path)) - { - // we only have to quit if the project path has changed, not if just the bootstrap has changed. - if (cachedProjectPath.compare(newProjectPath.c_str()) != 0) - { - AZ_TracePrintf(AssetProcessor::ConsoleChannel, "bootstrap.cfg Project Path changed from %s to %s. Quitting\n", - cachedProjectPath.toUtf8().constData(), newProjectPath.c_str()); - QMetaObject::invokeMethod(this, "QuitRequested", Qt::QueuedConnection); - } - } - } - }; - m_bootstrapGameFolderChangedHandler = settingsRegistry->RegisterNotifier(AZStd::move(OnProjectPathChanged)); - } - return ApplicationManager::BeforeRunStatus::Status_Success; } @@ -306,7 +276,7 @@ bool GUIApplicationManager::Run() m_trayIcon = new QSystemTrayIcon(m_mainWindow); m_trayIcon->setContextMenu(trayIconMenu); m_trayIcon->setToolTip(QObject::tr("Asset Processor")); - m_trayIcon->setIcon(QIcon(":/lyassetprocessor.png")); + m_trayIcon->setIcon(QIcon(":/o3de_assetprocessor.png")); m_trayIcon->show(); QObject::connect(m_trayIcon, &QSystemTrayIcon::activated, m_mainWindow, [&, wrapper](QSystemTrayIcon::ActivationReason reason) { @@ -328,8 +298,8 @@ bool GUIApplicationManager::Run() if (startHidden) { m_trayIcon->showMessage( - QCoreApplication::translate("Tray Icon", "Lumberyard Asset Processor has started"), - QCoreApplication::translate("Tray Icon", "The Lumberyard Asset Processor monitors raw project assets and converts those assets into runtime-ready data."), + QCoreApplication::translate("Tray Icon", "Open 3D Engine Asset Processor has started"), + QCoreApplication::translate("Tray Icon", "The Open 3D Engine Asset Processor monitors raw project assets and converts those assets into runtime-ready data."), QSystemTrayIcon::Information, 3000); } } @@ -651,29 +621,10 @@ void GUIApplicationManager::DirectoryChanged([[maybe_unused]] QString path) void GUIApplicationManager::FileChanged(QString path) { QDir devRoot = ApplicationManager::GetSystemRoot(); - QString bootstrapPath = devRoot.filePath("bootstrap.cfg"); QDir projectCacheRoot; AssetUtilities::ComputeProjectCacheRoot(projectCacheRoot); QString assetDbPath = projectCacheRoot.filePath("assetdb.sqlite"); - if (QString::compare(AssetUtilities::NormalizeFilePath(path), bootstrapPath, Qt::CaseInsensitive) == 0) - { - AssetUtilities::UpdateBranchToken(); - - if (m_connectionManager) - { - m_connectionManager->UpdateAllowedListFromBootStrap(); - } - - // Re-merge the Bootstrap.cfg into the SettingsRegistry - AZStd::vector scratchBuffer; - AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get(); - AZ_Assert(settingsRegistry, "Unable to retrieve global SettingsRegistry, it should be available now"); - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_Bootstrap(*settingsRegistry); - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_O3deUserRegistry(*settingsRegistry, AZ_TRAIT_OS_PLATFORM_CODENAME, {}); - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_CommandLine(*settingsRegistry, *m_frameworkApp.GetAzCommandLine(), false); - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*settingsRegistry); - } - else if (QString::compare(AssetUtilities::NormalizeFilePath(path), assetDbPath, Qt::CaseInsensitive) == 0) + if (QString::compare(AssetUtilities::NormalizeFilePath(path), assetDbPath, Qt::CaseInsensitive) == 0) { if (!QFile::exists(assetDbPath)) { @@ -868,7 +819,7 @@ void GUIApplicationManager::ShowTrayIconErrorMessage(QString msg) { m_timeWhenLastWarningWasShown = currentTime; m_trayIcon->showMessage( - QCoreApplication::translate("Tray Icon", "Lumberyard Asset Processor"), + QCoreApplication::translate("Tray Icon", "Open 3D Engine Asset Processor"), QCoreApplication::translate("Tray Icon", msg.toUtf8().data()), QSystemTrayIcon::Critical, 3000); } @@ -880,7 +831,7 @@ void GUIApplicationManager::ShowTrayIconMessage(QString msg) if (m_trayIcon && m_mainWindow && !m_mainWindow->isVisible()) { m_trayIcon->showMessage( - QCoreApplication::translate("Tray Icon", "Lumberyard Asset Processor"), + QCoreApplication::translate("Tray Icon", "Open 3D Engine Asset Processor"), QCoreApplication::translate("Tray Icon", msg.toUtf8().data()), QSystemTrayIcon::Information, 3000); } diff --git a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.h b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.h index e824350cef..1947e26ae0 100644 --- a/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.h +++ b/Code/Tools/AssetProcessor/native/utilities/GUIApplicationManager.h @@ -112,7 +112,6 @@ private: QPointer m_trayIcon; QPointer m_mainWindow; - AZ::SettingsRegistryInterface::NotifyEventHandler m_bootstrapGameFolderChangedHandler; AZStd::chrono::system_clock::time_point m_timeWhenLastWarningWasShown; }; diff --git a/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp b/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp index c62078f7ab..b615e8854a 100644 --- a/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp @@ -181,13 +181,29 @@ namespace AssetUtilsInternal if (AZ::SettingsRegistryMergeUtils::DumpSettingsRegistryToStream(settingsRegistry, AssetProcessorUserSettingsRootKey, apSettingsStream, apDumperSettings)) { + constexpr const char* AssetProcessorTmpSetreg = "asset_processor.setreg.tmp"; + // Write to a temporary file first before renaming it to the final file location + // This is needed to reduce the potential of a race condition which occurs when other applications attempt to load settings registry + // files from the project's user Registry folder while the AssetProcessor is writing the file out the asset_processor.setreg + // at the same time + QString tempDirValue; + AssetUtilities::CreateTempWorkspace(tempDirValue); + QDir tempDir(tempDirValue); + AZ::IO::FixedMaxPath tmpSetregPath = tempDir.absoluteFilePath(QString(AssetProcessorTmpSetreg)).toUtf8().data(); constexpr auto modeFlags = AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY | AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH; - if (AZ::IO::SystemFile apSetregFile; apSetregFile.Open(setregPath.c_str(), modeFlags)) + if (AZ::IO::SystemFile apSetregFile; apSetregFile.Open(tmpSetregPath.c_str(), modeFlags)) { size_t bytesWritten = apSetregFile.Write(apSettingsJson.data(), apSettingsJson.size()); - return bytesWritten == apSettingsJson.size(); + // Close the file so that it can be renamed. + apSetregFile.Close(); + if (bytesWritten == apSettingsJson.size()) + { + // Create the directory to contain the moved setreg file + AZ::IO::SystemFile::CreateDir(AZ::IO::FixedMaxPath(setregPath.ParentPath()).c_str()); + return AZ::IO::SystemFile::Rename(tmpSetregPath.c_str(), setregPath.c_str(), true); + } } else { diff --git a/Code/Tools/CrashHandler/Shared/CrashHandler.h b/Code/Tools/CrashHandler/Shared/CrashHandler.h index 86cf31917a..df5185283b 100644 --- a/Code/Tools/CrashHandler/Shared/CrashHandler.h +++ b/Code/Tools/CrashHandler/Shared/CrashHandler.h @@ -21,7 +21,7 @@ namespace CrashHandler { static const char* defaultCrashFolder = "CrashDB/"; - static const char* lumberyardProductName = "lumberyard"; + static const char* O3DEProductName = "Open 3D Engine"; using CrashHandlerAnnotations = std::map; using CrashHandlerArguments = std::vector; @@ -48,7 +48,7 @@ namespace CrashHandler virtual std::string DetermineAppPath() const; - virtual const char* GetProductName() const { return lumberyardProductName; } + virtual const char* GetProductName() const { return O3DEProductName; } virtual bool CreateCrashHandlerDB(const std::string& reportPath) const; diff --git a/Code/Tools/CrashHandler/Tools/UI/submit_report.ui b/Code/Tools/CrashHandler/Tools/UI/submit_report.ui index ae98d536a1..872adac709 100644 --- a/Code/Tools/CrashHandler/Tools/UI/submit_report.ui +++ b/Code/Tools/CrashHandler/Tools/UI/submit_report.ui @@ -80,7 +80,7 @@ - Lumberyard has encountered a fatal error. We're sorry for the inconvenience. + Open 3D Engine has encountered a fatal error. We're sorry for the inconvenience. true @@ -96,7 +96,7 @@ - A Lumberyard Editor crash debugging file has been created at: + An Open 3D Engine Editor crash debugging file has been created at: true @@ -134,7 +134,7 @@ - If you are willing to submit this file to Amazon it will help us improve the Lumberyard experience. We will treat this report as confidential. + If you are willing to submit this file to Amazon it will help us improve the Open 3D Engine experience. We will treat this report as confidential. true diff --git a/Code/Tools/CrashHandler/Tools/Uploader/ToolsCrashUploader.cpp b/Code/Tools/CrashHandler/Tools/Uploader/ToolsCrashUploader.cpp index 9fb85fc585..8162c1093b 100644 --- a/Code/Tools/CrashHandler/Tools/Uploader/ToolsCrashUploader.cpp +++ b/Code/Tools/CrashHandler/Tools/Uploader/ToolsCrashUploader.cpp @@ -32,11 +32,11 @@ #include "UI/ui_submit_report.h" -namespace Lumberyard +namespace O3de { void InstallCrashUploader(int& argc, char* argv[]) { - Lumberyard::CrashUploader::SetCrashUploader(std::make_shared(argc, argv)); + O3de::CrashUploader::SetCrashUploader(std::make_shared(argc, argv)); } QString GetReportString(const std::wstring& reportPath) { diff --git a/Code/Tools/CrashHandler/Tools/Uploader/ToolsCrashUploader.h b/Code/Tools/CrashHandler/Tools/Uploader/ToolsCrashUploader.h index ca7081b0e1..fce321ceb8 100644 --- a/Code/Tools/CrashHandler/Tools/Uploader/ToolsCrashUploader.h +++ b/Code/Tools/CrashHandler/Tools/Uploader/ToolsCrashUploader.h @@ -16,7 +16,7 @@ #include -namespace Lumberyard +namespace O3de { class ToolsCrashUploader : public CrashUploader { diff --git a/Code/Tools/CrashHandler/Tools/Uploader/platforms/win/main.cpp b/Code/Tools/CrashHandler/Tools/Uploader/platforms/win/main.cpp index 54748cddde..0899eeca51 100644 --- a/Code/Tools/CrashHandler/Tools/Uploader/platforms/win/main.cpp +++ b/Code/Tools/CrashHandler/Tools/Uploader/platforms/win/main.cpp @@ -22,10 +22,10 @@ namespace { int HandlerMain(int argc, char* argv[]) { - Lumberyard::InstallCrashUploader(argc, argv); + O3de::InstallCrashUploader(argc, argv); LOG(ERROR) << "Initializing windows crash uploader"; - int resultCode = crashpad::HandlerMain(argc, argv, Lumberyard::CrashUploader::GetCrashUploader()->GetUserStreamSources()); + int resultCode = crashpad::HandlerMain(argc, argv, O3de::CrashUploader::GetCrashUploader()->GetUserStreamSources()); return resultCode; } diff --git a/Code/Tools/CrashHandler/Uploader/include/Uploader/BufferedDataStream.h b/Code/Tools/CrashHandler/Uploader/include/Uploader/BufferedDataStream.h index de7493ec33..6eb25c1857 100644 --- a/Code/Tools/CrashHandler/Uploader/include/Uploader/BufferedDataStream.h +++ b/Code/Tools/CrashHandler/Uploader/include/Uploader/BufferedDataStream.h @@ -16,7 +16,7 @@ #include #include -namespace Lumberyard +namespace O3de { class BufferedDataStream : public crashpad::MinidumpUserExtensionStreamDataSource { diff --git a/Code/Tools/CrashHandler/Uploader/include/Uploader/CrashUploader.h b/Code/Tools/CrashHandler/Uploader/include/Uploader/CrashUploader.h index 7ce677a8f8..dee0c03e67 100644 --- a/Code/Tools/CrashHandler/Uploader/include/Uploader/CrashUploader.h +++ b/Code/Tools/CrashHandler/Uploader/include/Uploader/CrashUploader.h @@ -28,7 +28,7 @@ #include #include -namespace Lumberyard +namespace O3de { bool CheckConfirmation(const crashpad::CrashReportDatabase::Report& report); void InstallCrashUploader(int& argc, char* argv[]); diff --git a/Code/Tools/CrashHandler/Uploader/include/Uploader/FileStreamDataSource.h b/Code/Tools/CrashHandler/Uploader/include/Uploader/FileStreamDataSource.h index 0fec400c7a..0193b185ff 100644 --- a/Code/Tools/CrashHandler/Uploader/include/Uploader/FileStreamDataSource.h +++ b/Code/Tools/CrashHandler/Uploader/include/Uploader/FileStreamDataSource.h @@ -16,7 +16,7 @@ #include #include "base/files/file_path.h" -namespace Lumberyard +namespace O3de { class FileStreamDataSource : public crashpad::UserStreamDataSource { diff --git a/Code/Tools/CrashHandler/Uploader/src/BufferedDataStream.cpp b/Code/Tools/CrashHandler/Uploader/src/BufferedDataStream.cpp index 28dea132c0..d744a193d4 100644 --- a/Code/Tools/CrashHandler/Uploader/src/BufferedDataStream.cpp +++ b/Code/Tools/CrashHandler/Uploader/src/BufferedDataStream.cpp @@ -12,7 +12,7 @@ #include -namespace Lumberyard +namespace O3de { BufferedDataStream::BufferedDataStream(uint32_t stream_type, const void* data, size_t data_size) : crashpad::MinidumpUserExtensionStreamDataSource(stream_type) diff --git a/Code/Tools/CrashHandler/Uploader/src/CrashUploader.cpp b/Code/Tools/CrashHandler/Uploader/src/CrashUploader.cpp index 6ad2e8ab14..037b3aee5b 100644 --- a/Code/Tools/CrashHandler/Uploader/src/CrashUploader.cpp +++ b/Code/Tools/CrashHandler/Uploader/src/CrashUploader.cpp @@ -25,7 +25,7 @@ #include -namespace Lumberyard +namespace O3de { using namespace crashpad; diff --git a/Code/Tools/CrashHandler/Uploader/src/FileStreamDataSource.cpp b/Code/Tools/CrashHandler/Uploader/src/FileStreamDataSource.cpp index 6a9520c84b..57b1fc59f2 100644 --- a/Code/Tools/CrashHandler/Uploader/src/FileStreamDataSource.cpp +++ b/Code/Tools/CrashHandler/Uploader/src/FileStreamDataSource.cpp @@ -15,7 +15,7 @@ #include -namespace Lumberyard +namespace O3de { FileStreamDataSource::FileStreamDataSource(const base::FilePath& filePath) : m_filePath{ filePath } diff --git a/Code/Tools/CrySCompileServer/CrySCompileServer/Core/Server/CrySimpleSock.cpp b/Code/Tools/CrySCompileServer/CrySCompileServer/Core/Server/CrySimpleSock.cpp index a8ac0f7699..e0cbd8d733 100644 --- a/Code/Tools/CrySCompileServer/CrySCompileServer/Core/Server/CrySimpleSock.cpp +++ b/Code/Tools/CrySCompileServer/CrySCompileServer/Core/Server/CrySimpleSock.cpp @@ -44,7 +44,7 @@ namespace }; static AZStd::atomic_long numberOfOpenSockets = {0}; - const int MAX_DATA_SIZE = 1024 * 1024; // Only allow 1 MB of data to come through. Lumberyard Game Engine has the same size constraint + const int MAX_DATA_SIZE = 1024 * 1024; // Only allow 1 MB of data to come through. Open 3D Engine has the same size constraint const size_t BLOCKSIZE = 4 * 1024; const size_t MAX_ERROR_MESSAGE_SIZE = 1024; const size_t MAX_HOSTNAME_BUFFER_SIZE = 1024; diff --git a/Code/Tools/DeltaCataloger/CMakeLists.txt b/Code/Tools/DeltaCataloger/CMakeLists.txt index c66f44ec66..b250df3ecb 100644 --- a/Code/Tools/DeltaCataloger/CMakeLists.txt +++ b/Code/Tools/DeltaCataloger/CMakeLists.txt @@ -13,17 +13,32 @@ if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() +if(PAL_HOST_PLATFORM_NAME_LOWERCASE STREQUAL "windows") ly_add_target( NAME DeltaCataloger EXECUTABLE NAMESPACE AZ FILES_CMAKE deltacataloger_files.cmake + deltacataloger_win_files.cmake BUILD_DEPENDENCIES PRIVATE AZ::AzCore AZ::AzFramework AZ::AzToolsFramework ) +else() +ly_add_target( + NAME DeltaCataloger EXECUTABLE + NAMESPACE AZ + FILES_CMAKE + deltacataloger_files.cmake + BUILD_DEPENDENCIES + PRIVATE + AZ::AzCore + AZ::AzFramework + AZ::AzToolsFramework +) +endif() if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) diff --git a/Code/Tools/DeltaCataloger/deltacataloger_win_files.cmake b/Code/Tools/DeltaCataloger/deltacataloger_win_files.cmake new file mode 100644 index 0000000000..44152c82a8 --- /dev/null +++ b/Code/Tools/DeltaCataloger/deltacataloger_win_files.cmake @@ -0,0 +1,14 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +set(FILES + source/DeltaCataloger.rc +) diff --git a/Code/Tools/DeltaCataloger/source/DeltaCataloger.ico b/Code/Tools/DeltaCataloger/source/DeltaCataloger.ico new file mode 100644 index 0000000000..f6a69c0059 --- /dev/null +++ b/Code/Tools/DeltaCataloger/source/DeltaCataloger.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02a102aad5a014f2dc8cfcfb3f502ccf45207e2f8aca946b84e910488e4027c5 +size 103189 diff --git a/Code/Tools/DeltaCataloger/source/DeltaCataloger.rc b/Code/Tools/DeltaCataloger/source/DeltaCataloger.rc new file mode 100644 index 0000000000..5f939051d2 --- /dev/null +++ b/Code/Tools/DeltaCataloger/source/DeltaCataloger.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "DeltaCataloger.ico" diff --git a/Code/Tools/HLSLCrossCompiler/include/hlslcc.h b/Code/Tools/HLSLCrossCompiler/include/hlslcc.h index 14f96c9988..efa43d8f4f 100644 --- a/Code/Tools/HLSLCrossCompiler/include/hlslcc.h +++ b/Code/Tools/HLSLCrossCompiler/include/hlslcc.h @@ -503,7 +503,7 @@ typedef enum _FRAMEBUFFER_FETCH_TYPE // NOTE: HLSLCC flags are specified by command line when executing this cross compiler. // If these flags change, the command line switch '-flags=XXX' must change as well. -// Lumberyard composes the command line in file 'dev\Code\CryEngine\RenderDll\Common\Shaders\RemoteCompiler.cpp' +// Open 3D Engine composes the command line in file 'dev\Code\CryEngine\RenderDll\Common\Shaders\RemoteCompiler.cpp' /*HLSL constant buffers are treated as default-block unform arrays by default. This is done to support versions of GLSL which lack ARB_uniform_buffer_object functionality. diff --git a/Code/Tools/HLSLCrossCompilerMETAL/include/hlslcc.h b/Code/Tools/HLSLCrossCompilerMETAL/include/hlslcc.h index 23458d4933..b7444121bc 100644 --- a/Code/Tools/HLSLCrossCompilerMETAL/include/hlslcc.h +++ b/Code/Tools/HLSLCrossCompilerMETAL/include/hlslcc.h @@ -445,7 +445,7 @@ typedef struct // NOTE: HLSLCC flags are specified by command line when executing this cross compiler. // If these flags change, the command line switch '-flags=XXX' must change as well. -// Lumberyard composes the command line in file 'dev\Code\CryEngine\RenderDll\Common\Shaders\RemoteCompiler.cpp' +// Open 3D Engine composes the command line in file 'dev\Code\CryEngine\RenderDll\Common\Shaders\RemoteCompiler.cpp' /*HLSL constant buffers are treated as default-block unform arrays by default. This is done to support versions of GLSL which lack ARB_uniform_buffer_object functionality. diff --git a/Code/Tools/News/NewsBuilder/Qt/NewsBuilder.cpp b/Code/Tools/News/NewsBuilder/Qt/NewsBuilder.cpp index e505b52256..074099a4e6 100644 --- a/Code/Tools/News/NewsBuilder/Qt/NewsBuilder.cpp +++ b/Code/Tools/News/NewsBuilder/Qt/NewsBuilder.cpp @@ -165,7 +165,7 @@ namespace News QCustomMessageBox msgBox( QCustomMessageBox::Critical, tr("Publish resources"), - tr("You are about to overwrite the current Lumberyard Welcome Message. Are you sure you want to publish?"), + tr("You are about to overwrite the current Open 3D Engine Welcome Message. Are you sure you want to publish?"), this); msgBox.AddButton("Yes", Yes); msgBox.AddButton("No", No); diff --git a/Code/Tools/News/NewsShared/Qt/ArticleErrorView.ui b/Code/Tools/News/NewsShared/Qt/ArticleErrorView.ui index 8d5e914486..c94c636720 100644 --- a/Code/Tools/News/NewsShared/Qt/ArticleErrorView.ui +++ b/Code/Tools/News/NewsShared/Qt/ArticleErrorView.ui @@ -168,7 +168,7 @@ a { text-decoration: underline; color: red } - We couldn’t connect to the network or access our news database. To see the latest Lumberyard news, blogs, tutorials, and more, please visit the <a href="http://aws.amazon.com/lumberyard/">Lumberyard website</a>. + We couldn’t connect to the network or access our news database. To see the latest Open 3D Engine news, blogs, tutorials, and more, please visit the <a href="http://aws.amazon.com/lumberyard/">Lumberyard website</a>. Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter diff --git a/Code/Tools/RC/ResourceCompiler/CMakeLists.txt b/Code/Tools/RC/ResourceCompiler/CMakeLists.txt index c0cbca5a41..5b56071a62 100644 --- a/Code/Tools/RC/ResourceCompiler/CMakeLists.txt +++ b/Code/Tools/RC/ResourceCompiler/CMakeLists.txt @@ -23,7 +23,6 @@ ly_add_target( Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake INCLUDE_DIRECTORIES PUBLIC - PCH . .. BUILD_DEPENDENCIES diff --git a/Code/Tools/RC/ResourceCompiler/ResourceCompiler.cpp b/Code/Tools/RC/ResourceCompiler/ResourceCompiler.cpp index 42b123cfdd..54224c661c 100644 --- a/Code/Tools/RC/ResourceCompiler/ResourceCompiler.cpp +++ b/Code/Tools/RC/ResourceCompiler/ResourceCompiler.cpp @@ -1284,10 +1284,6 @@ void ResourceCompiler::LogMultiLine(const char* szText) *pLine++ = *p++; } - while (*p) - { - ; - } } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Tools/RC/ResourceCompiler/ResourceCompiler.rc b/Code/Tools/RC/ResourceCompiler/ResourceCompiler.rc index 7fab104d9b..b2f6af7583 100644 --- a/Code/Tools/RC/ResourceCompiler/ResourceCompiler.rc +++ b/Code/Tools/RC/ResourceCompiler/ResourceCompiler.rc @@ -73,7 +73,7 @@ BEGIN VALUE "FileVersion", "1.1.8.6" VALUE "InternalName", "ResourceCompiler" VALUE "LegalCopyright", "Portions of this file Copyright (c) Amazon.com, Inc. or its affiliates. All Rights Reserved. Original file Copyright (c) Crytek GMBH. Used under license by Amazon.com, Inc. and its affiliates." - VALUE "LegalTrademarks", "Lumberyard" + VALUE "LegalTrademarks", "Open 3D Engine" VALUE "OriginalFilename", "rc.exe" VALUE "ProductName", "Resource Compiler" VALUE "ProductVersion", "1.1.8.6" diff --git a/Code/Tools/RC/ResourceCompiler/main.cpp b/Code/Tools/RC/ResourceCompiler/main.cpp index 1289452e53..02dbd406d8 100644 --- a/Code/Tools/RC/ResourceCompiler/main.cpp +++ b/Code/Tools/RC/ResourceCompiler/main.cpp @@ -408,7 +408,7 @@ int rcmain(int argc, char** argv, [[maybe_unused]] char** envp) Config mainConfig; mainConfig.SetConfigKeyRegistry(&rc); - QSettings settings("HKEY_CURRENT_USER\\Software\\Amazon\\Lumberyard\\Settings", QSettings::NativeFormat); + QSettings settings("HKEY_CURRENT_USER\\Software\\Amazon\\O3DE\\Settings", QSettings::NativeFormat); bool enableSourceControl = settings.value("RC_EnableSourceControl", true).toBool(); mainConfig.SetKeyValue(eCP_PriorityCmdline, "nosourcecontrol", enableSourceControl ? "0" : "1"); diff --git a/Code/Tools/RC/ResourceCompilerPC/CMakeLists.txt b/Code/Tools/RC/ResourceCompilerPC/CMakeLists.txt index 5fd28f7e7e..bf582ee26c 100644 --- a/Code/Tools/RC/ResourceCompilerPC/CMakeLists.txt +++ b/Code/Tools/RC/ResourceCompilerPC/CMakeLists.txt @@ -23,7 +23,6 @@ ly_add_target( INCLUDE_DIRECTORIES PUBLIC . - PCH COMPILE_DEFINITIONS PRIVATE RESOURCE_COMPILER diff --git a/Code/Tools/RC/ResourceCompilerScene/Common/MaterialExporter.cpp b/Code/Tools/RC/ResourceCompilerScene/Common/MaterialExporter.cpp index 4a1ee4c5c1..32e13de700 100644 --- a/Code/Tools/RC/ResourceCompilerScene/Common/MaterialExporter.cpp +++ b/Code/Tools/RC/ResourceCompilerScene/Common/MaterialExporter.cpp @@ -306,7 +306,7 @@ Change FBX Setting's \"Update Materials\" to true or modify the associated mater if (index == GFxFramework::MaterialExport::g_materialNotFound) { - AZ_TracePrintf(SceneAPI::Utilities::ErrorWindow, "Unable to find material named %s in mtl file while building FBX to Lumberyard material index table.", nodeName.c_str()); + AZ_TracePrintf(SceneAPI::Utilities::ErrorWindow, "Unable to find material named %s in mtl file while building FBX to Open 3D Engine material index table.", nodeName.c_str()); result += SceneEvents::ProcessingResult::Failure; } table.push_back(index); diff --git a/Code/Tools/RC/ResourceCompilerXML/CMakeLists.txt b/Code/Tools/RC/ResourceCompilerXML/CMakeLists.txt index 3a83c3c20a..77ba46bc7c 100644 --- a/Code/Tools/RC/ResourceCompilerXML/CMakeLists.txt +++ b/Code/Tools/RC/ResourceCompilerXML/CMakeLists.txt @@ -22,7 +22,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE . - PCH BUILD_DEPENDENCIES PRIVATE 3rdParty::Qt::Core diff --git a/Code/Tools/SceneAPI/FbxSDKWrapper/CMakeLists.txt b/Code/Tools/SceneAPI/FbxSDKWrapper/CMakeLists.txt index f4d0a18fe2..ac8af3fdaa 100644 --- a/Code/Tools/SceneAPI/FbxSDKWrapper/CMakeLists.txt +++ b/Code/Tools/SceneAPI/FbxSDKWrapper/CMakeLists.txt @@ -15,6 +15,8 @@ if (NOT PAL_TRAIT_BUILD_HOST_TOOLS) return() endif() +ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) + ly_add_target( NAME FbxSDKWrapper STATIC NAMESPACE AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/FbxMaterialImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/FbxMaterialImporter.cpp index 3ae5828df4..199f476ec0 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/FbxMaterialImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/FbxMaterialImporter.cpp @@ -138,7 +138,7 @@ namespace AZ AZ_TracePrintf(Utilities::WarningWindow, "Opacity has been changed from 0 to full. Some DCC tools ignore the opacity and " "write 0 to indicate opacity is not used. This causes meshes to turn invisible, which is often not the intention so " "the opacity has been set to full automatically. If the intention was for a fully transparent mesh, please update " - "the opacity in Lumberyards material editor."); + "the opacity in Open 3D Engine's material editor."); } material->SetOpacity(opacity); diff --git a/Code/Tools/SceneAPI/SceneData/Groups/MeshGroup.cpp b/Code/Tools/SceneAPI/SceneData/Groups/MeshGroup.cpp index d51aadb2f2..6ba39e6a65 100644 --- a/Code/Tools/SceneAPI/SceneData/Groups/MeshGroup.cpp +++ b/Code/Tools/SceneAPI/SceneData/Groups/MeshGroup.cpp @@ -98,9 +98,9 @@ namespace AZ ->Attribute("AutoExpand", true) ->Attribute(Edit::Attributes::NameLabelOverride, "") ->DataElement(AZ_CRC("ManifestName", 0x5215b349), &MeshGroup::m_name, "Name mesh", - "Name the mesh as you want it to appear in the Lumberyard Asset Browser.") + "Name the mesh as you want it to appear in the Open 3D Engine Asset Browser.") ->Attribute("FilterType", DataTypes::IMeshGroup::TYPEINFO_Uuid()) - ->DataElement(Edit::UIHandlers::Default, &MeshGroup::m_nodeSelectionList, "Select meshes", "Select 1 or more meshes to add to this asset in the Lumberyard Asset Browser.") + ->DataElement(Edit::UIHandlers::Default, &MeshGroup::m_nodeSelectionList, "Select meshes", "Select 1 or more meshes to add to this asset in the Open 3D Engine Asset Browser.") ->Attribute("FilterName", "meshes") ->Attribute("FilterType", DataTypes::IMeshData::TYPEINFO_Uuid()) ->DataElement(Edit::UIHandlers::Default, &MeshGroup::m_rules, "", "Add or remove rules to fine-tune the export process.") diff --git a/Code/Tools/SceneAPI/SceneData/Groups/SkeletonGroup.cpp b/Code/Tools/SceneAPI/SceneData/Groups/SkeletonGroup.cpp index 142682ca76..bed8397714 100644 --- a/Code/Tools/SceneAPI/SceneData/Groups/SkeletonGroup.cpp +++ b/Code/Tools/SceneAPI/SceneData/Groups/SkeletonGroup.cpp @@ -98,7 +98,7 @@ namespace AZ ->Attribute("AutoExpand", true) ->Attribute(Edit::Attributes::NameLabelOverride, "") ->DataElement(AZ_CRC("ManifestName", 0x5215b349), &SkeletonGroup::m_name, "Name skeleton", - "Name the skeleton as you want it to appear in the Lumberyard Asset Browser.") + "Name the skeleton as you want it to appear in the Open 3D Engine Asset Browser.") ->Attribute("FilterType", DataTypes::ISkeletonGroup::TYPEINFO_Uuid()) ->DataElement("NodeListSelection", &SkeletonGroup::m_selectedRootBone, "Select root bone", "Select the root bone of the skeleton.") ->Attribute("ClassTypeIdFilter", AZ::SceneData::GraphData::RootBoneData::TYPEINFO_Uuid()) diff --git a/Code/Tools/SceneAPI/SceneData/Groups/SkinGroup.cpp b/Code/Tools/SceneAPI/SceneData/Groups/SkinGroup.cpp index 7b196e19cb..6b16ab14b4 100644 --- a/Code/Tools/SceneAPI/SceneData/Groups/SkinGroup.cpp +++ b/Code/Tools/SceneAPI/SceneData/Groups/SkinGroup.cpp @@ -103,9 +103,9 @@ namespace AZ ->Attribute("AutoExpand", true) ->Attribute(AZ::Edit::Attributes::NameLabelOverride, "") ->DataElement(AZ_CRC("ManifestName", 0x5215b349), &SkinGroup::m_name, "Name skin", - "Name the skin as you want it to appear in the Lumberyard Asset Browser.") + "Name the skin as you want it to appear in the Open 3D Engine Asset Browser.") ->Attribute("FilterType", DataTypes::ISkinGroup::TYPEINFO_Uuid()) - ->DataElement(AZ_CRC("ManifestName", 0x5215b349), &SkinGroup::m_nodeSelectionList, "Select skins", "Select 1 or more skins to add to this asset in the Lumberyard Asset Browser.") + ->DataElement(AZ_CRC("ManifestName", 0x5215b349), &SkinGroup::m_nodeSelectionList, "Select skins", "Select 1 or more skins to add to this asset in the Open 3D Engine Asset Browser.") ->Attribute("FilterName", "skins") ->Attribute("FilterVirtualType", Behaviors::SkinGroup::s_skinVirtualType) ->DataElement(Edit::UIHandlers::Default, &SkinGroup::m_rules, "", "Add or remove rules to fine-tune the export process.") diff --git a/Code/Tools/SceneAPI/SceneData/Rules/BlendShapeRule.cpp b/Code/Tools/SceneAPI/SceneData/Rules/BlendShapeRule.cpp index b7f0353f5a..3563375e40 100644 --- a/Code/Tools/SceneAPI/SceneData/Rules/BlendShapeRule.cpp +++ b/Code/Tools/SceneAPI/SceneData/Rules/BlendShapeRule.cpp @@ -55,7 +55,7 @@ namespace AZ EditContext* editContext = serializeContext->GetEditContext(); if (editContext) { - editContext->Class("Blend shapes", "Select mesh targets to configure blend shapes at a later time using Lumberyard.") + editContext->Class("Blend shapes", "Select mesh targets to configure blend shapes at a later time using Open 3D Engine.") ->ClassElement(Edit::ClassElements::EditorData, "") ->Attribute("AutoExpand", true) ->Attribute(AZ::Edit::Attributes::NameLabelOverride, "") diff --git a/Code/Tools/SceneAPI/SceneData/Rules/MaterialRule.cpp b/Code/Tools/SceneAPI/SceneData/Rules/MaterialRule.cpp index 00538019a2..e9efa7e136 100644 --- a/Code/Tools/SceneAPI/SceneData/Rules/MaterialRule.cpp +++ b/Code/Tools/SceneAPI/SceneData/Rules/MaterialRule.cpp @@ -59,7 +59,7 @@ namespace AZ ->ClassElement(Edit::ClassElements::EditorData, "") ->Attribute("AutoExpand", true) ->Attribute(AZ::Edit::Attributes::NameLabelOverride, "") - ->DataElement(Edit::UIHandlers::Default, &MaterialRule::m_updateMaterials, "Update materials", "Checking this box will accept changes made in the source file into the Lumberyard asset.") + ->DataElement(Edit::UIHandlers::Default, &MaterialRule::m_updateMaterials, "Update materials", "Checking this box will accept changes made in the source file into the Open 3D Engine asset.") ->DataElement(Edit::UIHandlers::Default, &MaterialRule::m_removeMaterials, "Remove unused materials","Detects and removes material files from the game project that are not present in the source file."); } } diff --git a/Code/Tools/ShaderCacheGen/ShaderCacheGen/ShaderCacheGen.cpp b/Code/Tools/ShaderCacheGen/ShaderCacheGen/ShaderCacheGen.cpp index 2988886d5b..4dbf6a9f90 100644 --- a/Code/Tools/ShaderCacheGen/ShaderCacheGen/ShaderCacheGen.cpp +++ b/Code/Tools/ShaderCacheGen/ShaderCacheGen/ShaderCacheGen.cpp @@ -101,8 +101,9 @@ bool DisplayYesNoMessageBox(const char* title, const char* message) return MessageBox(0, message, title, MB_YESNO) == IDYES; #elif defined(AZ_PLATFORM_MAC) return MessageBox(title, message, CFSTR("Yes"), CFSTR("No")) == kCFUserNotificationDefaultResponse; -#endif +#else return false; +#endif } void DisplayErrorMessageBox(const char* message) @@ -129,10 +130,10 @@ void ClearPlatformCVars(ISystem* pISystem) pISystem->GetIConsole()->ExecuteString("r_ShadersOrbis = 0"); } -bool IsLumberyardRunning() +bool IsO3DERunning() { bool isRunning = false; - const char* mutexName = "LumberyardApplication"; + const char* mutexName = "O3DEApplication"; #if defined(AZ_PLATFORM_WINDOWS) HANDLE mutex = CreateMutex(NULL, TRUE, mutexName); isRunning = GetLastError() == ERROR_ALREADY_EXISTS; @@ -222,17 +223,17 @@ int main_wrapped(int argc, char* argv[]) s_displayMessageBox = false; } - if (IsLumberyardRunning()) + if (IsO3DERunning()) { if (CryStringUtils::stristr(commandLine, "-devmode") == 0) { - DisplayErrorMessageBox("There is already a Lumberyard application running. Cannot start another one!"); + DisplayErrorMessageBox("There is already a Open 3D Engine application running. Cannot start another one!"); return errorCode; } if (s_displayMessageBox) { - if (!DisplayYesNoMessageBox("Too many apps", "There is already a Lumberyard application running\nDo you want to start another one?")) + if (!DisplayYesNoMessageBox("Too many apps", "There is already a Open 3D Engine application running\nDo you want to start another one?")) { return errorCode; } diff --git a/Code/Tools/Standalone/Source/Editor/hex_lua.ico b/Code/Tools/Standalone/Source/Editor/hex_lua.ico index 5bd0dee97f..04682d48bb 100644 --- a/Code/Tools/Standalone/Source/Editor/hex_lua.ico +++ b/Code/Tools/Standalone/Source/Editor/hex_lua.ico @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8b291f16009fb4e8611eec975c418d718ff86a77e43fba4a6f025c2e17475fb7 -size 2238 +oid sha256:da0769acdcfeeb65d2824b287edbb2f65daebe7909c1b551c520db1a3b7fa236 +size 108040 diff --git a/Code/Tools/Standalone/Source/StandaloneToolsApplication.cpp b/Code/Tools/Standalone/Source/StandaloneToolsApplication.cpp index 4b181cfb16..d1daac40c3 100644 --- a/Code/Tools/Standalone/Source/StandaloneToolsApplication.cpp +++ b/Code/Tools/Standalone/Source/StandaloneToolsApplication.cpp @@ -97,7 +97,7 @@ namespace StandaloneTools { const int k_processIntervalInSecs = 2; const bool doSDKInitShutdown = true; - EBUS_EVENT(Telemetry::TelemetryEventsBus, Initialize, "LumberyardIDE", k_processIntervalInSecs, doSDKInitShutdown); + EBUS_EVENT(Telemetry::TelemetryEventsBus, Initialize, "O3DE_IDE", k_processIntervalInSecs, doSDKInitShutdown); bool launched = LaunchDiscoveryService(); diff --git a/Gems/AWSCore/Code/Source/Framework/AWSApiJob.cpp b/Gems/AWSCore/Code/Source/Framework/AWSApiJob.cpp index 0a78c43473..9012554144 100644 --- a/Gems/AWSCore/Code/Source/Framework/AWSApiJob.cpp +++ b/Gems/AWSCore/Code/Source/Framework/AWSApiJob.cpp @@ -31,7 +31,7 @@ namespace AWSCore static AwsApiJobConfigHolder s_configHolder{}; return s_configHolder.GetConfig(nullptr, [](AwsApiJobConfig& config) { - config.userAgent = "/Lumberyard_AwsApiJob"; + config.userAgent = "/O3DE_AwsApiJob"; config.requestTimeoutMs = 30000; config.connectTimeoutMs = 30000; } diff --git a/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp b/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp index ad8b0d61f1..4f94c91dcd 100644 --- a/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/AWSCoreSystemComponentTest.cpp @@ -130,7 +130,7 @@ TEST_F(AWSCoreSystemComponentTest, GetDefaultJobContext_Call_JobContextIsNotNull TEST_F(AWSCoreSystemComponentTest, GetDefaultConfig_Call_GetConfigWithExpectedValue) { auto actualDefaultConfig = m_coreSystemsComponent->GetDefaultConfig(); - EXPECT_TRUE(actualDefaultConfig->userAgent == "/Lumberyard_AwsApiJob"); + EXPECT_TRUE(actualDefaultConfig->userAgent == "/O3DE_AwsApiJob"); EXPECT_TRUE(actualDefaultConfig->requestTimeoutMs == 30000); EXPECT_TRUE(actualDefaultConfig->connectTimeoutMs == 30000); diff --git a/Gems/AWSMetrics/Code/Source/IdentityProvider.cpp b/Gems/AWSMetrics/Code/Source/IdentityProvider.cpp index fa0f6db9aa..8742872091 100644 --- a/Gems/AWSMetrics/Code/Source/IdentityProvider.cpp +++ b/Gems/AWSMetrics/Code/Source/IdentityProvider.cpp @@ -27,7 +27,7 @@ namespace AWSMetrics AZStd::string IdentityProvider::GetEngineVersion() { static constexpr const char* EngineConfigFilePath = "@root@/engine.json"; - static constexpr const char* EngineVersionJsonKey = "LumberyardVersion"; + static constexpr const char* EngineVersionJsonKey = "O3DEVersion"; AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetDirectInstance(); if (!fileIO) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/Cubemap.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/Cubemap.h index f26c114af6..e6ac1e3977 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/Cubemap.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/Cubemap.h @@ -14,7 +14,7 @@ namespace ImageProcessingAtom { - // note: lumberyard is right hand Z up coordinate + // note: O3DE is right hand Z up coordinate // please don't change the order of the enum since we are using it to match the face id defined in AMD's CubemapGen // and they are using left hand Y up coordinate enum CubemapFace diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/ImageLoaders.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/ImageLoaders.h index d3b0596fce..b16ae49860 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/ImageLoaders.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageLoader/ImageLoaders.h @@ -49,7 +49,7 @@ namespace ImageProcessingAtom bool IsExtensionSupported(const char* extension); IImageObject* LoadImageFromFile(const AZStd::string& filename); - // These functions are for loading legacy lumberyard dds files + // These functions are for loading legacy O3DE dds files IImageObject* LoadImageFromFileLegacy(const AZStd::string& filename); IImageObject* LoadImageFromFileStreamLegacy(AZ::IO::SystemFileStream& fileLoadStream); IImageObject* LoadAttachedImageFromDdsFileLegacy(const AZStd::string& filename, IImageObjectPtr originImage); diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/DDSHeader.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/DDSHeader.h index d60c42b7fe..f280d4df48 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/DDSHeader.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Processing/DDSHeader.h @@ -144,7 +144,7 @@ namespace ImageProcessingAtom AZ::u32 reserved; }; - // Dds header for lumberyard dds format. + // Dds header for O3DE dds format. // It has same size as standard dds header but uses several reserved slots for customized information struct DDS_HEADER_LEGACY { diff --git a/Gems/Atom/Asset/Shader/Code/CMakeLists.txt b/Gems/Atom/Asset/Shader/Code/CMakeLists.txt index cbe80ffa83..7d82ca5869 100644 --- a/Gems/Atom/Asset/Shader/Code/CMakeLists.txt +++ b/Gems/Atom/Asset/Shader/Code/CMakeLists.txt @@ -30,8 +30,6 @@ if(NOT PAL_TRAIT_BUILD_ATOM_ASSET_SHADER_SUPPORTED) INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE AZ::AzCore @@ -56,8 +54,6 @@ ly_add_target( Source Source/Editor ${pal_source_dir} - PUBLIC - Include COMPILE_DEFINITIONS PRIVATE NOT_USE_CRY_MEMORY_MANAGER @@ -95,8 +91,6 @@ ly_add_target( PRIVATE Source Source/Editor - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE 3rdParty::mcpp diff --git a/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp b/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp index f4825bca5b..099e9062cf 100644 --- a/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp +++ b/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp @@ -115,7 +115,7 @@ namespace AZ { // GFX TODO - investigate window creation being part of the GameApplication. - m_nativeWindow = AZStd::make_unique("LumberyardLauncher", AzFramework::WindowGeometry(0, 0, 1920, 1080)); + m_nativeWindow = AZStd::make_unique("O3DELauncher", AzFramework::WindowGeometry(0, 0, 1920, 1080)); AZ_Assert(m_nativeWindow, "Failed to create the game window\n"); m_nativeWindow->Activate(); @@ -378,6 +378,23 @@ namespace AZ { m_simulateTime += deltaTime; m_deltaTime = deltaTime; + + // Temp: When running in the launcher without the legacy renderer + // we need to call RenderTick on the viewport context each frame. + if (m_viewportContext) + { + AZ::ApplicationTypeQuery appType; + ComponentApplicationBus::Broadcast(&AZ::ComponentApplicationBus::Events::QueryApplicationType, appType); + if (appType.IsGame()) + { + m_viewportContext->RenderTick(); + } + } + } + + int BootstrapSystemComponent::GetTickOrder() + { + return TICK_LAST; } void BootstrapSystemComponent::OnWindowClosed() diff --git a/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.h b/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.h index 06a3917e13..f655272350 100644 --- a/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.h +++ b/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.h @@ -85,6 +85,7 @@ namespace AZ // TickBus::Handler overrides ... void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; + int GetTickOrder() override; // AzFramework::AssetCatalogEventBus::Handler overrides ... void OnCatalogLoaded(const char* catalogFile) override; diff --git a/Gems/Atom/Feature/Common/Assets/Passes/EnvironmentCubeMapForwardMSAA.pass b/Gems/Atom/Feature/Common/Assets/Passes/EnvironmentCubeMapForwardMSAA.pass index 236957523b..60de5e10b9 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/EnvironmentCubeMapForwardMSAA.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/EnvironmentCubeMapForwardMSAA.pass @@ -32,8 +32,8 @@ } }, { - "Name": "SpotLightShadowmap", - "ShaderInputName": "m_spotLightShadowmaps", + "Name": "ProjectedShadowmap", + "ShaderInputName": "m_projectedShadowmaps", "SlotType": "Input", "ScopeAttachmentUsage": "Shader", "ImageViewDesc": { @@ -41,8 +41,8 @@ } }, { - "Name": "ExponentialShadowmapSpot", - "ShaderInputName": "m_spotLightExponentialShadowmap", + "Name": "ExponentialShadowmapProjected", + "ShaderInputName": "m_projectedExponentialShadowmap", "SlotType": "Input", "ScopeAttachmentUsage": "Shader", "ImageViewDesc": { diff --git a/Gems/Atom/Feature/Common/Assets/Passes/EnvironmentCubeMapPipeline.pass b/Gems/Atom/Feature/Common/Assets/Passes/EnvironmentCubeMapPipeline.pass index 7b8d8a7482..79a42b11f7 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/EnvironmentCubeMapPipeline.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/EnvironmentCubeMapPipeline.pass @@ -49,12 +49,12 @@ ] }, { - "Name": "SpotLightShadowmapsPass", - "TemplateName": "SpotLightShadowmapsTemplate", + "Name": "ProjectedShadowmapsPass", + "TemplateName": "ProjectedShadowmapsTemplate", "PassData": { "$type": "RasterPassData", "DrawListTag": "shadow", - "PipelineViewTag": "SpotLightView" + "PipelineViewTag": "ProjectedShadowView" }, "Connections": [ { @@ -84,17 +84,17 @@ ] }, { - "Name": "EsmShadowmapsPassSpot", + "Name": "EsmShadowmapsPassProjected", "TemplateName": "EsmShadowmapsTemplate", "PassData": { "$type": "EsmShadowmapsPassData", - "LightType": "spot" + "LightType": "projected" }, "Connections": [ { "LocalSlot": "DepthShadowmaps", "AttachmentRef": { - "Pass": "SpotLightShadowmapsPass", + "Pass": "ProjectedShadowmapsPass", "Attachment": "Shadowmap" } } @@ -243,16 +243,16 @@ } }, { - "LocalSlot": "SpotLightShadowmap", + "LocalSlot": "ProjectedShadowmap", "AttachmentRef": { - "Pass": "SpotLightShadowmapsPass", + "Pass": "ProjectedShadowmapsPass", "Attachment": "Shadowmap" } }, { - "LocalSlot": "ExponentialShadowmapSpot", + "LocalSlot": "ExponentialShadowmapProjected", "AttachmentRef": { - "Pass": "EsmShadowmapsPassSpot", + "Pass": "EsmShadowmapsPassProjected", "Attachment": "EsmShadowmaps" } }, diff --git a/Gems/Atom/Feature/Common/Assets/Passes/Forward.pass b/Gems/Atom/Feature/Common/Assets/Passes/Forward.pass index ccb567e75f..66cf330fc5 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/Forward.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/Forward.pass @@ -33,8 +33,8 @@ } }, { - "Name": "SpotLightShadowmap", - "ShaderInputName": "m_spotLightShadowmaps", + "Name": "ProjectedShadowmap", + "ShaderInputName": "m_projectedShadowmaps", "SlotType": "Input", "ScopeAttachmentUsage": "Shader", "ImageViewDesc": { @@ -42,8 +42,8 @@ } }, { - "Name": "ExponentialShadowmapSpot", - "ShaderInputName": "m_spotLightExponentialShadowmap", + "Name": "ExponentialShadowmapProjected", + "ShaderInputName": "m_projectedExponentialShadowmap", "SlotType": "Input", "ScopeAttachmentUsage": "Shader", "ImageViewDesc": { diff --git a/Gems/Atom/Feature/Common/Assets/Passes/ForwardCheckerboard.pass b/Gems/Atom/Feature/Common/Assets/Passes/ForwardCheckerboard.pass index 45c6da5fe8..13fffd9e08 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/ForwardCheckerboard.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/ForwardCheckerboard.pass @@ -32,8 +32,8 @@ } }, { - "Name": "SpotLightShadowmap", - "ShaderInputName": "m_spotLightShadowmaps", + "Name": "ProjectedShadowmap", + "ShaderInputName": "m_projectedShadowmaps", "SlotType": "Input", "ScopeAttachmentUsage": "Shader", "ImageViewDesc": { @@ -41,8 +41,8 @@ } }, { - "Name": "ExponentialShadowmapSpot", - "ShaderInputName": "m_spotLightExponentialShadowmap", + "Name": "ExponentialShadowmapProjected", + "ShaderInputName": "m_projectedExponentialShadowmap", "SlotType": "Input", "ScopeAttachmentUsage": "Shader", "ImageViewDesc": { diff --git a/Gems/Atom/Feature/Common/Assets/Passes/ForwardMSAA.pass b/Gems/Atom/Feature/Common/Assets/Passes/ForwardMSAA.pass index b3525bd8de..b5d5f9f92c 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/ForwardMSAA.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/ForwardMSAA.pass @@ -33,8 +33,8 @@ } }, { - "Name": "SpotLightShadowmap", - "ShaderInputName": "m_spotLightShadowmaps", + "Name": "ProjectedShadowmap", + "ShaderInputName": "m_projectedShadowmaps", "SlotType": "Input", "ScopeAttachmentUsage": "Shader", "ImageViewDesc": { @@ -42,8 +42,8 @@ } }, { - "Name": "ExponentialShadowmapSpot", - "ShaderInputName": "m_spotLightExponentialShadowmap", + "Name": "ExponentialShadowmapProjected", + "ShaderInputName": "m_projectedExponentialShadowmap", "SlotType": "Input", "ScopeAttachmentUsage": "Shader", "ImageViewDesc": { diff --git a/Gems/Atom/Feature/Common/Assets/Passes/MainPipeline.pass b/Gems/Atom/Feature/Common/Assets/Passes/MainPipeline.pass index 4a6d9b4d25..38a616313b 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/MainPipeline.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/MainPipeline.pass @@ -155,17 +155,17 @@ } }, { - "LocalSlot": "SpotLightShadowmap", + "LocalSlot": "ProjectedShadowmap", "AttachmentRef": { "Pass": "ShadowPass", - "Attachment": "SpotLightShadowmap" + "Attachment": "ProjectedShadowmap" } }, { - "LocalSlot": "SpotLightESM", + "LocalSlot": "ProjectedESM", "AttachmentRef": { "Pass": "ShadowPass", - "Attachment": "SpotLightESM" + "Attachment": "ProjectedESM" } }, { @@ -224,17 +224,17 @@ } }, { - "LocalSlot": "SpotLightShadowmap", + "LocalSlot": "ProjectedShadowmap", "AttachmentRef": { "Pass": "ShadowPass", - "Attachment": "SpotLightShadowmap" + "Attachment": "ProjectedShadowmap" } }, { - "LocalSlot": "SpotLightESM", + "LocalSlot": "ProjectedESM", "AttachmentRef": { "Pass": "ShadowPass", - "Attachment": "SpotLightESM" + "Attachment": "ProjectedESM" } }, { diff --git a/Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass b/Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass index 9877d736a8..8131bbdf5d 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass @@ -17,11 +17,11 @@ "SlotType": "Input" }, { - "Name": "SpotLightShadowmap", + "Name": "ProjectedShadowmap", "SlotType": "Input" }, { - "Name": "SpotLightESM", + "Name": "ProjectedESM", "SlotType": "Input" }, { @@ -82,17 +82,17 @@ } }, { - "LocalSlot": "SpotLightShadowmap", + "LocalSlot": "ProjectedShadowmap", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SpotLightShadowmap" + "Attachment": "ProjectedShadowmap" } }, { - "LocalSlot": "ExponentialShadowmapSpot", + "LocalSlot": "ExponentialShadowmapProjected", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SpotLightESM" + "Attachment": "ProjectedESM" } }, { diff --git a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset index ac39ddc2f8..3cedd78210 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset +++ b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset @@ -217,8 +217,8 @@ "Path": "Passes/EnvironmentCubeMapPipeline.pass" }, { - "Name": "SpotLightShadowmapsTemplate", - "Path": "Passes/SpotLightShadowmaps.pass" + "Name": "ProjectedShadowmapsTemplate", + "Path": "Passes/ProjectedShadowmaps.pass" }, { "Name": "LightCullingRemapTemplate", diff --git a/Gems/Atom/Feature/Common/Assets/Passes/SpotLightShadowmaps.pass b/Gems/Atom/Feature/Common/Assets/Passes/ProjectedShadowmaps.pass similarity index 91% rename from Gems/Atom/Feature/Common/Assets/Passes/SpotLightShadowmaps.pass rename to Gems/Atom/Feature/Common/Assets/Passes/ProjectedShadowmaps.pass index aa4c957965..1bfbea527e 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/SpotLightShadowmaps.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/ProjectedShadowmaps.pass @@ -4,8 +4,8 @@ "ClassName": "PassAsset", "ClassData": { "PassTemplate": { - "Name": "SpotLightShadowmapsTemplate", - "PassClass": "SpotLightShadowmapsPass", + "Name": "ProjectedShadowmapsTemplate", + "PassClass": "ProjectedShadowmapsPass", "Slots": [ { "Name": "Shadowmap", diff --git a/Gems/Atom/Feature/Common/Assets/Passes/ShadowParent.pass b/Gems/Atom/Feature/Common/Assets/Passes/ShadowParent.pass index af9e4b15f5..436a1577b6 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/ShadowParent.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/ShadowParent.pass @@ -22,11 +22,11 @@ "SlotType": "Output" }, { - "Name": "SpotLightShadowmap", + "Name": "ProjectedShadowmap", "SlotType": "Output" }, { - "Name": "SpotLightESM", + "Name": "ProjectedESM", "SlotType": "Output" }, // SwapChain here is only used to reference the frame height and format @@ -51,16 +51,16 @@ } }, { - "LocalSlot": "SpotLightShadowmap", + "LocalSlot": "ProjectedShadowmap", "AttachmentRef": { - "Pass": "SpotLightShadowmapsPass", + "Pass": "ProjectedShadowmapsPass", "Attachment": "Shadowmap" } }, { - "LocalSlot": "SpotLightESM", + "LocalSlot": "ProjectedESM", "AttachmentRef": { - "Pass": "EsmShadowmapsPassSpot", + "Pass": "EsmShadowmapsPassProjected", "Attachment": "EsmShadowmaps" } } @@ -85,12 +85,12 @@ ] }, { - "Name": "SpotLightShadowmapsPass", - "TemplateName": "SpotLightShadowmapsTemplate", + "Name": "ProjectedShadowmapsPass", + "TemplateName": "ProjectedShadowmapsTemplate", "PassData": { "$type": "RasterPassData", "DrawListTag": "shadow", - "PipelineViewTag": "SpotLightView" + "PipelineViewTag": "ProjectedShadowView" }, "Connections": [ { @@ -120,17 +120,17 @@ ] }, { - "Name": "EsmShadowmapsPassSpot", + "Name": "EsmShadowmapsPassProjected", "TemplateName": "EsmShadowmapsTemplate", "PassData": { "$type": "EsmShadowmapsPassData", - "LightType": "spot" + "LightType": "projected" }, "Connections": [ { "LocalSlot": "DepthShadowmaps", "AttachmentRef": { - "Pass": "SpotLightShadowmapsPass", + "Pass": "ProjectedShadowmapsPass", "Attachment": "Shadowmap" } } diff --git a/Gems/Atom/Feature/Common/Assets/Passes/Transparent.pass b/Gems/Atom/Feature/Common/Assets/Passes/Transparent.pass index 5033a44ea6..415aa2fec0 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/Transparent.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/Transparent.pass @@ -38,8 +38,8 @@ } }, { - "Name": "SpotLightShadowmap", - "ShaderInputName": "m_spotLightShadowmaps", + "Name": "ProjectedShadowmap", + "ShaderInputName": "m_projectedShadowmaps", "SlotType": "Input", "ScopeAttachmentUsage": "Shader", "ImageViewDesc": { @@ -47,8 +47,8 @@ } }, { - "Name": "ExponentialShadowmapSpot", - "ShaderInputName": "m_spotLightExponentialShadowmap", + "Name": "ExponentialShadowmapProjected", + "ShaderInputName": "m_projectedExponentialShadowmap", "SlotType": "Input", "ScopeAttachmentUsage": "Shader", "ImageViewDesc": { diff --git a/Gems/Atom/Feature/Common/Assets/Passes/TransparentParent.pass b/Gems/Atom/Feature/Common/Assets/Passes/TransparentParent.pass index c2c60b7689..32517484f3 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/TransparentParent.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/TransparentParent.pass @@ -17,11 +17,11 @@ "SlotType": "Input" }, { - "Name": "SpotLightShadowmap", + "Name": "ProjectedShadowmap", "SlotType": "Input" }, { - "Name": "SpotLightESM", + "Name": "ProjectedESM", "SlotType": "Input" }, { @@ -64,17 +64,17 @@ } }, { - "LocalSlot": "SpotLightShadowmap", + "LocalSlot": "ProjectedShadowmap", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SpotLightShadowmap" + "Attachment": "ProjectedShadowmap" } }, { - "LocalSlot": "ExponentialShadowmapSpot", + "LocalSlot": "ExponentialShadowmapProjected", "AttachmentRef": { "Pass": "Parent", - "Attachment": "SpotLightESM" + "Attachment": "ProjectedESM" } }, { diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/LightCullingShared.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/LightCullingShared.azsli index fd78ddc6bd..c47ee2fc8c 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/LightCullingShared.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/LightCullingShared.azsli @@ -18,8 +18,8 @@ #define TILE_DIM_X 16 #define TILE_DIM_Y 16 -// Point, spot, disk, capsule, quad lights, decals -#define NUM_LIGHT_TYPES 6 +// Simple point, simple spot, point(sphere), spot (disk), capsule, quad lights, decals +#define NUM_LIGHT_TYPES 7 uint GetLightListIndex(uint3 groupID, uint gridWidth, int offset) diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/MorphTargets/MorphTargetCompression.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/MorphTargets/MorphTargetCompression.azsli index d71074c6cc..3e6e501656 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/MorphTargets/MorphTargetCompression.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/MorphTargets/MorphTargetCompression.azsli @@ -30,6 +30,14 @@ float3 DecodeTBNDelta(uint3 encodedTBN) return float3(encodedTBN) * f - 2.0f; } +float4 DecodeColorDelta(uint4 encodedColor) +{ + // Color deltas are in a range of -1.0 to 1.0 + // 8 bits per channel, 4 channels + float f = 2.0f / 255.0f; + return float4(encodedColor) * f - 1.0f; +} + int3 EncodeFloatsToInts(float3 f, float integerEncoding) { return int3(f * integerEncoding); @@ -39,3 +47,13 @@ float3 DecodeIntsToFloats(int3 i, float inverseIntegerEncoding) { return float3(i) * inverseIntegerEncoding; } + +int4 EncodeFloatsToInts(float4 f, float integerEncoding) +{ + return int4(f * integerEncoding); +} + +float4 DecodeIntsToFloats(int4 i, float inverseIntegerEncoding) +{ + return float4(i) * inverseIntegerEncoding; +} diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/ForwardPassSrg.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/ForwardPassSrg.azsli index 7639eb3d08..14cff21739 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/ForwardPassSrg.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/ForwardPassSrg.azsli @@ -19,8 +19,8 @@ ShaderResourceGroup PassSrg : SRG_PerPass // [GFX TODO][ATOM-2012] adapt to multiple shadowmaps Texture2DArray m_directionalLightShadowmap; Texture2DArray m_directionalLightExponentialShadowmap; - Texture2DArray m_spotLightShadowmaps; - Texture2DArray m_spotLightExponentialShadowmap; + Texture2DArray m_projectedShadowmaps; + Texture2DArray m_projectedExponentialShadowmap; Texture2D m_brdfMap; Sampler LinearSampler diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli index 79c05fbe8b..6b3a9cfada 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/DiskLight.azsli @@ -13,6 +13,12 @@ #pragma once #include +#include + +enum DiskLightFlag +{ + UseConeAngle = 1, +}; void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingData lightingData) { @@ -22,33 +28,42 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat float3 posToLightDir = normalize(posToLight); - // Adjust direction if light emits both direction and is pointing away. - float facing = sign(dot(posToLightDir, -light.m_direction)); - float3 lightDirection = light.m_direction; - if (facing * light.m_bothDirectionsFactor > 0.0 ) - { - lightDirection = -lightDirection; - } - // Reduce the brightness based on how much the disk is facing this pixel. - float angleFalloff = dot(posToLightDir, -lightDirection); + float angleFalloff = dot(posToLightDir, -light.m_direction); // Only calculate shading if light is in range if (falloff < 1.0f && angleFalloff > 0.0f) { + bool useConeAngle = light.m_flags & DiskLightFlag::UseConeAngle; + float3 dirToConeTip; + float dotWithDirection; + + if (useConeAngle) + { + float3 coneTipPosition = light.m_position + light.m_bulbPositionOffset * -light.m_direction; + dirToConeTip = normalize(coneTipPosition - surface.position); + dotWithDirection = dot(dirToConeTip, -normalize(light.m_direction)); + + // If outside the outer cone angle return. + if (dotWithDirection < light.m_cosOuterConeAngle) + { + return; + } + } + // Smoothly adjusts the light intensity so it reaches 0 at light.m_attenuationRadius distance float radiusAttenuation = 1.0 - (falloff * falloff); radiusAttenuation = radiusAttenuation * radiusAttenuation; // Find the distance to the closest point on the disk - float distanceToPlane = dot(posToLight, -lightDirection); + float distanceToPlane = dot(posToLight, -light.m_direction); float distanceToPlane2 = distanceToPlane * distanceToPlane; float pointOnPlaneToLightDistance = sqrt(distanceToLight2 - distanceToPlane2); // pythagorean theorem float pointOnPlaneToDiskDistance = max(pointOnPlaneToLightDistance - light.m_diskRadius, 0.0f); float distanceToDisk2 = pointOnPlaneToDiskDistance * pointOnPlaneToDiskDistance + distanceToPlane2; // Update the light direction based on the edges of the disk as visible from this point instead of the center. - float3 pointOnPlane = -lightDirection * distanceToPlane; + float3 pointOnPlane = -light.m_direction * distanceToPlane; float3 pointOnPlaneToLightDir = normalize(posToLight - pointOnPlane); float3 nearSideDir = normalize(pointOnPlane + pointOnPlaneToLightDir * (pointOnPlaneToLightDistance - light.m_diskRadius)); float3 farSideDir = normalize(pointOnPlane + pointOnPlaneToLightDir * (pointOnPlaneToLightDistance + light.m_diskRadius)); @@ -63,17 +78,52 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat // 0 radius disks are unaffected. lightIntensity /= ((light.m_diskRadius / distanceToPlane) + 1.0); + // shadow + float litRatio = 1.0; + + // How much is back face shadowed, it's set to the reverse of litRatio to share the same default value with thickness, which should be 0 if no shadow map available + float backShadowRatio = 0.0; + if (o_enableShadows) + { + litRatio = ProjectedShadow::GetVisibility( + light.m_shadowIndex, + light.m_position, + surface.position, + -dirToConeTip, + surface.normal); + + // Use backShadowRatio to carry thickness from shadow map for thick mode + backShadowRatio = 1.0 - litRatio; + if (o_transmission_mode == TransmissionMode::ThickObject) + { + backShadowRatio = ProjectedShadow::GetThickness( + light.m_shadowIndex, + surface.position); + } + } + + if (useConeAngle && dotWithDirection < light.m_cosInnerConeAngle) // in penumbra + { + // Normalize into 0.0 - 1.0 space. + float penumbraMask = (dotWithDirection - light.m_cosOuterConeAngle) / (light.m_cosInnerConeAngle - light.m_cosOuterConeAngle); + + // Apply smoothstep + penumbraMask = penumbraMask * penumbraMask * (3.0 - 2.0 * penumbraMask); + + lightIntensity *= penumbraMask; + } + // Diffuse contribution - lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, posToLightDir); + lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, posToLightDir) * litRatio; // Tranmission contribution - lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, posToLightDir, 0.0); + lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, posToLightDir, 0.0) * litRatio; // Adjust the light direction for specular based on disk size - // Calculate the reflection off the normal from the view lightDirection + // Calculate the reflection off the normal from the view direction float3 reflectionDir = reflect(-lightingData.dirToCamera, surface.normal); - float reflectionDotLight = dot(reflectionDir, -lightDirection); + float reflectionDotLight = dot(reflectionDir, -light.m_direction); // Let 'Intersection' denote the point where the reflection ray intersects the diskLight plane // As such, posToIntersection denotes the vector from pos to the intersection of the reflection ray and the disk plane: @@ -90,21 +140,21 @@ void ApplyDiskLight(ViewSrg::DiskLight light, Surface surface, inout LightingDat // then treat that as the reflection plane intersection. float3 posToFarOffPoint = reflectionDir * distanceToPlane * 10000.0; float3 lightToFarOffPoint = posToFarOffPoint - posToLight; - float3 intersectionToFarOffPoint = dot(lightToFarOffPoint, lightDirection) * lightDirection; + float3 intersectionToFarOffPoint = dot(lightToFarOffPoint, light.m_direction) * light.m_direction; posToIntersection = posToFarOffPoint - intersectionToFarOffPoint; } // Calculate a vector from the reflection vector to the light float3 intersectionToLight = posToLight - posToIntersection; - // Adjust the lightDirection to light based on the bulb size + // Adjust the direction to light based on the bulb size posToLight -= intersectionToLight * saturate(light.m_diskRadius / length(intersectionToLight)); // Adjust the intensity of the light based on the bulb size to conserve energy float diskIntensityNormalization = GetIntensityAdjustedByRadiusAndRoughness(surface.roughnessA, light.m_diskRadius, distanceToLight2); // Specular contribution - lightingData.specularLighting += diskIntensityNormalization * GetSpecularLighting(surface, lightingData, lightIntensity, normalize(posToLight)); + lightingData.specularLighting += diskIntensityNormalization * GetSpecularLighting(surface, lightingData, lightIntensity, normalize(posToLight)) * litRatio; } } @@ -147,7 +197,7 @@ void ValidateDiskLight(ViewSrg::DiskLight light, Surface surface, inout Lighting { float2 randomPoint = GetHammersleyPoint(i, sampleCount); float3 samplePoint = SampleDisk(randomPoint, light); - AddSampleContribution(surface, lightingData, samplePoint, light.m_direction, light.m_bothDirectionsFactor, diffuseAcc, specularAcc, translucentAcc); + AddSampleContribution(surface, lightingData, samplePoint, light.m_direction, 0.0, diffuseAcc, specularAcc, translucentAcc); } lightingData.diffuseLighting += (diffuseAcc / float(sampleCount)) * light.m_rgbIntensityCandelas; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Lights.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Lights.azsli index 37594cf553..2a921f7859 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Lights.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Lights.azsli @@ -18,7 +18,8 @@ #include #include #include -#include +#include +#include void ApplyDirectLighting(Surface surface, inout LightingData lightingData) { @@ -28,11 +29,12 @@ void ApplyDirectLighting(Surface surface, inout LightingData lightingData) } if (o_enablePunctualLights) { - ApplyPointLights(surface, lightingData); - ApplySpotLights(surface, lightingData); + ApplySimplePointLights(surface, lightingData); + ApplySimpleSpotLights(surface, lightingData); } if (o_enableAreaLights) { + ApplyPointLights(surface, lightingData); ApplyDiskLights(surface, lightingData); ApplyCapsuleLights(surface, lightingData); ApplyQuadLights(surface, lightingData); diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/SimplePointLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/SimplePointLight.azsli new file mode 100644 index 0000000000..9353095cdd --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/SimplePointLight.azsli @@ -0,0 +1,55 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include + +void ApplySimplePointLight(ViewSrg::SimplePointLight light, Surface surface, inout LightingData lightingData) +{ + float3 posToLight = light.m_position - surface.position; + float d2 = dot(posToLight, posToLight); // light distance squared + float falloff = d2 * light.m_invAttenuationRadiusSquared; + + // Only calculate shading if light is in range + if (falloff < 1.0f) + { + // Smoothly adjusts the light intensity so it reaches 0 at light.m_attenuationRadius distance + float radiusAttenuation = 1.0 - (falloff * falloff); + radiusAttenuation = radiusAttenuation * radiusAttenuation; + + // Standard quadratic falloff + d2 = max(0.001 * 0.001, d2); // clamp the light to at least 1mm away to avoid extreme values. + float3 lightIntensity = (light.m_rgbIntensityCandelas / d2) * radiusAttenuation; + float3 posToLightDir = normalize(posToLight); + + // Diffuse contribution + lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, posToLightDir); + + // Specular contribution + lightingData.specularLighting += GetSpecularLighting(surface, lightingData, lightIntensity, posToLightDir); + } +} + +void ApplySimplePointLights(Surface surface, inout LightingData lightingData) +{ + lightingData.tileIterator.LoadAdvance(); + + while( !lightingData.tileIterator.IsDone() ) + { + uint currLightIndex = lightingData.tileIterator.GetValue(); + lightingData.tileIterator.LoadAdvance(); + + ViewSrg::SimplePointLight light = ViewSrg::m_simplePointLights[currLightIndex]; + ApplySimplePointLight(light, surface, lightingData); + } +} diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/SimpleSpotLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/SimpleSpotLight.azsli new file mode 100644 index 0000000000..5fee8e60ff --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/SimpleSpotLight.azsli @@ -0,0 +1,76 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include + +void ApplySimpleSpotLight(ViewSrg::SimpleSpotLight light, Surface surface, inout LightingData lightingData) +{ + float3 posToLight = light.m_position - surface.position; + + float3 dirToLight = normalize(posToLight); + float dotWithDirection = dot(dirToLight, -normalize(light.m_direction)); + + // If outside the outer cone angle return. + if (dotWithDirection < light.m_cosOuterConeAngle) + { + return; + } + + float d2 = dot(posToLight, posToLight); // light distance squared + float falloff = d2 * light.m_invAttenuationRadiusSquared; + + // Only calculate shading if light is in range + if (falloff < 1.0f) + { + // Smoothly adjusts the light intensity so it reaches 0 at light.m_attenuationRadius distance + float radiusAttenuation = 1.0 - (falloff * falloff); + radiusAttenuation = radiusAttenuation * radiusAttenuation; + + // Standard quadratic falloff + d2 = max(0.001 * 0.001, d2); // clamp the light to at least 1mm away to avoid extreme values. + float3 lightIntensity = (light.m_rgbIntensityCandelas / d2) * radiusAttenuation; + float3 posToLightDir = normalize(posToLight); + + if (dotWithDirection < light.m_cosInnerConeAngle) // in penumbra + { + // Normalize into 0.0 - 1.0 space. + float penumbraMask = (dotWithDirection - light.m_cosOuterConeAngle) / (light.m_cosInnerConeAngle - light.m_cosOuterConeAngle); + + // Apply smoothstep + penumbraMask = penumbraMask * penumbraMask * (3.0 - 2.0 * penumbraMask); + + lightIntensity *= penumbraMask; + } + + // Diffuse contribution + lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, posToLightDir); + + // Specular contribution + lightingData.specularLighting += GetSpecularLighting(surface, lightingData, lightIntensity, posToLightDir); + } +} + +void ApplySimpleSpotLights(Surface surface, inout LightingData lightingData) +{ + lightingData.tileIterator.LoadAdvance(); + + while( !lightingData.tileIterator.IsDone() ) + { + uint currLightIndex = lightingData.tileIterator.GetValue(); + lightingData.tileIterator.LoadAdvance(); + + ViewSrg::SimpleSpotLight light = ViewSrg::m_simpleSpotLights[currLightIndex]; + ApplySimpleSpotLight(light, surface, lightingData); + } +} diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/SpotLight.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/SpotLight.azsli deleted file mode 100644 index c6ea016938..0000000000 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/SpotLight.azsli +++ /dev/null @@ -1,152 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include - -void ApplySpotLight(ViewSrg::SpotLight spotLight, Surface surface, inout LightingData lightingData, uint lightIndex) -{ - float3 posToLight = spotLight.m_position - surface.position; - float distanceToLight2 = dot(posToLight, posToLight); // light distance squared - float falloff = distanceToLight2 * spotLight.m_invAttenuationRadiusSquared; - - float3 spotConeTipPosition = spotLight.m_position + spotLight.m_bulbPositionOffset * -spotLight.m_direction; - float3 dirToConeTip = normalize(spotConeTipPosition - surface.position); - float dotWithDirection = dot(dirToConeTip, -normalize(spotLight.m_direction)); - - float3 posToLightDir = normalize(posToLight); - - // Reduce the brightness based on how much the disk is facing this pixel. - float angleFalloff = dot(posToLightDir, -spotLight.m_direction); - - if (falloff < 1.0f && dotWithDirection >= spotLight.m_outerConeAngle && angleFalloff > 0.0) // Only calculate shading if light is in range and in cone. - { - // Smoothly adjusts the light intensity so it reaches 0 at light.m_attenuationRadius distance - float radiusAttenuation = 1.0 - (falloff * falloff); - radiusAttenuation = radiusAttenuation * radiusAttenuation; - - // Find the distance to the closest point on the disk - float distanceToPlane = dot(posToLight,-spotLight.m_direction); - float distanceToPlane2 = distanceToPlane * distanceToPlane; - float pointOnPlaneToLightDistance = sqrt(distanceToLight2 - distanceToPlane2); // pythagorean theorem - float pointOnPlaneToDiskDistance = max(pointOnPlaneToLightDistance - spotLight.m_bulbRadius, 0.0f); - float distanceToDisk2 = pointOnPlaneToDiskDistance * pointOnPlaneToDiskDistance + distanceToPlane2; - - // Update the light direction based on the edges of the disk as visible from this point instead of the center. - float3 pointOnPlane = -spotLight.m_direction * distanceToPlane; - float3 pointOnPlaneToLightDir = normalize(posToLight - pointOnPlane); - float3 nearSideDir = normalize(pointOnPlane + pointOnPlaneToLightDir * (pointOnPlaneToLightDistance - spotLight.m_bulbRadius)); - float3 farSideDir = normalize(pointOnPlane + pointOnPlaneToLightDir * (pointOnPlaneToLightDistance + spotLight.m_bulbRadius)); - posToLightDir = normalize((nearSideDir + farSideDir) * 0.5); - - // Standard quadratic falloff - distanceToDisk2 = max(0.001 * 0.001, distanceToDisk2); // clamp the light to at least 1mm away to avoid extreme values. - float3 lightIntensity = (spotLight.m_rgbIntensityCandelas / distanceToDisk2) * radiusAttenuation * angleFalloff; - - // Adjust brightness based on the disk size relative to its distance. - // The larger the disk is relative to the surface point, the dimmer it becomes. - // 0 radius disks are unaffected. - lightIntensity /= ((spotLight.m_bulbRadius / distanceToPlane) + 1.0); - - // shadow - float litRatio = 1.; - - // How much is back face shadowed, it's set to the reverse of litRatio to share the same default value with thickness, which should be 0 if no shadow map available - float backShadowRatio = 0.; - if (o_enableShadows) - { - litRatio = SpotLightShadow::GetVisibility( - lightIndex, - surface.position, - -dirToConeTip, - surface.normal); - - // Use backShadowRatio to carry thickness from shadow map for thick mode - backShadowRatio = 1.0 - litRatio; - if (o_transmission_mode == TransmissionMode::ThickObject) - { - backShadowRatio = SpotLightShadow::GetThickness( - lightIndex, - surface.position); - } - } - - float3 dirToLight = normalize(posToLight); - - if (dotWithDirection < spotLight.m_innerConeAngle) // in penumbra - { - // Normalize into 0.0 - 1.0 space. - float penumbraMask = (dotWithDirection - spotLight.m_outerConeAngle) / (spotLight.m_innerConeAngle - spotLight.m_outerConeAngle); - - // Bias the curve towards the inner or outer cone angle - penumbraMask = saturate((spotLight.m_penumbraBias * penumbraMask + penumbraMask) / (spotLight.m_penumbraBias * penumbraMask + 1.0)); - - // Apply smoothstep - penumbraMask = penumbraMask * penumbraMask * (3.0 - 2.0 * penumbraMask); - - lightIntensity *= penumbraMask; - } - - lightingData.diffuseLighting += GetDiffuseLighting(surface, lightingData, lightIntensity, dirToLight) * litRatio; - lightingData.translucentBackLighting += GetBackLighting(surface, lightingData, lightIntensity, dirToLight, backShadowRatio); - - // Calculate the reflection off the normal from the view lightDirection - float3 reflectionDir = reflect(-lightingData.dirToCamera, surface.normal); - float reflectionDotLight = dot(reflectionDir, -spotLight.m_direction); - - // Let 'Intersection' denote the point where the reflection ray intersects the diskLight plane - // As such, posToIntersection denotes the vector from pos to the intersection of the reflection ray and the disk plane: - float3 posToIntersection; - - if (reflectionDotLight >= 0.0001) - { - // Reflection going towards the light - posToIntersection = reflectionDir * distanceToPlane / reflectionDotLight; - } - else - { - // Reflection going away from the light. Choose a point far off and project it on the plane, - // then treat that as the reflection plane intersection. - float3 posToFarOffPoint = reflectionDir * distanceToPlane * 10000.0; - float3 lightToFarOffPoint = posToFarOffPoint - posToLight; - float3 intersectionToFarOffPoint = dot(lightToFarOffPoint, spotLight.m_direction) * spotLight.m_direction; - posToIntersection = posToFarOffPoint - intersectionToFarOffPoint; - } - - // Calculate a vector from the reflection vector to the light - float3 intersectionToLight = posToLight - posToIntersection; - - // Adjust the direction to light based on the bulb size - posToLight -= intersectionToLight * saturate(spotLight.m_bulbRadius / length(intersectionToLight)); - - // Adjust the intensity of the light based on the bulb size to conserve energy - float diskIntensityNormalization = GetIntensityAdjustedByRadiusAndRoughness(surface.roughnessA, spotLight.m_bulbRadius, distanceToLight2); - - lightingData.specularLighting += diskIntensityNormalization * GetSpecularLighting(surface, lightingData, lightIntensity, normalize(posToLight)) * litRatio; - } -} - -void ApplySpotLights(Surface surface, inout LightingData lightingData) -{ - lightingData.tileIterator.LoadAdvance(); - - while( !lightingData.tileIterator.IsDone() ) - { - uint currLightIndex = lightingData.tileIterator.GetValue(); - lightingData.tileIterator.LoadAdvance(); - - ViewSrg::SpotLight light = ViewSrg::m_spotLights[currLightIndex]; - ApplySpotLight(light, surface, lightingData, currLightIndex); - } -} diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/TransparentPassSrg.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/TransparentPassSrg.azsli index 7639eb3d08..14cff21739 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/TransparentPassSrg.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/TransparentPassSrg.azsli @@ -19,8 +19,8 @@ ShaderResourceGroup PassSrg : SRG_PerPass // [GFX TODO][ATOM-2012] adapt to multiple shadowmaps Texture2DArray m_directionalLightShadowmap; Texture2DArray m_directionalLightExponentialShadowmap; - Texture2DArray m_spotLightShadowmaps; - Texture2DArray m_spotLightExponentialShadowmap; + Texture2DArray m_projectedShadowmaps; + Texture2DArray m_projectedExponentialShadowmap; Texture2D m_brdfMap; Sampler LinearSampler diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli index 1bbebcc06d..893df85e3e 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli @@ -16,11 +16,11 @@ #include "JitterTablePcf.azsli" #include "Shadow.azsli" #include "ShadowmapAtlasLib.azsli" +#include "BicubicPcfFilters.azsli" // Before including this azsli file, a PassSrg must be defined with the following members: // Texture2DArray m_directionalLightShadowmap; // Texture2DArray m_directionalLightExponentialShadowmap; -// Texture2DArray m_spotLightShadowmaps; // Sampler LinearSampler; // This matchs ShadowFilterMethod in ShadowConstants.h @@ -102,6 +102,9 @@ class DirectionalLightShadow // This outputs visibility ratio (from 0.0 to 1.0) for ESM+PCF. float GetVisibilityFromLightEsmPcf(); + float SamplePcfBicubic(); + float SamplePcfBicubic(float3 shadowCoord, uint indexOfCascade); + uint m_lightIndex; float3 m_shadowCoords[ViewSrg::MaxCascadeCount]; float m_slopeBias[ViewSrg::MaxCascadeCount]; @@ -281,6 +284,11 @@ float DirectionalLightShadow::GetVisibilityFromLightPcf() { return GetVisibilityFromLightNoFilter(); } + + if (ViewSrg::m_directionalLightShadows[m_lightIndex].m_pcfFilterMethod == PcfFilterMethod_Bicubic) + { + return SamplePcfBicubic(); + } const float3 lightDirection = normalize(SceneSrg::m_directionalLights[m_lightIndex].m_direction); @@ -404,6 +412,57 @@ float DirectionalLightShadow::GetVisibilityFromLightEsmPcf() return 1.; } +float DirectionalLightShadow::SamplePcfBicubic() +{ + static const float DepthMargin = 0.01; // avoiding artifact when near depth bounds. + static const float PixelMargin = 1.5; // avoiding artifact between cascade levels. + + const uint size = ViewSrg::m_directionalLightShadows[m_lightIndex].m_shadowmapSize; + const uint cascadeCount = ViewSrg::m_directionalLightShadows[m_lightIndex].m_cascadeCount; + for (uint indexOfCascade = 0; indexOfCascade < cascadeCount; ++indexOfCascade) + { + const float3 shadowCoord = m_shadowCoords[indexOfCascade]; + + if (shadowCoord.x >= 0. && shadowCoord.x * size < size - PixelMargin && + shadowCoord.y >= 0. && shadowCoord.y * size < size - PixelMargin && + shadowCoord.z < 1. - DepthMargin) + { + return SamplePcfBicubic(shadowCoord, indexOfCascade); + } + } + m_debugInfo.m_cascadeIndex = cascadeCount; + return 1.; +} + +float DirectionalLightShadow::SamplePcfBicubic(float3 shadowCoord, uint indexOfCascade) +{ + const uint filteringSampleCount = ViewSrg::m_directionalLightShadows[m_lightIndex].m_filteringSampleCount; + const uint size = ViewSrg::m_directionalLightShadows[m_lightIndex].m_shadowmapSize; + const uint cascadeCount = ViewSrg::m_directionalLightShadows[m_lightIndex].m_cascadeCount; + Texture2DArray shadowmap = PassSrg::m_directionalLightShadowmap; + + SampleShadowMapBicubicParameters param; + param.shadowMap = shadowmap; + param.shadowPos = float3(shadowCoord.xy, indexOfCascade); + param.shadowMapSize = size; + param.invShadowMapSize = rcp(size); + param.comparisonValue = shadowCoord.z; + param.samplerState = SceneSrg::m_hwPcfSampler; + + if (filteringSampleCount <= 4) + { + return SampleShadowMapBicubic_4Tap(param); + } + else if (filteringSampleCount <= 9) + { + return SampleShadowMapBicubic_9Tap(param); + } + else + { + return SampleShadowMapBicubic_16Tap(param); + } +} + float DirectionalLightShadow::GetVisibility( uint lightIndex, float3 shadowCoords[ViewSrg::MaxCascadeCount], diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/SpotLightShadow.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/ProjectedShadow.azsli similarity index 73% rename from Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/SpotLightShadow.azsli rename to Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/ProjectedShadow.azsli index 2e5f18d864..e4cb87802a 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/SpotLightShadow.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/Shadow/ProjectedShadow.azsli @@ -20,23 +20,24 @@ #include "JitterTablePcf.azsli" #include "Shadow.azsli" -// SpotLightShadow calculates lit/shadowed for a spot light. -class SpotLightShadow +// ProjectedShadow calculates shadowed area projected from a light. +class ProjectedShadow { ////////// // public method - //! This calculates visibility of the surface from the spot light. - //! @param lightIndex spot light index + //! This calculates visibility of the surface from a light source. + //! @param viewPosition position of the shadow casting view //! @param worldPosition surface position in the world coordinate. //! @return 1.0 if lit, 0.0 if shadowed. static float GetVisibility( - uint lightIndex, + uint shadowId, + float3 viewPosition, float3 worldPosition, float3 lightDirection, float3 normalVector); - static float GetThickness(uint lightIndex, float3 worldPosition); + static float GetThickness(uint shadowIndex, float3 worldPosition); ////////// // private methods @@ -56,9 +57,9 @@ class SpotLightShadow uint jitterIndex); void SetShadowPosition(); float3 GetAtlasPosition(float2 texturePosition); - static float UnprojectDepth(uint lightIndex, float depthBufferValue); + static float UnprojectDepth(uint shadowIndex, float depthBufferValue); - uint m_lightIndex; + float3 m_viewPosition; uint m_shadowIndex; float3 m_worldPosition; float3 m_lightDirection; @@ -66,28 +67,31 @@ class SpotLightShadow float3 m_shadowPosition; }; -float SpotLightShadow::GetVisibility( - uint lightIndex, +float ProjectedShadow::GetVisibility( + uint shadowIndex, + float3 viewPosition, float3 worldPosition, float3 lightDirection, float3 normalVector) { - SpotLightShadow shadow; - shadow.m_lightIndex = lightIndex; - shadow.m_shadowIndex = ViewSrg::m_spotLights[lightIndex].m_shadowIndex; - shadow.m_worldPosition = worldPosition; - shadow.m_lightDirection = lightDirection; - shadow.m_normalVector = normalVector; - shadow.SetShadowPosition(); - // If no shadow, early return. - if (shadow.m_shadowIndex < 0) + if (shadowIndex == 0xFFFF) { return 1.0; } + ProjectedShadow shadow; + shadow.m_viewPosition = viewPosition; + shadow.m_shadowIndex = shadowIndex; + shadow.m_worldPosition = worldPosition; + shadow.m_lightDirection = lightDirection; + shadow.m_normalVector = normalVector; + shadow.SetShadowPosition(); + float visibility = 1.; - switch (ViewSrg::m_spotLightShadows[shadow.m_shadowIndex].m_shadowFilterMethod) + // Filter method is stored in top 16 bits. + uint filterMethod = ViewSrg::m_projectedShadows[shadow.m_shadowIndex].m_shadowFilterMethod & 0x0000FFFF; + switch (filterMethod) { case ViewSrg::ShadowFilterMethodNone: visibility = shadow.GetVisibilityNoFilter(); @@ -106,9 +110,9 @@ float SpotLightShadow::GetVisibility( return saturate(visibility); } -float SpotLightShadow::UnprojectDepth(uint lightIndex, float depthBufferValue) +float ProjectedShadow::UnprojectDepth(uint shadowIndex, float depthBufferValue) { - // Unproject the perspective matrix that was built in SpotLightFeatureProcessor.cpp + // Unproject the perspective matrix that was built in ProjectedShadowFeatureProcessor.cpp // (Right-hand with non-reversed depth) // Should look something like the following: // [... ... ... ...][x] @@ -117,33 +121,40 @@ float SpotLightShadow::UnprojectDepth(uint lightIndex, float depthBufferValue) // [... ... -1 ...][1] // unprojectConstants contains the A and B values - const float2 unprojectConstants = ViewSrg::m_spotLightShadows[lightIndex].m_unprojectConstants; + const float2 unprojectConstants = ViewSrg::m_projectedShadows[shadowIndex].m_unprojectConstants; return -unprojectConstants.y / (depthBufferValue + unprojectConstants.x); } -float SpotLightShadow::GetThickness(uint lightIndex, float3 worldPosition) +float ProjectedShadow::GetThickness(uint shadowIndex, float3 worldPosition) { - SpotLightShadow shadow; - shadow.m_lightIndex = lightIndex; + // If no shadow, early return. + if (shadowIndex == 0xFFFF) + { + return 0.0; + } + + ProjectedShadow shadow; shadow.m_worldPosition = worldPosition; - shadow.m_shadowIndex = ViewSrg::m_spotLights[lightIndex].m_shadowIndex; + shadow.m_shadowIndex = shadowIndex; shadow.SetShadowPosition(); return shadow.GetThickness(); } -float SpotLightShadow::GetVisibilityNoFilter() +float ProjectedShadow::GetVisibilityNoFilter() { return IsShadowed(m_shadowPosition) ? 0. : 1.; } -float SpotLightShadow::GetVisibilityPcf() +float ProjectedShadow::GetVisibilityPcf() { - if (ViewSrg::m_spotLightShadows[m_shadowIndex].m_pcfFilterMethod == PcfFilterMethod_Bicubic) + // PCF filter method is stored in bottom 16 bits. + const uint pcfFilterMethod = ViewSrg::m_projectedShadows[m_shadowIndex].m_shadowFilterMethod >> 16; + if (pcfFilterMethod == PcfFilterMethod_Bicubic) { return SamplePcfBicubic(); } - const uint predictionCount = ViewSrg::m_spotLightShadows[m_shadowIndex].m_predictionSampleCount; + const uint predictionCount = ViewSrg::m_projectedShadows[m_shadowIndex].m_predictionSampleCount; if (predictionCount <= 1) { @@ -187,7 +198,7 @@ float SpotLightShadow::GetVisibilityPcf() // we calculate the more precious lit ratio in the area. const uint filteringCount = max( predictionCount, - ViewSrg::m_spotLightShadows[m_shadowIndex].m_filteringSampleCount); + ViewSrg::m_projectedShadows[m_shadowIndex].m_filteringSampleCount); for (; jitterIndex < filteringCount; ++jitterIndex) { @@ -204,26 +215,26 @@ float SpotLightShadow::GetVisibilityPcf() return (filteringCount - shadowedCount) * 1. / filteringCount; } -float SpotLightShadow::GetVisibilityEsm() +float ProjectedShadow::GetVisibilityEsm() { static const float PixelMargin = 1.5; // avoiding artifact on the edge of shadowmap. - const uint size = ViewSrg::m_spotLightShadows[m_shadowIndex].m_shadowmapSize; + const uint size = ViewSrg::m_projectedFilterParams[m_shadowIndex].m_shadowmapSize; if (size <= 1) { return 1.; // There is no shadowmap for this light. } const float invAtlasSize = ViewSrg::m_invShadowmapAtlasSize; - const Texture2DArray expShadowmap = PassSrg::m_spotLightExponentialShadowmap; + const Texture2DArray expShadowmap = PassSrg::m_projectedExponentialShadowmap; if (m_shadowPosition.x >= 0 && m_shadowPosition.x * size < size - PixelMargin && m_shadowPosition.y >= 0 && m_shadowPosition.y * size < size - PixelMargin) { const float3 coefficients = float3( - ViewSrg::m_esmsSpot[m_shadowIndex].m_n_f_n, - ViewSrg::m_esmsSpot[m_shadowIndex].m_n_f, - ViewSrg::m_esmsSpot[m_shadowIndex].m_f); + ViewSrg::m_projectedFilterParams[m_shadowIndex].m_n_f_n, + ViewSrg::m_projectedFilterParams[m_shadowIndex].m_n_f, + ViewSrg::m_projectedFilterParams[m_shadowIndex].m_f); if (coefficients.x == 0.) { return 1.; @@ -243,26 +254,26 @@ float SpotLightShadow::GetVisibilityEsm() return 1.; } -float SpotLightShadow::GetVisibilityEsmPcf() +float ProjectedShadow::GetVisibilityEsmPcf() { static const float PixelMargin = 1.5; // avoiding artifact on the edge of shadowmap; - const uint size = ViewSrg::m_spotLightShadows[m_shadowIndex].m_shadowmapSize; + const uint size = ViewSrg::m_projectedFilterParams[m_shadowIndex].m_shadowmapSize; if (size <= 1) { return 1.; // There is no shadowmap for this light. } const float invAtlasSize = ViewSrg::m_invShadowmapAtlasSize; - const Texture2DArray expShadowmap = PassSrg::m_spotLightExponentialShadowmap; + const Texture2DArray expShadowmap = PassSrg::m_projectedExponentialShadowmap; if (m_shadowPosition.x >= 0 && m_shadowPosition.x * size < size - PixelMargin && m_shadowPosition.y >= 0 && m_shadowPosition.y * size < size - PixelMargin) { const float3 coefficients = float3( - ViewSrg::m_esmsSpot[m_shadowIndex].m_n_f_n, - ViewSrg::m_esmsSpot[m_shadowIndex].m_n_f, - ViewSrg::m_esmsSpot[m_shadowIndex].m_f); + ViewSrg::m_projectedFilterParams[m_shadowIndex].m_n_f_n, + ViewSrg::m_projectedFilterParams[m_shadowIndex].m_n_f, + ViewSrg::m_projectedFilterParams[m_shadowIndex].m_f); if (coefficients.x == 0.) { return 1.; @@ -292,18 +303,18 @@ float SpotLightShadow::GetVisibilityEsmPcf() return 1.; } -float SpotLightShadow::GetThickness() +float ProjectedShadow::GetThickness() { static const float PixelMargin = 1.5; // avoiding artifact between cascade levels. - const uint size = ViewSrg::m_spotLightShadows[m_shadowIndex].m_shadowmapSize; + const uint size = ViewSrg::m_projectedFilterParams[m_shadowIndex].m_shadowmapSize; if (size <= 1) { return 0.; } const float invAtlasSize = ViewSrg::m_invShadowmapAtlasSize; - const Texture2DArray shadowmap = PassSrg::m_spotLightShadowmaps; + const Texture2DArray shadowmap = PassSrg::m_projectedShadowmaps; if (m_shadowPosition.x >= 0 && m_shadowPosition.x * size < size - PixelMargin && m_shadowPosition.y >= 0 && m_shadowPosition.y * size < size - PixelMargin) @@ -320,17 +331,17 @@ float SpotLightShadow::GetThickness() return 0.; } -float SpotLightShadow::SamplePcfBicubic() +float ProjectedShadow::SamplePcfBicubic() { - const uint filteringSampleCount = ViewSrg::m_spotLightShadows[m_shadowIndex].m_filteringSampleCount; + const uint filteringSampleCount = ViewSrg::m_projectedShadows[m_shadowIndex].m_filteringSampleCount; const float3 atlasPosition = GetAtlasPosition(m_shadowPosition.xy); SampleShadowMapBicubicParameters param; - param.shadowMap = PassSrg::m_spotLightShadowmaps; + param.shadowMap = PassSrg::m_projectedShadowmaps; param.shadowPos = float3(atlasPosition.xy * ViewSrg::m_invShadowmapAtlasSize, atlasPosition.z); param.shadowMapSize = ViewSrg::m_shadowmapAtlasSize; param.invShadowMapSize = ViewSrg::m_invShadowmapAtlasSize; - param.comparisonValue = m_shadowPosition.z; + param.comparisonValue = m_shadowPosition.z - ViewSrg::m_projectedShadows[m_shadowIndex].m_bias; param.samplerState = SceneSrg::m_hwPcfSampler; if (filteringSampleCount <= 4) @@ -347,20 +358,18 @@ float SpotLightShadow::SamplePcfBicubic() } } -bool SpotLightShadow::IsShadowed(float3 shadowPosition) +bool ProjectedShadow::IsShadowed(float3 shadowPosition) { static const float PixelMargin = 1.5; // avoiding artifact between cascade levels. - ViewSrg::SpotLightShadow shadow = ViewSrg::m_spotLightShadows[m_shadowIndex]; - - const uint size = shadow.m_shadowmapSize; + const uint size = ViewSrg::m_projectedFilterParams[m_shadowIndex].m_shadowmapSize; if (size <= 1) { return false; // There is no shadowmap for this light. } const float invAtlasSize = ViewSrg::m_invShadowmapAtlasSize; - const Texture2DArray shadowmap = PassSrg::m_spotLightShadowmaps; + const Texture2DArray shadowmap = PassSrg::m_projectedShadowmaps; if (shadowPosition.x >= 0 && shadowPosition.x * size < size - PixelMargin && shadowPosition.y >= 0 && shadowPosition.y * size < size - PixelMargin) @@ -370,7 +379,8 @@ bool SpotLightShadow::IsShadowed(float3 shadowPosition) PassSrg::LinearSampler, float3(atlasPosition.xy * invAtlasSize, atlasPosition.z)).r; const float depthDiff = depthInShadowmap - shadowPosition.z; - if (depthDiff < -shadow.m_bias) + float bias = ViewSrg::m_projectedShadows[m_shadowIndex].m_bias; + if (depthDiff < -bias) { return true; } @@ -379,23 +389,19 @@ bool SpotLightShadow::IsShadowed(float3 shadowPosition) return false; } -bool SpotLightShadow::IsShadowedWithJitter( +bool ProjectedShadow::IsShadowedWithJitter( float3 jitterUnitX, float3 jitterUnitY, float jitterDepthDiffBase, uint jitterIndex) -{ - ViewSrg::SpotLightShadow shadow = ViewSrg::m_spotLightShadows[m_shadowIndex]; +{ + ViewSrg::ProjectedShadow shadow = ViewSrg::m_projectedShadows[m_shadowIndex]; const float4x4 depthBiasMatrix = shadow.m_depthBiasMatrix; const float boundaryScale = shadow.m_boundaryScale; - ViewSrg::SpotLight spotLight = ViewSrg::m_spotLights[m_lightIndex]; - float3 shadowCasterPosition = spotLight.m_position; - - const float outerConeAngle = spotLight.m_outerConeAngle; const float2 jitterXY = g_jitterTablePcf[jitterIndex]; - const float dist = distance(m_worldPosition, shadowCasterPosition); + const float dist = distance(m_worldPosition, m_viewPosition); const float boundaryRadius = dist * tan(boundaryScale); // jitterWorldXY is the jittering diff vector from the lighted point on the surface // in the world space. It is remarked as "v_J" in the comment @@ -412,18 +418,18 @@ bool SpotLightShadow::IsShadowedWithJitter( return IsShadowed(jitteredShadowmapHomogeneous.xyz / jitteredShadowmapHomogeneous.w); } -void SpotLightShadow::SetShadowPosition() +void ProjectedShadow::SetShadowPosition() { - const float4x4 depthBiasMatrix = ViewSrg::m_spotLightShadows[m_shadowIndex].m_depthBiasMatrix; + const float4x4 depthBiasMatrix = ViewSrg::m_projectedShadows[m_shadowIndex].m_depthBiasMatrix; float4 shadowPositionHomogeneous = mul(depthBiasMatrix, float4(m_worldPosition, 1)); m_shadowPosition = shadowPositionHomogeneous.xyz / shadowPositionHomogeneous.w; } -float3 SpotLightShadow::GetAtlasPosition(float2 texturePosition) +float3 ProjectedShadow::GetAtlasPosition(float2 texturePosition) { - const uint2 originInSlice = ViewSrg::m_spotLightShadows[m_shadowIndex].m_shadowmapOriginInSlice; - const uint shadowmapSize = ViewSrg::m_spotLightShadows[m_shadowIndex].m_shadowmapSize; - const uint slice = ViewSrg::m_spotLightShadows[m_shadowIndex].m_shadowmapArraySlice; + const uint2 originInSlice = ViewSrg::m_projectedFilterParams[m_shadowIndex].m_shadowmapOriginInSlice; + const uint shadowmapSize = ViewSrg::m_projectedFilterParams[m_shadowIndex].m_shadowmapSize; + const uint slice = ViewSrg::m_projectedShadows[m_shadowIndex].m_shadowmapArraySlice; const float2 coordInTexture = texturePosition * shadowmapSize + originInSlice; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/CoreLights/ViewSrg.azsli b/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/CoreLights/ViewSrg.azsli index 5c850dbfeb..5404cf8b69 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/CoreLights/ViewSrg.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/CoreLights/ViewSrg.azsli @@ -36,60 +36,64 @@ partial ShaderResourceGroup ViewSrg float2 m_padding; // explicit padding }; - // Point lights + // Simple Point Lights - struct PointLight + struct SimplePointLight { float3 m_position; float m_invAttenuationRadiusSquared; // For a radius at which this light no longer has an effect, 1 / radius^2. float3 m_rgbIntensityCandelas; - float m_bulbRadius; + float m_padding; // explicit padding. }; - StructuredBuffer m_pointLights; - uint m_pointLightCount; + StructuredBuffer m_simplePointLights; + uint m_simplePointLightCount; - // Spot Lights - - struct SpotLight + // Simple Spot Lights + + struct SimpleSpotLight { float3 m_position; float m_invAttenuationRadiusSquared; // For a radius at which this light no longer has an effect, 1 / radius^2. - + float3 m_direction; + float m_cosInnerConeAngle; // cosine of the outer cone angle float3 m_rgbIntensityCandelas; - float m_innerConeAngle; // cosine of the angle from the direction axis at which this light starts to fall off. + float m_cosOuterConeAngle; // cosine of the inner cone angle + }; - float3 m_direction; // the direction of the spot light - float m_outerConeAngle; // cosine of the angle from the direction axis at which this light no longer has an effect. + StructuredBuffer m_simpleSpotLights; + uint m_simpleSpotLightCount; - float m_penumbraBias; // bias of the falloff curve between inner and outer cone angles. - int m_shadowIndex; // index for SpotLightShadow. + // Point lights (sphere lights) - float m_bulbRadius; // Radius disk representing the spot light bulb - float m_bulbPositionOffset; // Amount of offset from the disk of the spot light to the tip of the cone. + struct PointLight + { + float3 m_position; + float m_invAttenuationRadiusSquared; // For a radius at which this light no longer has an effect, 1 / radius^2. + float3 m_rgbIntensityCandelas; + float m_bulbRadius; }; - StructuredBuffer m_spotLights; - uint m_spotLightCount; - - struct SpotLightShadow + StructuredBuffer m_pointLights; + uint m_pointLightCount; + + // Projected Shadows + + struct ProjectedShadow { float4x4 m_depthBiasMatrix; uint m_shadowmapArraySlice; // array slice who has shadowmap in the atlas. - uint2 m_shadowmapOriginInSlice; // shadowmap origin in the slice of the atlas. - uint m_shadowmapSize; // width and height of shadowmap - uint m_shadowFilterMethod; + uint m_shadowFilterMethod; // Includes overall filter method in top 16 bits and pcf method in bottom 16 bits. float m_boundaryScale; uint m_predictionSampleCount; uint m_filteringSampleCount; float2 m_unprojectConstants; float m_bias; - uint m_pcfFilterMethod; // Matches with PcfFilterMethod in ShadowConstants.h }; - StructuredBuffer m_spotLightShadows; - StructuredBuffer m_esmsSpot; + StructuredBuffer m_projectedShadows; + StructuredBuffer m_projectedFilterParams; float m_shadowmapAtlasSize; // image size of shadowmap atlas. width and height has the same value. float m_invShadowmapAtlasSize; // reciprocal of the atlas size @@ -113,6 +117,8 @@ partial ShaderResourceGroup ViewSrg uint m_debugFlags; uint m_shadowFilterMethod; float m_far_minus_near; + uint m_pcfFilterMethod; // Matches with PcfFilterMethod in ShadowConstants.h + uint m_padding[3]; }; enum ShadowFilterMethod @@ -135,10 +141,14 @@ partial ShaderResourceGroup ViewSrg { float3 m_position; float m_invAttenuationRadiusSquared; // For a radius at which this light no longer has an effect, 1 / radius^2. - float3 m_direction; - float m_bothDirectionsFactor; // 0.0f for one direction, -1.0f for both. float3 m_rgbIntensityCandelas; float m_diskRadius; + float3 m_direction; + uint m_flags; + float m_cosInnerConeAngle; + float m_cosOuterConeAngle; + float m_bulbPositionOffset; + uint m_shadowIndex; }; StructuredBuffer m_diskLights; diff --git a/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/RayTracingSceneSrg.azsli b/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/RayTracingSceneSrg.azsli index 40bbc965e2..2025e3b81b 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/RayTracingSceneSrg.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/RayTracingSceneSrg.azsli @@ -42,33 +42,19 @@ partial ShaderResourceGroup RayTracingSceneSrg StructuredBuffer m_pointLights; uint m_pointLightCount; - // spot Lights - // [GFX TODO][ATOM-4049] separate SRG for lights and shadows. - struct SpotLight - { - float3 m_position; - float m_invAttenuationRadiusSquared; // radius at which this light no longer has an effect, 1 / radius^2. - float3 m_rgbIntensityCandelas; - float m_innerConeAngle; // cosine of the angle from the direction axis at which this light starts to fall off. - float3 m_direction; // the direction of the spot light - float m_outerConeAngle; // cosine of the angle from the direction axis at which this light no longer has an effect. - float m_penumbraBias; // bias of the falloff curve between inner and outer cone angles. - int m_shadowIndex; // index for SpotLightShadow. - float2 m_padding; - }; - - StructuredBuffer m_spotLights; - uint m_spotLightCount; - - // disk Lights + // disk Lights struct DiskLight { float3 m_position; - float m_invAttenuationRadiusSquared; // radius at which this light no longer has an effect, 1 / radius^2. - float3 m_direction; - float m_bothDirectionsFactor; // 0.0f for one direction, -1.0f for both. + float m_invAttenuationRadiusSquared; // For a radius at which this light no longer has an effect, 1 / radius^2. float3 m_rgbIntensityCandelas; - float m_diskRadius; + float m_diskRadius; + float3 m_direction; + uint m_flags; + float m_cosInnerConeAngle; + float m_cosOuterConeAngle; + float m_bulbPositionOffset; + uint m_shadowIndex; }; StructuredBuffer m_diskLights; diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCulling.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCulling.azsl index b3156b8bf6..640491234f 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCulling.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCulling.azsl @@ -24,49 +24,57 @@ enum QuadLightFlag // Copied from QuadLight.azsli. See https://jira.agscollab.co UseFastApproximation = 0x02, // 1 << 1, // Use a fast approximation instead of linearly transformed cosines. }; +enum DiskLightFlag +{ + UseConeAngle = 1, +}; + ShaderResourceGroup PassSrg : SRG_PerPass { // Figure out how to remove duplicate struct definitions. // These are also defined in View.srg // https://jira.agscollab.com/browse/ATOM-3731 - struct PointLight + struct SimplePointLight { float3 m_position; float m_invAttenuationRadiusSquared; // For a radius at which this light no longer has an effect, 1 / radius^2. float3 m_rgbIntensityCandelas; - float m_bulbRadius; + float m_padding; // explicit padding. }; - struct SpotLight + struct SimpleSpotLight { float3 m_position; float m_invAttenuationRadiusSquared; // For a radius at which this light no longer has an effect, 1 / radius^2. - + float3 m_direction; + float m_cosInnerConeAngle; // cosine of the outer cone angle float3 m_rgbIntensityCandelas; - float m_innerConeAngle; // cosine of the angle from the direction axis at which this light starts to fall off. - - float3 m_direction; // the direction of the spot light - float m_outerConeAngle; // cosine of the angle from the direction axis at which this light no longer has an effect. - - float m_penumbraBias; // bias of the falloff curve between inner and outer cone angles. - - int m_shadowIndex; // index for SpotLightShadow. + float m_cosOuterConeAngle; // cosine of the inner cone angle + }; - float m_bulbRadius; // Radius disk representing the spot light bulb - float m_bulbPositionOffset; // Amount of offset from the disk of the spot light to the tip of the cone. + struct PointLight + { + float3 m_position; + float m_invAttenuationRadiusSquared; // For a radius at which this light no longer has an effect, 1 / radius^2. + float3 m_rgbIntensityCandelas; + float m_bulbRadius; }; struct DiskLight { float3 m_position; float m_invAttenuationRadiusSquared; // For a radius at which this light no longer has an effect, 1 / radius^2. - float3 m_direction; - float m_bothDirectionsFactor; // 0.0f for one direction, -1.0f for both. float3 m_rgbIntensityCandelas; float m_diskRadius; + float3 m_direction; + uint m_flags; + float m_cosInnerConeAngle; + float m_cosOuterConeAngle; + float m_bulbPositionOffset; + uint m_shadowIndex; }; - + struct CapsuleLight { float3 m_startPoint; // One of the end points of the capsule @@ -103,13 +111,15 @@ ShaderResourceGroup PassSrg : SRG_PerPass LightCullingConstants m_constantData; // Source light data + StructuredBuffer m_simplePointLights; + StructuredBuffer m_simpleSpotLights; StructuredBuffer m_pointLights; - StructuredBuffer m_spotLights; StructuredBuffer m_diskLights; StructuredBuffer m_capsuleLights; StructuredBuffer m_quadLights; + uint m_simplePointLightCount; + uint m_simpleSpotLightCount; uint m_pointLightCount; - uint m_spotLightCount; uint m_diskLightCount; uint m_capsuleLightCount; uint m_quadLightCount; @@ -306,13 +316,19 @@ void CopySharedLightsToMainMemory(uint lightCount, uint groupIndex, uint3 groupI } // Return the minz and maxz of this light in view space -float2 ComputePointLightMinMaxZ(PassSrg::PointLight light, float3 lightPosition) -{ - float lightRadius = rsqrt(light.m_invAttenuationRadiusSquared); +float2 ComputePointLightMinMaxZ(float lightRadius, float3 lightPosition) +{ float2 minmax = lightPosition.z + lightRadius * float2(-1,1) * RH_COORD_SYSTEM_REVERSE; return minmax; } +float2 ComputeSimpleSpotLightMinMax(PassSrg::SimpleSpotLight light, float3 lightPosition) +{ + float lightRadius = rsqrt(light.m_invAttenuationRadiusSquared); + float2 minmax = lightPosition.z + lightRadius * float2(-1, 1) * RH_COORD_SYSTEM_REVERSE; + return minmax; +} + // Return the minz and maxz of this quad light in view space // Quad light must be double sided float2 ComputeQuadLightMinMaxZ_DoubleSided(PassSrg::QuadLight light, float3 lightPosition) @@ -330,16 +346,9 @@ float2 ComputeQuadLightMinMaxZ_SingleSided(PassSrg::QuadLight light, float3 ligh return ComputeQuadLightMinMaxZ_DoubleSided(light, lightPosition); } -float2 ComputeSpotLightMinMax(PassSrg::SpotLight light, float3 lightPosition) -{ - float lightRadius = rsqrt(light.m_invAttenuationRadiusSquared) + light.m_bulbPositionOffset; - float2 minmax = lightPosition.z + lightRadius * float2(-1, 1) * RH_COORD_SYSTEM_REVERSE; - return minmax; -} - float2 ComputeDiskLightMinMax(PassSrg::DiskLight light, float3 lightPosition) { - float lightRadius = rsqrt(light.m_invAttenuationRadiusSquared); + float lightRadius = rsqrt(light.m_invAttenuationRadiusSquared) + light.m_bulbPositionOffset; float2 minmax = lightPosition.z + lightRadius * float2(-1, 1) * RH_COORD_SYSTEM_REVERSE; return minmax; } @@ -375,44 +384,58 @@ void CullDecals(uint groupIndex, TileLightData tileLightData, float3 aabb_center } } -void CullPointLights(uint groupIndex, TileLightData tileLightData, float3 aabb_center, float3 aabb_extents, float2 tile_center_uv) +void CullPointLight(uint lightIndex, float3 lightPosition, float invLightRadius, TileLightData tileLightData, float3 aabb_center, float3 aabb_extents) +{ + lightPosition = WorldToView_Point(lightPosition); + bool potentiallyIntersects = TestSphereVsAabbInvSqrt(lightPosition, invLightRadius, aabb_center, aabb_extents); + if (potentiallyIntersects) + { + // Implement and profile fine-grained light culling testing + // https://jira.agscollab.com/browse/ATOM-3732 + + uint inside = 0; + float2 minmax = ComputePointLightMinMaxZ(rsqrt(invLightRadius), lightPosition); + if (IsObjectInsideTile(tileLightData, minmax, inside)) + { + MarkLightAsVisibleInSharedMemory(lightIndex, inside); + } + } +} + +void CullSimplePointLights(uint groupIndex, TileLightData tileLightData, float3 aabb_center, float3 aabb_extents) +{ + for (uint lightIndex = groupIndex ; lightIndex < PassSrg::m_simplePointLightCount ; lightIndex += TILE_DIM_X * TILE_DIM_Y) + { + PassSrg::SimplePointLight light = PassSrg::m_simplePointLights[lightIndex]; + CullPointLight(lightIndex, light.m_position, light.m_invAttenuationRadiusSquared, tileLightData, aabb_center, aabb_extents); + } +} + +void CullPointLights(uint groupIndex, TileLightData tileLightData, float3 aabb_center, float3 aabb_extents) { for (uint lightIndex = groupIndex ; lightIndex < PassSrg::m_pointLightCount ; lightIndex += TILE_DIM_X * TILE_DIM_Y) { PassSrg::PointLight light = PassSrg::m_pointLights[lightIndex]; - float3 lightPosition = WorldToView_Point(light.m_position); - bool potentiallyIntersects = TestSphereVsAabbInvSqrt(lightPosition, light.m_invAttenuationRadiusSquared, aabb_center, aabb_extents); - if (potentiallyIntersects) - { - // Implement and profile fine-grained light culling testing - // https://jira.agscollab.com/browse/ATOM-3732 - - uint inside = 0; - float2 minmax = ComputePointLightMinMaxZ(light, lightPosition); - if (IsObjectInsideTile(tileLightData, minmax, inside)) - { - MarkLightAsVisibleInSharedMemory(lightIndex, inside); - } - } + CullPointLight(lightIndex, light.m_position, light.m_invAttenuationRadiusSquared, tileLightData, aabb_center, aabb_extents); } } -void CullSpotLights(uint groupIndex, TileLightData tileLightData, float3 aabb_center, float3 aabb_extents) +void CullSimpleSpotLights(uint groupIndex, TileLightData tileLightData, float3 aabb_center, float3 aabb_extents) { - for (uint lightIndex = groupIndex ; lightIndex < PassSrg::m_spotLightCount ; lightIndex += TILE_DIM_X * TILE_DIM_Y) + for (uint lightIndex = groupIndex ; lightIndex < PassSrg::m_simpleSpotLightCount ; lightIndex += TILE_DIM_X * TILE_DIM_Y) { - PassSrg::SpotLight light = PassSrg::m_spotLights[lightIndex]; - float3 lightPosition = WorldToView_Point(light.m_position - light.m_bulbPositionOffset * light.m_direction); + PassSrg::SimpleSpotLight light = PassSrg::m_simpleSpotLights[lightIndex]; + float3 lightPosition = WorldToView_Point(light.m_position); float3 lightDirection = WorldToView_Vector(light.m_direction); - bool potentiallyIntersects = TestSphereVsCone(aabb_center, length(aabb_extents), lightPosition, lightDirection, light.m_outerConeAngle, rsqrt(light.m_invAttenuationRadiusSquared) + light.m_bulbPositionOffset); + bool potentiallyIntersects = TestSphereVsCone(aabb_center, length(aabb_extents), lightPosition, lightDirection, light.m_cosOuterConeAngle, rsqrt(light.m_invAttenuationRadiusSquared)); if (potentiallyIntersects) { // Implement and profile fine-grained light culling testing // https://jira.agscollab.com/browse/ATOM-3732 uint inside = 0; - float2 minmax = ComputeSpotLightMinMax(light, lightPosition); + float2 minmax = ComputeSimpleSpotLightMinMax(light, lightPosition); if (IsObjectInsideTile(tileLightData, minmax, inside)) { MarkLightAsVisibleInSharedMemory(lightIndex, inside); @@ -421,29 +444,36 @@ void CullSpotLights(uint groupIndex, TileLightData tileLightData, float3 aabb_ce } } - void CullDiskLights(uint groupIndex, TileLightData tileLightData, float3 aabb_center, float3 aabb_extents) { - for (uint lightIndex = groupIndex ; lightIndex < PassSrg::m_diskLightCount ; lightIndex += TILE_DIM_X * TILE_DIM_Y) { PassSrg::DiskLight light = PassSrg::m_diskLights[lightIndex]; - float3 lightPosition = WorldToView_Point(light.m_position); + float3 lightPosition = WorldToView_Point(light.m_position - light.m_bulbPositionOffset * light.m_direction); float lightRadius = rsqrt(light.m_invAttenuationRadiusSquared) + light.m_diskRadius; float lightRadiusSqr = lightRadius * lightRadius; float aabbRadius = length(aabb_extents); - bool potentiallyIntersects = TestSphereVsAabb(lightPosition, lightRadiusSqr, aabb_center, aabb_extents); + float3 lightDirection = WorldToView_Vector(light.m_direction); - if (potentiallyIntersects && light.m_bothDirectionsFactor == 0) - { - // Only one side is visible, check that we are above the hemisphere - float3 lightDirection = WorldToView_Vector(light.m_direction); - float3 toAABBCenter = aabb_center - lightPosition; - float distanceToLightPlane = dot(lightDirection, toAABBCenter); + bool potentiallyIntersects; + if (light.m_flags & DiskLightFlag::UseConeAngle > 0) + { + potentiallyIntersects = TestSphereVsCone(aabb_center, length(aabb_extents), lightPosition, lightDirection, light.m_cosOuterConeAngle, rsqrt(light.m_invAttenuationRadiusSquared) + light.m_bulbPositionOffset); + } + else + { + potentiallyIntersects = TestSphereVsAabb(lightPosition, lightRadiusSqr, aabb_center, aabb_extents); + + if (potentiallyIntersects) + { + // Only one side is visible, check that we are above the hemisphere + float3 toAABBCenter = aabb_center - lightPosition; + float distanceToLightPlane = dot(lightDirection, toAABBCenter); - potentiallyIntersects = distanceToLightPlane >= -aabbRadius; - } - + potentiallyIntersects = distanceToLightPlane >= -aabbRadius; + } + } + if (potentiallyIntersects) { // Implement and profile fine-grained light culling testing @@ -454,7 +484,7 @@ void CullDiskLights(uint groupIndex, TileLightData tileLightData, float3 aabb_ce if (IsObjectInsideTile(tileLightData, minmax, inside)) { MarkLightAsVisibleInSharedMemory(lightIndex, inside); - } + } } } } @@ -603,11 +633,6 @@ uint WriteCullingDataToMainMemory(uint lightCount, uint groupIndex, uint3 groupI // Point light index << 16 | bitmask contains which bits the light is present in // ... // End of Group -// Spot light index << 16 | bitmask contains which bits the light is present in -// Spot light index << 16 | bitmask contains which bits the light is present in -// Spot light index << 16 | bitmask contains which bits the light is present in -// ... -// End of Group // Disk light index << 16 | bitmask contains which bits the light is present in // Disk light index << 16 | bitmask contains which bits the light is present in // Disk light index << 16 | bitmask contains which bits the light is present in @@ -643,14 +668,19 @@ void MainCS( ClearSharedLightCountWithDoubleBarrier(groupIndex); - CullPointLights(groupIndex, tileLightData, aabb_center, aabb_extents, tileCenterUv); + CullSimplePointLights(groupIndex, tileLightData, aabb_center, aabb_extents); lightCount = WriteCullingDataToMainMemory(lightCount, groupIndex, groupID ); ClearSharedLightCountWithDoubleBarrier(groupIndex); - CullSpotLights(groupIndex, tileLightData, aabb_center, aabb_extents); + CullSimpleSpotLights(groupIndex, tileLightData, aabb_center, aabb_extents); lightCount = WriteCullingDataToMainMemory(lightCount, groupIndex, groupID ); + + ClearSharedLightCountWithDoubleBarrier(groupIndex); + CullPointLights(groupIndex, tileLightData, aabb_center, aabb_extents); + lightCount = WriteCullingDataToMainMemory(lightCount, groupIndex, groupID ); + ClearSharedLightCountWithDoubleBarrier(groupIndex); CullDiskLights(groupIndex, tileLightData, aabb_center, aabb_extents); diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/MorphTargets/MorphTargetCS.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/MorphTargets/MorphTargetCS.azsl index 68d4238c1a..3f83940189 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/MorphTargets/MorphTargetCS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/MorphTargets/MorphTargetCS.azsl @@ -21,6 +21,9 @@ rootconstant uint s_targetPositionOffset; rootconstant uint s_targetNormalOffset; rootconstant uint s_targetTangentOffset; rootconstant uint s_targetBitangentOffset; +rootconstant uint s_targetColorOffset; + +option bool o_hasColorDeltas = false; void WriteDeltaToAccumulationBuffer(float3 delta, uint offset, uint morphedVertexIndex) { @@ -71,7 +74,6 @@ void MainCS(uint3 thread_id: SV_DispatchThreadID) compressedTangentDelta.x = (delta.m_compressedNormalDeltaZTangentDelta >> 16) & 0x000000FF; compressedTangentDelta.y = (delta.m_compressedNormalDeltaZTangentDelta >> 8) & 0x000000FF; compressedTangentDelta.z = delta.m_compressedNormalDeltaZTangentDelta & 0x000000FF; - // Now that we have the compressed normals and tangents, unpack them and write them to the accumulation buffer float3 normalDelta = DecodeTBNDelta(compressedNormalDelta) * s_weight; @@ -89,5 +91,18 @@ void MainCS(uint3 thread_id: SV_DispatchThreadID) // Now that we have the compressed bitangents, unpack them and write them to the accumulation buffer float3 bitangentDelta = DecodeTBNDelta(compressedBitangentDelta) * s_weight; WriteDeltaToAccumulationBuffer(bitangentDelta, s_targetBitangentOffset, morphedVertexIndex); + + if (o_hasColorDeltas) + { + uint4 compressedColorDelta; + // Colors are in the least significant 24 bits (8 bits per channel) + compressedColorDelta.r = (delta.m_compressedColorDeltaRGBA >> 24) & 0x000000FF; + compressedColorDelta.g = (delta.m_compressedColorDeltaRGBA >> 16) & 0x000000FF; + compressedColorDelta.b = (delta.m_compressedColorDeltaRGBA >> 8) & 0x000000FF; + compressedColorDelta.a = delta.m_compressedColorDeltaRGBA & 0x000000FF; + + float4 colorDelta = DecodeColorDelta(compressedColorDelta) * s_weight; + WriteDeltaToAccumulationBuffer(colorDelta, s_targetColorOffset, morphedVertexIndex); + } } } diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/MorphTargets/MorphTargetSRG.azsli b/Gems/Atom/Feature/Common/Assets/Shaders/MorphTargets/MorphTargetSRG.azsli index 6baa0ed474..7ec5b43368 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/MorphTargets/MorphTargetSRG.azsli +++ b/Gems/Atom/Feature/Common/Assets/Shaders/MorphTargets/MorphTargetSRG.azsli @@ -33,8 +33,10 @@ struct MorphTargetDelta uint m_compressedNormalDeltaZTangentDelta; // 8 bit padding plus 8 bits per component for bitangent deltas uint m_compressedPadBitangentDeltaXYZ; + // 8 bits per component for color delta + uint m_compressedColorDeltaRGBA; // Extra padding so the struct is 16 byte aligned for structured buffers - uint3 m_pad; + uint2 m_pad; }; // Input to the morph target compute shader diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningCS.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningCS.azsl index 496c215a00..cae3011688 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningCS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningCS.azsl @@ -17,7 +17,9 @@ option enum class SkinningMethod { LinearSkinning, DualQuaternion } o_skinningMethod = SkinningMethod::LinearSkinning; option bool o_applyMorphTargets = false; +option bool o_applyColorMorphTargets = false; +// Apply a morph target delta with three components void ApplyMorphTargetDelta(uint streamOffset, uint vertexIndex, inout float3 modifiedValue) { // Get the start of the current delta @@ -39,6 +41,32 @@ void ApplyMorphTargetDelta(uint streamOffset, uint vertexIndex, inout float3 mod modifiedValue += decodedFloats; } +// Apply a morph target delta with four components + +void ApplyMorphTargetDelta(uint streamOffset, uint vertexIndex, inout float4 modifiedValue) +{ + // Get the start of the current delta + uint offset = streamOffset + vertexIndex * 4; + + // Read in the encoded deltas + uint4 encodedInts; + encodedInts.x = asint(PassSrg::m_skinnedMeshOutputStream[offset]); + encodedInts.y = asint(PassSrg::m_skinnedMeshOutputStream[offset + 1]); + encodedInts.z = asint(PassSrg::m_skinnedMeshOutputStream[offset + 2]); + encodedInts.w = asint(PassSrg::m_skinnedMeshOutputStream[offset + 3]); + + // Since we're done reading, re-set the accumulation to 0 for the next frame + PassSrg::m_skinnedMeshOutputStream[offset] = asfloat(0); + PassSrg::m_skinnedMeshOutputStream[offset + 1] = asfloat(0); + PassSrg::m_skinnedMeshOutputStream[offset + 2] = asfloat(0); + PassSrg::m_skinnedMeshOutputStream[offset + 3] = asfloat(0); + + // Now decode and apply the delta + float4 decodedFloats = DecodeIntsToFloats(encodedInts, InstanceSrg::m_morphTargetDeltaInverseIntegerEncoding); + modifiedValue += decodedFloats; +} + + //! Utility function for vertex shaders to transform vertex tangent, bitangent, and normal vectors into world space based on MikkT conventions. //! Structured like ConstructTBN from TangentSpace.azsli, but uses a float3x3 for the localToWorld matrix. //! It does not flip the bitangent using the w component of the tangent, and instead assumes that the input bitangent is already oriented correctly. @@ -168,6 +196,16 @@ void MainCS(uint3 thread_id: SV_DispatchThreadID) ApplyMorphTargetDelta(InstanceSrg::m_morphTargetTangentDeltaOffset, i, tangent.xyz); ApplyMorphTargetDelta(InstanceSrg::m_morphTargetBitangentDeltaOffset, i, bitangent); } + + if (o_applyColorMorphTargets) + { + float4 color = InstanceSrg::m_sourceColors[i]; + ApplyMorphTargetDelta(InstanceSrg::m_morphTargetColorDeltaOffset, i, color); + PassSrg::m_skinnedMeshOutputStream[InstanceSrg::m_targetColors + i * 4] = color.r; + PassSrg::m_skinnedMeshOutputStream[InstanceSrg::m_targetColors + i * 4 + 1] = color.g; + PassSrg::m_skinnedMeshOutputStream[InstanceSrg::m_targetColors + i * 4 + 2] = color.b; + PassSrg::m_skinnedMeshOutputStream[InstanceSrg::m_targetColors + i * 4 + 3] = color.a; + } switch(o_skinningMethod) { diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningPassSRG.azsli b/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningPassSRG.azsli index 824325f58e..5a9e44bade 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningPassSRG.azsli +++ b/Gems/Atom/Feature/Common/Assets/Shaders/SkinnedMesh/LinearSkinningPassSRG.azsli @@ -31,21 +31,39 @@ ShaderResourceGroup InstanceSrg : SRG_PerDraw Buffer m_sourceBiTangents; // BITANGENT 0 ByteAddressBuffer m_sourceBlendIndices; // BLENDINDICES 0 Buffer m_sourceBlendWeights; // BLENDWEIGHTS 0 + + // Optional color input, if colors are being morphed by morph targets + Buffer m_sourceColors; // COLOR 0 // Per-instance input StructuredBuffer m_boneTransformsLinear; StructuredBuffer m_boneTransformsDualQuaternion; // Per-instance morph target input + // Offsets to the locations in the accumulation buffer that hold + // the sum of all deltas for vertex 0. Each thread can further offset into the buffer + // using the thread id to find the delta for the vertex the thread is working on. uint m_morphTargetPositionDeltaOffset; uint m_morphTargetNormalDeltaOffset; uint m_morphTargetTangentDeltaOffset; uint m_morphTargetBitangentDeltaOffset; + uint m_morphTargetColorDeltaOffset; + + // Morph target deltas are stored as signed integers in order to make use of + // InterlockedAdd to accumulate them. They are multiplied by the integer + // encoding when encoding from float->int, and must be multiplied + // by the inverse when decoding from int->float float m_morphTargetDeltaInverseIntegerEncoding; // Per-instance output + // Offsets to the locations in the output stream with the skinning result + // for vertex 0. Each thread can further offset into the buffer using + // the thread id to find the output location for the vertex the thread is working on. uint m_targetPositions; uint m_targetNormals; uint m_targetTangents; uint m_targetBiTangents; + + // Optional color output, if colors are being morphed by morph targets + uint m_targetColors; } diff --git a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake index 91bb1999c2..1b8c0e0987 100644 --- a/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake +++ b/Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake @@ -191,7 +191,7 @@ set(FILES Passes/SMAAConvertToPerceptualColor.pass Passes/SMAAEdgeDetection.pass Passes/SMAANeighborhoodBlending.pass - Passes/SpotLightShadowmaps.pass + Passes/ProjectedShadowmaps.pass Passes/SsaoCompute.pass Passes/SsaoHalfRes.pass Passes/SsaoParent.pass @@ -249,7 +249,6 @@ set(FILES ShaderLib/Atom/Features/PBR/Lights/PointLight.azsli ShaderLib/Atom/Features/PBR/Lights/PolygonLight.azsli ShaderLib/Atom/Features/PBR/Lights/QuadLight.azsli - ShaderLib/Atom/Features/PBR/Lights/SpotLight.azsli ShaderLib/Atom/Features/PBR/Microfacet/Brdf.azsli ShaderLib/Atom/Features/PBR/Microfacet/Fresnel.azsli ShaderLib/Atom/Features/PBR/Microfacet/Ggx.azsli @@ -274,7 +273,7 @@ set(FILES ShaderLib/Atom/Features/Shadow/JitterTablePcf.azsli ShaderLib/Atom/Features/Shadow/Shadow.azsli ShaderLib/Atom/Features/Shadow/ShadowmapAtlasLib.azsli - ShaderLib/Atom/Features/Shadow/SpotLightShadow.azsli + ShaderLib/Atom/Features/Shadow/ProjectedShadow.azsli ShaderResourceGroups/SceneSrg.azsli ShaderResourceGroups/SceneSrgAll.azsli ShaderResourceGroups/SceneTimeSrg.azsli diff --git a/Gems/Atom/Feature/Common/Code/CMakeLists.txt b/Gems/Atom/Feature/Common/Code/CMakeLists.txt index 199463c7b4..93da352c6e 100644 --- a/Gems/Atom/Feature/Common/Code/CMakeLists.txt +++ b/Gems/Atom/Feature/Common/Code/CMakeLists.txt @@ -31,7 +31,6 @@ ly_add_target( Include Source 3rdParty/ACES - ../External/ImGui COMPILE_DEFINITIONS PRIVATE IMGUI_DISABLE_OBSOLETE_FUNCTIONS diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/CoreLightsConstants.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/CoreLightsConstants.h index 534edf1399..cddb2d56dc 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/CoreLightsConstants.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/CoreLightsConstants.h @@ -18,7 +18,7 @@ namespace AZ { namespace Render { - static constexpr float MaxSpotLightConeAngleDegree = 360.f; - static constexpr float MaxSpotLightConeAngleDegreeWithShadow = 170.f; + static constexpr float MaxDiskLightConeAngleDegree = 180.0f; + static constexpr float MaxDiskLightConeAngleDegreeWithShadow = 170.f; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h index 28528c0274..0d6811dedf 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DirectionalLightFeatureProcessorInterface.h @@ -169,6 +169,9 @@ namespace AZ //! @param width Boundary width. The shadow is gradually changed the degree of shadowed. //! If width == 0, softening edge is disabled. Units are in meters. virtual void SetShadowBoundaryWidth(LightHandle handle, float boundaryWidth) = 0; + + //! Sets the shadowmap Pcf method. + virtual void SetPcfMethod(LightHandle handle, PcfMethod method) = 0; }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DiskLightFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DiskLightFeatureProcessorInterface.h index 44db942baa..50c0aa2455 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DiskLightFeatureProcessorInterface.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/DiskLightFeatureProcessorInterface.h @@ -14,6 +14,7 @@ #include #include +#include namespace AZ { @@ -24,19 +25,29 @@ namespace AZ { struct DiskLightData { + enum Flags + { + UseConeAngle = 0b1, + }; + AZStd::array m_position = { { 0.0f, 0.0f, 0.0f } }; float m_invAttenuationRadiusSquared = 0.0f; // Inverse of the distance at which this light no longer has an effect, squared. Also used for falloff calculations. - AZStd::array m_direction = { { 0.0f, 0.0f, 0.0f } }; - float m_bothDirectionsFactor = 0.0f; // 0.0f if single direction, -1.0f if both directions. + AZStd::array m_rgbIntensity = { { 0.0f, 0.0f, 0.0f } }; float m_diskRadius = 0.0f; // Radius of disk light in meters. - void SetLightEmitsBothDirections(bool isBothDirections) - { - m_bothDirectionsFactor = isBothDirections ? -1.0f : 0.0f; - } + AZStd::array m_direction = { { 1.0f, 0.0f, 0.0f } }; + uint32_t m_flags = 0; // See Flags enum above. + + float m_cosInnerConeAngle = 0.0f; // cosine of inner cone angle + float m_cosOuterConeAngle = 0.0f; // cosine of outer cone angle + float m_bulbPositionOffset = 0.0f; // Distance from the light disk surface to the tip of the cone of the light. m_bulbRadius * tanf(pi/2 - m_outerConeAngle). + uint16_t m_shadowIndex = -1; // index for ProjectedShadowData. A value of 0xFFFF indicates an illegal index. + uint16_t m_padding; // Explicit padding. }; + static constexpr size_t size = sizeof(DiskLightData); + //! DiskLightFeatureProcessorInterface provides an interface to acquire, release, and update a disk light. This is necessary for code outside of //! the Atom features gem to communicate with the DiskLightFeatureProcessor. class DiskLightFeatureProcessorInterface @@ -55,21 +66,46 @@ namespace AZ //! Creates a new LightHandle by copying data from an existing LightHandle. virtual LightHandle CloneLight(LightHandle handle) = 0; + // Generic Disk Light Settings + //! Sets the intensity in RGB candela for a given LightHandle. virtual void SetRgbIntensity(LightHandle handle, const PhotometricColor& lightColor) = 0; //! Sets the position for a given LightHandle. virtual void SetPosition(LightHandle handle, const AZ::Vector3& lightPosition) = 0; //! Sets the direction for a given LightHandle. virtual void SetDirection(LightHandle handle, const AZ::Vector3& lightDirection) = 0; - //! Sets if the disk light emits light in both directions for a given LightHandle. - virtual void SetLightEmitsBothDirections(LightHandle handle, bool lightEmitsBothDirections) = 0; //! Sets the radius in meters at which the provided LightHandle will no longer have an effect. virtual void SetAttenuationRadius(LightHandle handle, float attenuationRadius) = 0; //! Sets the disk radius for the provided LightHandle. virtual void SetDiskRadius(LightHandle handle, float radius) = 0; + // Cone Angle Settings + + //! Sets whether the disk should constrain its light to a cone. (use SetInnerConeAngle and SetOuterConeAngle to set cone angle parameters) + virtual void SetConstrainToConeLight(LightHandle handle, bool useCone) = 0; + //! Sets the inner and outer cone angles in radians. + virtual void SetConeAngles(LightHandle handle, float innerRadians, float outerRadians) = 0; + + // Shadow Settings + + //! Sets if shadows are enabled + virtual void SetShadowsEnabled(LightHandle handle, bool enabled) = 0; + //! Sets the shadowmap size (width and height) of the light. + virtual void SetShadowmapMaxResolution(LightHandle handle, ShadowmapSize shadowmapSize) = 0; + //! Specifies filter method of shadows. + virtual void SetShadowFilterMethod(LightHandle handle, ShadowFilterMethod method) = 0; + //! Specifies the width of boundary between shadowed area and lit area in radians. The degree ofshadowed gradually changes on the boundary. 0 disables softening. + virtual void SetSofteningBoundaryWidthAngle(LightHandle handle, float boundaryWidthRadians) = 0; + //! Sets sample count to predict boundary of shadow (up to 16). It will be clamped to be less than or equal to the filtering sample count. + virtual void SetPredictionSampleCount(LightHandle handle, uint16_t count) = 0; + //! Sets sample count for filtering of shadow boundary (up to 64) + virtual void SetFilteringSampleCount(LightHandle handle, uint16_t count) = 0; + //! Sets the shadowmap Pcf (percentage closer filtering) method. + virtual void SetPcfMethod(LightHandle handle, PcfMethod method) = 0; + //! Sets all of the the disk data for the provided LightHandle. virtual void SetDiskData(LightHandle handle, const DiskLightData& data) = 0; + }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/ShadowConstants.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/ShadowConstants.h index a2702b262f..bd324ac1d7 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/ShadowConstants.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/ShadowConstants.h @@ -41,7 +41,7 @@ namespace AZ Count }; - enum class PcfMethod : uint32_t + enum class PcfMethod : uint16_t { BoundarySearch = 0, // Performs a variable number of taps, first to determine if we are on a shadow boundary, then the remaining taps are to find the occlusion amount Bicubic, // Uses a fixed size Pcf kernel with kernel weights set to approximate bicubic filtering diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/SimplePointLightFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/SimplePointLightFeatureProcessorInterface.h new file mode 100644 index 0000000000..c2a286d15d --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/SimplePointLightFeatureProcessorInterface.h @@ -0,0 +1,49 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include + +namespace AZ +{ + class Vector3; + + namespace Render + { + //! SimplePointLightFeatureProcessorInterface provides an interface to acquire, release, and update a point light. + class SimplePointLightFeatureProcessorInterface + : public RPI::FeatureProcessor + { + public: + AZ_RTTI(AZ::Render::SimplePointLightFeatureProcessorInterface, "{B6FABD69-ED5B-4D6C-8695-27CB95D13CE4}", AZ::RPI::FeatureProcessor); + + using LightHandle = RHI::Handle; + static constexpr PhotometricUnit PhotometricUnitType = PhotometricUnit::Candela; + + //! Creates a new point light which can be referenced by the returned LightHandle. Must be released via ReleaseLight() when no longer needed. + virtual LightHandle AcquireLight() = 0; + //! Releases a LightHandle which removes the point light. + virtual bool ReleaseLight(LightHandle& handle) = 0; + //! Creates a new LightHandle by copying data from an existing LightHandle. + virtual LightHandle CloneLight(LightHandle handle) = 0; + + //! Sets the intensity in RGB candela for a given LightHandle. + virtual void SetRgbIntensity(LightHandle handle, const PhotometricColor& lightColor) = 0; + //! Sets the position for a given LightHandle. + virtual void SetPosition(LightHandle handle, const AZ::Vector3& lightPosition) = 0; + //! Sets the radius in meters at which the provided LightHandle will no longer have an effect. + virtual void SetAttenuationRadius(LightHandle handle, float attenuationRadius) = 0; + }; + } // namespace Render +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/SimpleSpotLightFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/SimpleSpotLightFeatureProcessorInterface.h new file mode 100644 index 0000000000..78ad25cc2c --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/SimpleSpotLightFeatureProcessorInterface.h @@ -0,0 +1,53 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include + +namespace AZ +{ + class Vector3; + + namespace Render + { + //! SimpleSpotLightFeatureProcessorInterface provides an interface to acquire, release, and update a simple spot light. + class SimpleSpotLightFeatureProcessorInterface + : public RPI::FeatureProcessor + { + public: + AZ_RTTI(AZ::Render::SimpleSpotLightFeatureProcessorInterface, "{1DE04BF2-DD8F-437C-9B6D-4BDAC4BE2BAC}", AZ::RPI::FeatureProcessor); + + using LightHandle = RHI::Handle; + static constexpr PhotometricUnit PhotometricUnitType = PhotometricUnit::Candela; + + //! Creates a new spot light which can be referenced by the returned LightHandle. Must be released via ReleaseLight() when no longer needed. + virtual LightHandle AcquireLight() = 0; + //! Releases a LightHandle which removes the spot light. + virtual bool ReleaseLight(LightHandle& handle) = 0; + //! Creates a new LightHandle by copying data from an existing LightHandle. + virtual LightHandle CloneLight(LightHandle handle) = 0; + + //! Sets the intensity in RGB candela for a given LightHandle. + virtual void SetRgbIntensity(LightHandle handle, const PhotometricColor& lightColor) = 0; + //! Sets the position for a given LightHandle. + virtual void SetPosition(LightHandle handle, const AZ::Vector3& lightPosition) = 0; + //! Sets the direction for a given LightHandle. + virtual void SetDirection(LightHandle handle, const AZ::Vector3& lightDirection) = 0; + //! Sets the radius in meters at which the provided LightHandle will no longer have an effect. + virtual void SetAttenuationRadius(LightHandle handle, float attenuationRadius) = 0; + //! Sets the inner and outer cone angles in radians. + virtual void SetConeAngles(LightHandle handle, float innerRadians, float outerRadians) = 0; + }; + } // namespace Render +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/SpotLightFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/SpotLightFeatureProcessorInterface.h deleted file mode 100644 index a237bca627..0000000000 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/CoreLights/SpotLightFeatureProcessorInterface.h +++ /dev/null @@ -1,110 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include -#include -#include - -namespace AZ -{ - class Color; - class Vector3; - - namespace Render - { - struct SpotLightData - { - AZStd::array m_position = { { 0.0f, 0.0f, 0.0f } }; - float m_invAttenuationRadiusSquared = 0.0f; // Inverse of the distance at which this light no longer has an effect, squared. Also used for falloff calculations. - - AZStd::array m_rgbIntensity = { { 0.0f, 0.0f, 0.0f } }; - float m_innerConeAngle; // cosine of the angle from the direction axis at which this light starts to fall off. - - AZStd::array m_direction = { { 1.0f, 0.0f, 0.0f } }; - float m_outerConeAngle; // cosine of the angle from the direction axis at which this light no longer has an effect. - - float m_penumbraBias = 0.0f; // controls biasing the falloff curve between inner and outer cone angles. - - int32_t m_shadowIndex = -1; // index for SpotLightShadowData. - // a minus value indicates an illegal index. - - float m_bulbRadius = 0.0f; // Size of the disk in meters representing the spot light bulb. - - float m_bulbPostionOffset = 0.0f; // Distance from the light disk surface to the tip of the cone of the light. m_bulbRadius * tanf(pi/2 - m_outerConeAngle). - }; - - //! SpotLightFeatureProcessorInterface provides an interface to acquire, release, and update a spot light. This is necessary for code outside of - //! the Atom features gem to communicate with the SpotLightFeatureProcessor. - class SpotLightFeatureProcessorInterface - : public RPI::FeatureProcessor - { - public: - AZ_RTTI(AZ::Render::SpotLightFeatureProcessorInterface, "{9424429B-C5E9-4CF2-9512-7911778E2836}", AZ::RPI::FeatureProcessor); - - using LightHandle = RHI::Handle; - - //! Creates a new spot light which can be referenced by the returned LightHandle. Must be released via ReleaseLight() when no longer needed. - virtual LightHandle AcquireLight() = 0; - //! Releases a LightHandle which removes the spot light. - virtual bool ReleaseLight(LightHandle& handle) = 0; - //! Creates a new LightHandle by copying data from an existing LightHandle. - virtual LightHandle CloneLight(LightHandle handle) = 0; - - //! Sets the intensity in RGB candela for a given LightHandle. - virtual void SetRgbIntensity(LightHandle handle, const PhotometricColor& lightColor) = 0; - //! Sets the position of the spot light. - virtual void SetPosition(LightHandle handle, const Vector3& lightPosition) = 0; - //! Sets the direction of the spot light. direction should be normalized. - virtual void SetDirection(LightHandle handle, const Vector3& direction) = 0; - //! Sets the bulb radius of the spot light in meters. - virtual void SetBulbRadius(LightHandle handle, float bulbRadius) = 0; - //! Sets the inner and outer cone angles in degrees. - virtual void SetConeAngles(LightHandle handle, float innerDegrees, float outerDegrees) = 0; - //! Sets a -1 to +1 value that adjusts the bias of the interpolation of light intensity from the inner cone to the outer. - virtual void SetPenumbraBias(LightHandle handle, float penumbraBias) = 0; - //! Sets the radius in meters at which the provided LightHandle will no longer have an effect. - virtual void SetAttenuationRadius(LightHandle handle, float attenuationRadius) = 0; - //! Sets the shadowmap size (width and height) of the light. - virtual void SetShadowmapSize(LightHandle handle, ShadowmapSize shadowmapSize) = 0; - //! Sets the shadowmap Pcf method. - virtual void SetPcfMethod(LightHandle handle, PcfMethod method) = 0; - - //! This specifies filter method of shadows. - //! @param handle the light handle. - //! @param method filter method. - virtual void SetShadowFilterMethod(LightHandle handle, ShadowFilterMethod method) = 0; - - //! This specifies the width of boundary between shadowed area and lit area. - //! @param handle the light handle. - //! @param width Boundary width. The degree of shadowed gradually changes on the boundary. - //! If width == 0, softening edge is disabled. Units are in degrees. - virtual void SetShadowBoundaryWidthAngle(LightHandle handle, float boundaryWidthDegree) = 0; - - //! This sets sample count to predict boundary of shadow. - //! @param handle the light handle. - //! @param count Sample Count for prediction of whether the pixel is on the boundary (up to 16) - //! The value should be less than or equal to m_filteringSampleCount. - virtual void SetPredictionSampleCount(LightHandle handle, uint16_t count) = 0; - - //! This sets sample count for filtering of shadow boundary. - //! @param handle the light handle. - //! @param count Sample Count for filtering (up to 64) - virtual void SetFilteringSampleCount(LightHandle handle, uint16_t count) = 0; - - //! Sets all of the the spot light data for the provided LightHandle. - virtual void SetSpotLightData(LightHandle handle, const SpotLightData& data) = 0; - }; - } // namespace Render -} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/MorphTargets/MorphTargetInputBuffers.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/MorphTargets/MorphTargetInputBuffers.h index 8e5d91198f..56ecd7de4d 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/MorphTargets/MorphTargetInputBuffers.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/MorphTargets/MorphTargetInputBuffers.h @@ -63,6 +63,7 @@ namespace AZ float m_maxDelta; uint32_t m_vertexCount; uint32_t m_positionOffset; + bool m_hasColorDeltas; }; namespace MorphTargetConstants @@ -82,6 +83,7 @@ namespace AZ uint32_t m_accumulatedNormalDeltaOffsetInBytes; uint32_t m_accumulatedTangentDeltaOffsetInBytes; uint32_t m_accumulatedBitangentDeltaOffsetInBytes; + uint32_t m_accumulatedColorDeltaOffsetInBytes; }; }// Render diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ParamMacros/ParamMacrosHowTo.inl b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ParamMacros/ParamMacrosHowTo.inl index cbb9dc945c..420fe518f2 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ParamMacros/ParamMacrosHowTo.inl +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ParamMacros/ParamMacrosHowTo.inl @@ -148,7 +148,7 @@ // } // // As you can see, this macro pattern allows us to add a member to Box or Cylinder by adding a single line to BoxParams.inl or CylinderParams.inl -// Because of the number of classes an boiler plate code involved in creating Lumberyard Component, this macro system allows us to change one line +// Because of the number of classes an boiler plate code involved in creating Open 3D Engine Component, this macro system allows us to change one line // in one file instead of changing over a dozens of lines in half a dozen files. // // ___________________________________________________________________________________________________________________________________________________ diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Shadows/ProjectedShadowFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Shadows/ProjectedShadowFeatureProcessorInterface.h new file mode 100644 index 0000000000..97a7228386 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Shadows/ProjectedShadowFeatureProcessorInterface.h @@ -0,0 +1,72 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include +#include + +namespace AZ::Render +{ + //! This feature processor handles projected shadows for various lights. + class ProjectedShadowFeatureProcessorInterface + : public RPI::FeatureProcessor + { + public: + + AZ_RTTI(AZ::Render::ProjectedShadowFeatureProcessorInterface, "{C5651D73-3448-4D76-91C0-0E636A197F63}", AZ::RPI::FeatureProcessor); + + using ShadowId = RHI::Handle; + static constexpr float MaxProjectedShadowRadians = AZ::DegToRad(150.0f); + + //! Used in SetShadowProperties() to set several related shadow properties in one function call. + struct ProjectedShadowDescriptor + { + Transform m_transform = Transform::CreateIdentity(); + float m_nearPlaneDistance = 0.01f; + float m_farPlaneDistance = 10000.0f; + float m_aspectRatio = 1.0f; + float m_fieldOfViewYRadians = DegToRad(90.0f); + }; + + //! Creates a new projected shadow and returns a handle that can be used to reference it later. + virtual ShadowId AcquireShadow() = 0; + //! Releases a projected shadow given its ID. + virtual void ReleaseShadow(ShadowId id) = 0; + //! Sets the world space transform of where the shadow is cast from + virtual void SetShadowTransform(ShadowId id, Transform transform) = 0; + //! Sets the near and far plane distances for the shadow. + virtual void SetNearFarPlanes(ShadowId id, float nearPlaneDistance, float farPlaneDistance) = 0; + //! Sets the aspect ratio for the shadow. + virtual void SetAspectRatio(ShadowId id, float aspectRatio) = 0; + //! Sets the field of view for the shadow in radians in the Y direction. + virtual void SetFieldOfViewY(ShadowId id, float fieldOfView) = 0; + //! Sets the maximum resolution of the shadow map + virtual void SetShadowmapMaxResolution(ShadowId id, ShadowmapSize size) = 0; + //! Sets the shadowmap Pcf method. + virtual void SetPcfMethod(ShadowId id, PcfMethod method) = 0; + //! Sets the shadow filter method + virtual void SetShadowFilterMethod(ShadowId id, ShadowFilterMethod method) = 0; + //! Sets the width of boundary between shadowed area and lit area. + virtual void SetSofteningBoundaryWidthAngle(ShadowId id, float boundaryWidthRadians) = 0; + //! Sets the sample count to predict the boundary of the shadow. Max 16, should be less than filtering sample count. + virtual void SetPredictionSampleCount(ShadowId id, uint16_t count) = 0; + //! Sets the sample count for filtering of the shadow boundary, max 64. + virtual void SetFilteringSampleCount(ShadowId id, uint16_t count) = 0; + //! Sets all of the shadow properites in one call + virtual void SetShadowProperties(ShadowId id, const ProjectedShadowDescriptor& descriptor) = 0; + //! Gets the current shadow properties. Useful for updating several properties at once in SetShadowProperties() without having to set every property. + virtual const ProjectedShadowDescriptor& GetShadowProperties(ShadowId id) = 0; + }; +} diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshInputBuffers.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshInputBuffers.h index 6970e92da6..54ac19e87e 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshInputBuffers.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshInputBuffers.h @@ -57,7 +57,7 @@ namespace AZ struct SkinnedSubMeshSharedViews { RPI::BufferAssetView m_indexBufferView; - AZStd::array < RPI::BufferAssetView, static_cast(SkinnedMeshStaticVertexStreams::NumVertexStreams)> m_staticStreamViews; + AZStd::array (SkinnedMeshStaticVertexStreams::NumVertexStreams)> m_staticStreamViews; }; @@ -85,7 +85,7 @@ namespace AZ uint32_t GetVertexCount() const; //! Set the index buffer asset - void SetIndexBuffer(const Data::Asset bufferAsset); + void SetIndexBufferAsset(const Data::Asset bufferAsset); //! Create the index buffer. SetIndexCount must be called first as CreateIndexBuffer depends on that to know the number of indices to create. //! @param data The indices to be used for the index buffer. The index buffer is used by the target skinned model, but is not modified during skinning so it is shared between all instances of the same skinned mesh. @@ -126,19 +126,31 @@ namespace AZ //! Get the MorphTargetInputBuffers for all the morph targets that can be applied to an instance of this skinned mesh const AZStd::vector>& GetMorphTargetInputBuffers() const; - //! Sets the input for an input vertex stream from an existing buffer asset. + //! Sets the input vertex stream from an existing buffer asset. void SetSkinningInputBufferAsset(const Data::Asset bufferAsset, SkinnedMeshInputVertexStreams inputStream); + //! Sets the static vertex stream from an existing buffer asset. + void SetStaticBufferAsset(const Data::Asset bufferAsset, SkinnedMeshStaticVertexStreams staticStream); + //! Returns the BufferAsset of an input vertex stream. const Data::Asset& GetSkinningInputBufferAsset(SkinnedMeshInputVertexStreams stream) const; //! Calls RPI::Buffer::WaitForUpload for each buffer in the lod. void WaitForUpload(); + //! Returns true if this lod has a morphed color stream + bool HasDynamicColors() const; + + //! Sets the model lod asset for the underlying lod + void SetModelLodAsset(const Data::Asset& modelLodAsset); + private: void CreateSharedSubMeshBufferViews(); + //! The lod asset from the underlying mesh + Data::Asset m_modelLodAsset; + //! One BufferAsset for each input vertex stream AZStd::array, static_cast(SkinnedMeshInputVertexStreams::NumVertexStreams)> m_inputBufferAssets; //! One buffer for each input vertex stream @@ -172,6 +184,11 @@ namespace AZ uint32_t m_indexCount = 0; //! Total number of vertices for the entire lod uint32_t m_vertexCount = 0; + + //! Bool for keeping track of whether or not this lod has morphed colors + bool m_hasDynamicColors = false; + //! Bool for keeping track of whether or not this lod has a static color stream + bool m_hasStaticColors = false; }; //! Container for all the buffers and views needed for per-source model input to both the skinning shader and subsequent mesh shaders diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshShaderOptions.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshShaderOptions.h index e57f25c2c0..ba95d3464f 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshShaderOptions.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshShaderOptions.h @@ -28,6 +28,7 @@ namespace AZ { SkinningMethod m_skinningMethod = SkinningMethod::LinearSkinning; bool m_applyMorphTargets = false; + bool m_applyColorMorphTargets = false; }; } } diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshVertexStreams.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshVertexStreams.h index b2087c999f..bcd20733b2 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshVertexStreams.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkinnedMesh/SkinnedMeshVertexStreams.h @@ -33,6 +33,8 @@ namespace AZ BiTangent, BlendIndices, BlendWeights, + // Optional + Color, NumVertexStreams }; @@ -43,6 +45,8 @@ namespace AZ Normal, Tangent, BiTangent, + // Optional + Color, NumVertexStreams }; @@ -51,6 +55,8 @@ namespace AZ enum class SkinnedMeshStaticVertexStreams : uint8_t { UV_0, + // Optional + Color, NumVertexStreams }; diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/MultiSparseVector.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/MultiSparseVector.h new file mode 100644 index 0000000000..3e9e58d29e --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/MultiSparseVector.h @@ -0,0 +1,166 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include + +namespace AZ::Render +{ + //! MultiSparseVector works similarly to SparseVector, but supports multiple underlying vectors + //! templated to several different types. A separate underlying vector is created for each template + //! type and elements are reserved and released in all vectors simultaneously. Each type can be + //! retrieved individually by index with GetElement(index) where the first Type is + //! ArrayIndex 0, the next Type is ArrayIndex 1 etc. + //! See SparseVector.h for more details. + + template + class MultiSparseVector + { + public: + + MultiSparseVector(); + + //! Reserves elements in the underlying vectors and returns the index to those elements. + size_t Reserve(); + + //! Releases elements with the given index so they can be reused. + void Release(size_t index); + + //! Clears all the data from the underlying vectors and resets the size to 0 + void Clear(); + + //! Returns the size of the underlying vectors. This is not the same as the number of + //! valid elements in the vectors since there can be empty slots. + size_t GetSize() const; + + //! Returns a reference to the element at a given index in the ArrayIndex vector. + template + auto& GetElement(size_t index); + + //! Returns a pointer to the raw data for the ArrayIndex vector. + template + auto* GetRawData() const; + + private: + + static constexpr size_t NoFreeSlot = -1; + static constexpr size_t InitialReservedCount = 128; + + using Fn = void(&)(AZStd::vector& ...); + + // Variadic convenience functions + + template + static void ClearFunction(Args&... args) + { + (args.clear(), ...); + } + + template + static void EmplaceBackFunction(Args&... args) + { + (args.emplace_back(), ...); + } + + template + static void ReserveCapacityFunction(Args&... args) + { + (args.reserve(InitialReservedCount), ...); + } + + template + static void InitializeElement(size_t index, T& container) + { + container.at(index) = {}; + } + + template + static void DeleteElement(size_t index, T& container) + { + AZStd::destroy_at(&container.at(index)); + } + + size_t m_nextFreeSlot = NoFreeSlot; + AZStd::tuple...> m_data; + }; + + template + MultiSparseVector::MultiSparseVector() + { + static_assert(sizeof(AZStd::tuple_element_t<0, AZStd::tuple>) >= sizeof(size_t), + "Data stored in the first element of MultiSparseVector must be at least as large as a size_t."); + + // Reserve some initial capacity in the vectors based on InitialReservedCount. + AZStd::apply(static_cast(ReserveCapacityFunction), m_data); + } + + template + inline size_t MultiSparseVector::Reserve() + { + size_t slotToReturn = -1; + if (m_nextFreeSlot != NoFreeSlot) + { + // If there's a free slot, then use that space and update the linked list of free slots. + slotToReturn = m_nextFreeSlot; + m_nextFreeSlot = reinterpret_cast(GetElement<0>(m_nextFreeSlot)); + AZStd::apply([&](auto&... args){ (InitializeElement(slotToReturn, args), ...); }, m_data); + } + else + { + // If there's no free slot, append on the end. + slotToReturn = GetSize(); + AZStd::apply(static_cast(EmplaceBackFunction), m_data); + } + return slotToReturn; + } + + template + inline void MultiSparseVector::Release(size_t index) + { + AZ_Assert(index < GetSize(), "MultiSparseVector::Release() index out of bounds."); + if (index < GetSize()) + { + // Explicitly destruct the released elements and update the linked list of free slots. + AZStd::apply([&](auto&... args){ (DeleteElement(index, args), ...); }, m_data); + reinterpret_cast(GetElement<0>(index)) = m_nextFreeSlot; + m_nextFreeSlot = index; + } + } + + template + void MultiSparseVector::Clear() + { + AZStd::apply(static_cast(ClearFunction), m_data); + m_nextFreeSlot = NoFreeSlot; + } + + template + size_t MultiSparseVector::GetSize() const + { + return AZStd::get<0>(m_data).size(); + } + + template + template + auto& MultiSparseVector::GetElement(size_t index) + { + return AZStd::get(m_data).at(index); + } + + template + template + auto* MultiSparseVector::GetRawData() const + { + return AZStd::get(m_data).data(); + } +} diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/SparseVector.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/SparseVector.h new file mode 100644 index 0000000000..a11f4de466 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/SparseVector.h @@ -0,0 +1,126 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include + +namespace AZ::Render +{ + //! SparseVector stores elements in a vector under the hood, but allows for empty slots in the + //! vector. This means that elements can be added or removed without affecting the location of + //! other elements. When a new element is reserved in the SparseVector, it will use a free slot + //! if available. Otherwise, it will push the data onto the end of the vector. + //! + //! This class works by storing a linked list of elements in the empty slot, as well as an index + //! to the first empty slot. Since the linked list uses size_t for its type, this class must be + //! templated to a class that is at least sizeof(size_t). + + template + class SparseVector + { + public: + + SparseVector(); + + //! Reserves an element in the underlying vector and returns the index to that element. + size_t Reserve(); + + //! Releases an element with the given index so it can be reused. + void Release(size_t index); + + //! Clears all the data from the underlying vector and resets the size to 0 + void Clear(); + + //! Returns the size of the underlying vector. This is not the same as the number of + //! valid elements in the vector since there can be empty slots. + size_t GetSize() const; + + //! Returns a reference to the element at a given index + T& GetElement(size_t index); + + //! Returns a pointer to the raw data vector. + const T* GetRawData() const; + + private: + + static constexpr size_t NoFreeSlot = -1; + static constexpr size_t InitialReservedCount = 128; + + size_t m_nextFreeSlot = NoFreeSlot; + AZStd::vector m_data; + }; + + template + SparseVector::SparseVector() + { + static_assert(sizeof(T) >= sizeof(size_t), "Data stored in SparseVector must be at least as large as a size_t."); + m_data.reserve(InitialReservedCount); + } + + template + inline size_t SparseVector::Reserve() + { + size_t slotToReturn = -1; + if (m_nextFreeSlot != NoFreeSlot) + { + // If there's a free slot, then use that space and update the linked list of free slots. + slotToReturn = m_nextFreeSlot; + m_nextFreeSlot = reinterpret_cast(m_data.at(m_nextFreeSlot)); + m_data.at(slotToReturn) = T(); + } + else + { + // If there's no free slot, append on the end. + slotToReturn = m_data.size(); + m_data.emplace_back(); + } + return slotToReturn; + } + + template + inline void SparseVector::Release(size_t index) + { + if (index < m_data.size()) + { + // Explicitly destruct the released element and update the linked list of free slots. + m_data.at(index).~T(); + reinterpret_cast(m_data.at(index)) = m_nextFreeSlot; + m_nextFreeSlot = index; + } + } + + template + void SparseVector::Clear() + { + m_data.clear(); + m_nextFreeSlot = NoFreeSlot; + } + + template + size_t SparseVector::GetSize() const + { + return m_data.size(); + } + + template + T& SparseVector::GetElement(size_t index) + { + return m_data.at(index); + } + + template + const T* SparseVector::GetRawData() const + { + return m_data.data(); + } +} diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp index e2b5beac1f..5f7057c9be 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp @@ -70,7 +70,7 @@ #include #include #include - +#include #include @@ -110,6 +110,7 @@ namespace AZ { AuxGeomFeatureProcessor::Reflect(context); TransformServiceFeatureProcessor::Reflect(context); + ProjectedShadowFeatureProcessor::Reflect(context); SkyBoxFeatureProcessor::Reflect(context); UseTextureFunctor::Reflect(context); PropertyVisibilityFunctor::Reflect(context); @@ -186,6 +187,7 @@ namespace AZ AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface(); AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface(); AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface(); + AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface(); AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor(); AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor(); AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor(); @@ -274,18 +276,19 @@ namespace AZ void CommonSystemComponent::Deactivate() { - AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); + AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); + AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); + AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); + AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); + AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); + AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); - AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); - AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); - AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); - AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); } } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/CoreLightsSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/CoreLightsSystemComponent.cpp index 017c314a06..7ef01cfbaf 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/CoreLightsSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/CoreLightsSystemComponent.cpp @@ -24,6 +24,8 @@ #include #include +#include +#include #include #include #include @@ -33,8 +35,7 @@ #include #include #include -#include -#include +#include #include @@ -69,9 +70,10 @@ namespace AZ } PhotometricValue::Reflect(context); + SimplePointLightFeatureProcessor::Reflect(context); + SimpleSpotLightFeatureProcessor::Reflect(context); PointLightFeatureProcessor::Reflect(context); DirectionalLightFeatureProcessor::Reflect(context); - SpotLightFeatureProcessor::Reflect(context); DiskLightFeatureProcessor::Reflect(context); CapsuleLightFeatureProcessor::Reflect(context); QuadLightFeatureProcessor::Reflect(context); @@ -112,9 +114,10 @@ namespace AZ void CoreLightsSystemComponent::Activate() { + AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface(); + AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface(); AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface(); AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface(); - AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface(); AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface(); AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface(); AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessorWithInterface(); @@ -126,7 +129,7 @@ namespace AZ passSystem->AddPassCreator(Name("DepthExponentiationPass"), &DepthExponentiationPass::Create); passSystem->AddPassCreator(Name("EsmShadowmapsPass"), &EsmShadowmapsPass::Create); passSystem->AddPassCreator(Name("ShadowmapPass"), &ShadowmapPass::Create); - passSystem->AddPassCreator(Name("SpotLightShadowmapsPass"), &SpotLightShadowmapsPass::Create); + passSystem->AddPassCreator(Name("ProjectedShadowmapsPass"), &ProjectedShadowmapsPass::Create); // Add the ShadowmapPassTemplate to the pass system. It will be cleaned up automatically when the pass system shuts down ShadowmapPass::CreatePassTemplate(); diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp index 014178e220..f44a56233e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp @@ -609,6 +609,16 @@ namespace AZ m_shadowBufferNeedsUpdate = true; } + void DirectionalLightFeatureProcessor::SetPcfMethod(LightHandle handle, PcfMethod method) + { + for (auto& it : m_shadowData) + { + it.second.GetData(handle.GetIndex()).m_pcfMethod = method; + } + m_shadowBufferNeedsUpdate = true; + } + + void DirectionalLightFeatureProcessor::OnRenderPipelineAdded(RPI::RenderPipelinePtr pipeline) { PrepareForChangingRenderPipelineAndCameraView(); diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h index 48a9b15dab..a276ea3f3e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h @@ -73,6 +73,7 @@ namespace AZ float padding2 = 0.0f; // Padding between float3s in shader, can be used for other data later. }; + // [GFX TODO][ATOM-15172] Look into compacting struct DirectionalLightShadowData struct DirectionalLightShadowData { AZStd::array m_depthBiasMatrices = @@ -103,8 +104,10 @@ namespace AZ uint32_t m_predictionSampleCount = 0; uint32_t m_filteringSampleCount = 0; uint32_t m_debugFlags = 0; - uint32_t m_shadowFilterMethod = 0; + uint32_t m_shadowFilterMethod = 0; float m_far_minus_near = 0; + PcfMethod m_pcfMethod = PcfMethod::BoundarySearch; + uint32_t m_padding[3]; }; class DirectionalLightFeatureProcessor final @@ -218,6 +221,7 @@ namespace AZ void SetPredictionSampleCount(LightHandle handle, uint16_t count) override; void SetFilteringSampleCount(LightHandle handle, uint16_t count) override; void SetShadowBoundaryWidth(LightHandle handle, float boundaryWidth) override; + void SetPcfMethod(LightHandle handle, PcfMethod method) override; const Data::Instance GetLightBuffer() const; uint32_t GetLightCount() const; diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DiskLightFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DiskLightFeatureProcessor.cpp index 8bf2b6cefc..58bbed699a 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DiskLightFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DiskLightFeatureProcessor.cpp @@ -14,8 +14,9 @@ #include -#include #include +#include +#include #include @@ -56,6 +57,7 @@ namespace AZ desc.m_srgLayout = RPI::RPISystemInterface::Get()->GetViewSrgAsset()->GetLayout(); m_lightBufferHandler = GpuBufferHandler(desc); + m_shadowFeatureProcessor = GetParentScene()->GetFeatureProcessor(); } void DiskLightFeatureProcessor::Deactivate() @@ -83,6 +85,11 @@ namespace AZ { if (handle.IsValid()) { + ShadowId shadowId = ShadowId(m_diskLightData.GetData(handle.GetIndex()).m_shadowIndex); + if (shadowId.IsValid()) + { + m_shadowFeatureProcessor->ReleaseShadow(shadowId); + } m_diskLightData.RemoveIndex(handle.GetIndex()); m_deviceBufferNeedsUpdate = true; handle.Reset(); @@ -98,7 +105,21 @@ namespace AZ LightHandle handle = AcquireLight(); if (handle.IsValid()) { - m_diskLightData.GetData(handle.GetIndex()) = m_diskLightData.GetData(sourceLightHandle.GetIndex()); + // Get a reference to the new light + DiskLightData& light = m_diskLightData.GetData(handle.GetIndex()); + // Copy data from the source light on top of it. + light = m_diskLightData.GetData(sourceLightHandle.GetIndex()); + + ShadowId shadowId = ShadowId(light.m_shadowIndex); + if (shadowId.IsValid()) + { + // Since the source light has a valid shadow, a new shadow must be generated for the cloned light. + ProjectedShadowFeatureProcessorInterface::ProjectedShadowDescriptor originalDesc = m_shadowFeatureProcessor->GetShadowProperties(shadowId); + ShadowId cloneShadow = m_shadowFeatureProcessor->AcquireShadow(); + light.m_shadowIndex = cloneShadow.GetIndex(); + m_shadowFeatureProcessor->SetShadowProperties(cloneShadow, originalDesc); + } + m_deviceBufferNeedsUpdate = true; } return handle; @@ -148,6 +169,7 @@ namespace AZ lightPosition.StoreToFloat3(position.data()); m_deviceBufferNeedsUpdate = true; + UpdateShadow(handle); } void DiskLightFeatureProcessor::SetDirection(LightHandle handle, const AZ::Vector3& lightDirection) @@ -158,14 +180,7 @@ namespace AZ lightDirection.StoreToFloat3(direction.data()); m_deviceBufferNeedsUpdate = true; - } - - void DiskLightFeatureProcessor::SetLightEmitsBothDirections(LightHandle handle, bool lightEmitsBothDirections) - { - AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to DiskLightFeatureProcessor::SetLightEmitsBothDirections()."); - - m_diskLightData.GetData(handle.GetIndex()).SetLightEmitsBothDirections(lightEmitsBothDirections); - m_deviceBufferNeedsUpdate = true; + UpdateShadow(handle); } void DiskLightFeatureProcessor::SetAttenuationRadius(LightHandle handle, float attenuationRadius) @@ -173,16 +188,69 @@ namespace AZ AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to DiskLightFeatureProcessor::SetAttenuationRadius()."); attenuationRadius = AZStd::max(attenuationRadius, 0.001f); // prevent divide by zero. - m_diskLightData.GetData(handle.GetIndex()).m_invAttenuationRadiusSquared = 1.0f / (attenuationRadius * attenuationRadius); + DiskLightData& light = m_diskLightData.GetData(handle.GetIndex()); + light.m_invAttenuationRadiusSquared = 1.0f / (attenuationRadius * attenuationRadius); + m_deviceBufferNeedsUpdate = true; + + // Update the shadow near far planes if necessary + ShadowId shadowId = ShadowId(light.m_shadowIndex); + if (shadowId.IsValid()) + { + m_shadowFeatureProcessor->SetNearFarPlanes(ShadowId(light.m_shadowIndex), + light.m_bulbPositionOffset, attenuationRadius + light.m_bulbPositionOffset); + } } void DiskLightFeatureProcessor::SetDiskRadius(LightHandle handle, float radius) + { + AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to DiskLightFeatureProcessor::SetDiskRadius()."); + + DiskLightData& light = m_diskLightData.GetData(handle.GetIndex()); + light.m_diskRadius = radius; + UpdateBulbPositionOffset(light); + m_deviceBufferNeedsUpdate = true; + UpdateShadow(handle); + } + + void DiskLightFeatureProcessor::SetConstrainToConeLight(LightHandle handle, bool useCone) { AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to DiskLightFeatureProcessor::SetDiskRadius()."); - m_diskLightData.GetData(handle.GetIndex()).m_diskRadius = radius; + uint32_t& flags = m_diskLightData.GetData(handle.GetIndex()).m_flags; + useCone ? flags |= DiskLightData::Flags::UseConeAngle : flags &= ~DiskLightData::Flags::UseConeAngle; m_deviceBufferNeedsUpdate = true; + UpdateShadow(handle); + } + + void DiskLightFeatureProcessor::SetConeAngles(LightHandle handle, float innerRadians, float outerRadians) + { + AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to DiskLightFeatureProcessor::SetConeAngles()."); + + ValidateAndSetConeAngles(handle, innerRadians, outerRadians); + UpdateShadow(handle); + + m_deviceBufferNeedsUpdate = true; + } + + void DiskLightFeatureProcessor::ValidateAndSetConeAngles(LightHandle handle, float innerRadians, float outerRadians) + { + DiskLightData& light = m_diskLightData.GetData(handle.GetIndex()); + + // Assume if the cone angles are being set that the user wants to constrain to a cone angle + SetConstrainToConeLight(handle, true); + + ShadowId shadowId = ShadowId(light.m_shadowIndex); + float maxRadians = shadowId.IsNull() ? MaxConeRadians : MaxProjectedShadowRadians; + float minRadians = 0.001f; + + outerRadians = AZStd::clamp(outerRadians, minRadians, maxRadians); + innerRadians = AZStd::clamp(innerRadians, minRadians, outerRadians); + + light.m_cosInnerConeAngle = cosf(innerRadians); + light.m_cosOuterConeAngle = cosf(outerRadians); + + UpdateBulbPositionOffset(light); } void DiskLightFeatureProcessor::SetDiskData(LightHandle handle, const DiskLightData& data) @@ -191,6 +259,7 @@ namespace AZ m_diskLightData.GetData(handle.GetIndex()) = data; m_deviceBufferNeedsUpdate = true; + UpdateShadow(handle); } const Data::Instance DiskLightFeatureProcessor::GetLightBuffer()const @@ -203,5 +272,130 @@ namespace AZ return m_lightBufferHandler.GetElementCount(); } + void DiskLightFeatureProcessor::SetShadowsEnabled(LightHandle handle, bool enabled) + { + DiskLightData& light = m_diskLightData.GetData(handle.GetIndex()); + ShadowId shadowId = ShadowId(light.m_shadowIndex); + if (shadowId.IsValid() && enabled == false) + { + // Disable shadows + m_shadowFeatureProcessor->ReleaseShadow(shadowId); + shadowId.Reset(); + light.m_shadowIndex = shadowId.GetIndex(); + m_deviceBufferNeedsUpdate = true; + } + else if(shadowId.IsNull() && enabled == true) + { + // Enable shadows + light.m_shadowIndex = m_shadowFeatureProcessor->AcquireShadow().GetIndex(); + + // It's possible the cone angles aren't set, or are too wide for casting shadows. This makes sure they're set to reasonable limits. + // This function expects radians, so the cos stored in the actual data needs to be undone. + ValidateAndSetConeAngles(handle, acosf(light.m_cosInnerConeAngle), acosf(light.m_cosOuterConeAngle)); + + UpdateShadow(handle); + m_deviceBufferNeedsUpdate = true; + } + } + + template + void DiskLightFeatureProcessor::SetShadowSetting(LightHandle handle, Functor&& functor, ParamType&& param) + { + AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to DiskLightFeatureProcessor::SetShadowSetting()."); + + DiskLightData& light = m_diskLightData.GetData(handle.GetIndex()); + ShadowId shadowId = ShadowId(light.m_shadowIndex); + + AZ_Assert(shadowId.IsValid(), "Attempting to set a shadow property when shadows are not enabled."); + if (shadowId.IsValid()) + { + AZStd::invoke(AZStd::forward(functor), m_shadowFeatureProcessor, shadowId, AZStd::forward(param)); + } + } + + void DiskLightFeatureProcessor::SetShadowmapMaxResolution(LightHandle handle, ShadowmapSize shadowmapSize) + { + SetShadowSetting(handle, &ProjectedShadowFeatureProcessor::SetShadowmapMaxResolution, shadowmapSize); + } + + void DiskLightFeatureProcessor::SetShadowFilterMethod(LightHandle handle, ShadowFilterMethod method) + { + SetShadowSetting(handle, &ProjectedShadowFeatureProcessor::SetShadowFilterMethod, method); + } + + void DiskLightFeatureProcessor::SetSofteningBoundaryWidthAngle(LightHandle handle, float boundaryWidthRadians) + { + SetShadowSetting(handle, &ProjectedShadowFeatureProcessor::SetSofteningBoundaryWidthAngle, boundaryWidthRadians); + } + + void DiskLightFeatureProcessor::SetPredictionSampleCount(LightHandle handle, uint16_t count) + { + SetShadowSetting(handle, &ProjectedShadowFeatureProcessor::SetPredictionSampleCount, count); + } + + void DiskLightFeatureProcessor::SetFilteringSampleCount(LightHandle handle, uint16_t count) + { + SetShadowSetting(handle, &ProjectedShadowFeatureProcessor::SetFilteringSampleCount, count); + } + + void DiskLightFeatureProcessor::SetPcfMethod(LightHandle handle, PcfMethod method) + { + SetShadowSetting(handle, &ProjectedShadowFeatureProcessor::SetPcfMethod, method); + } + + void DiskLightFeatureProcessor::UpdateShadow(LightHandle handle) + { + const DiskLightData& diskLight = m_diskLightData.GetData(handle.GetIndex()); + ShadowId shadowId = ShadowId(diskLight.m_shadowIndex); + if (shadowId.IsNull()) + { + // Early out if shadows are disabled. + return; + } + + ProjectedShadowFeatureProcessorInterface::ProjectedShadowDescriptor desc = m_shadowFeatureProcessor->GetShadowProperties(shadowId); + + Vector3 position = Vector3::CreateFromFloat3(diskLight.m_position.data()); + const Vector3 direction = Vector3::CreateFromFloat3(diskLight.m_direction.data()); + + constexpr float SmallAngle = 0.01f; + float halfFov = acosf(diskLight.m_cosOuterConeAngle); + desc.m_fieldOfViewYRadians = GetMax(halfFov * 2.0f, SmallAngle); + + // To handle bulb radius, set the position of the shadow caster behind the actual light depending on the radius of the bulb + // + // \ / + // \ / + // \_____/ <-- position of light itself (and forward plane of shadow casting view) + // . . + // . . + // * <-- position of shadow casting view + // + position += diskLight.m_bulbPositionOffset * -direction; + desc.m_transform = Transform::CreateLookAt(position, position + direction); + + desc.m_aspectRatio = 1.0f; + desc.m_nearPlaneDistance = diskLight.m_bulbPositionOffset; + + const float invRadiusSquared = diskLight.m_invAttenuationRadiusSquared; + if (invRadiusSquared <= 0.f) + { + AZ_Assert(false, "Attenuation radius have to be set before use the light."); + return; + } + const float attenuationRadius = sqrtf(1.f / invRadiusSquared); + desc.m_farPlaneDistance = attenuationRadius + diskLight.m_bulbPositionOffset; + + m_shadowFeatureProcessor->SetShadowProperties(shadowId, desc); + } + + void DiskLightFeatureProcessor::UpdateBulbPositionOffset(DiskLightData& light) + { + // If we have the outer cone angle in radians, the offset is (radius * tan(pi/2 - coneRadians)). However + // light stores the cosine of outerConeRadians, making the equation (radius * tan(pi/2 - acosf(cosConeRadians)). + // This simplifies to the equation below. + float cosConeRadians = light.m_cosOuterConeAngle; + light.m_bulbPositionOffset = light.m_diskRadius * cosConeRadians / sqrt(1 - cosConeRadians * cosConeRadians); + } } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DiskLightFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DiskLightFeatureProcessor.h index e76f6af77d..446b008921 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DiskLightFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DiskLightFeatureProcessor.h @@ -16,6 +16,7 @@ #include #include #include +#include namespace AZ { @@ -48,21 +49,46 @@ namespace AZ void SetRgbIntensity(LightHandle handle, const PhotometricColor& lightColor) override; void SetPosition(LightHandle handle, const AZ::Vector3& lightPosition) override; void SetDirection(LightHandle handle, const AZ::Vector3& lightDirection) override; - void SetLightEmitsBothDirections(LightHandle handle, bool lightEmitsBothDirections) override; void SetAttenuationRadius(LightHandle handle, float attenuationRadius) override; void SetDiskRadius(LightHandle handle, float radius) override; + void SetConstrainToConeLight(LightHandle handle, bool useCone) override; + void SetConeAngles(LightHandle handle, float innerDegrees, float outerDegrees) override; + void SetShadowsEnabled(LightHandle handle, bool enabled) override; + void SetShadowmapMaxResolution(LightHandle handle, ShadowmapSize shadowmapSize) override; + void SetShadowFilterMethod(LightHandle handle, ShadowFilterMethod method) override; + void SetSofteningBoundaryWidthAngle(LightHandle handle, float boundaryWidthRadians) override; + void SetPredictionSampleCount(LightHandle handle, uint16_t count) override; + void SetFilteringSampleCount(LightHandle handle, uint16_t count) override; + void SetPcfMethod(LightHandle handle, PcfMethod method); + void SetDiskData(LightHandle handle, const DiskLightData& data) override; const Data::Instance GetLightBuffer()const; uint32_t GetLightCount()const; private: - DiskLightFeatureProcessor(const DiskLightFeatureProcessor&) = delete; static constexpr const char* FeatureProcessorName = "DiskLightFeatureProcessor"; + static constexpr float MaxConeRadians = AZ::DegToRad(90.0f); + static constexpr float MaxProjectedShadowRadians = ProjectedShadowFeatureProcessorInterface::MaxProjectedShadowRadians * 0.5f; + using ShadowId = ProjectedShadowFeatureProcessor::ShadowId; + + DiskLightFeatureProcessor(const DiskLightFeatureProcessor&) = delete; + + static void UpdateBulbPositionOffset(DiskLightData& light); + + void ValidateAndSetConeAngles(LightHandle handle, float innerRadians, float outerRadians); + void UpdateShadow(LightHandle handle); + + // Convenience function for forwarding requests to the ProjectedShadowFeatureProcessor + template + void SetShadowSetting(LightHandle handle, Functor&&, ParamType&& param); + + ProjectedShadowFeatureProcessor* m_shadowFeatureProcessor; IndexedDataVector m_diskLightData; GpuBufferHandler m_lightBufferHandler; + bool m_deviceBufferNeedsUpdate = false; }; } // namespace Render diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp index 0d3ebb7704..e0b0841745 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/EsmShadowmapsPass.cpp @@ -98,9 +98,9 @@ namespace AZ { exponentiationPass->SetShadowmapType(Shadow::ShadowmapType::Directional); } - else if (m_lightTypeName == Name("spot")) + else if (m_lightTypeName == Name("projected")) { - exponentiationPass->SetShadowmapType(Shadow::ShadowmapType::Spot); + exponentiationPass->SetShadowmapType(Shadow::ShadowmapType::Projected); } else { diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/IndexedDataVector.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/IndexedDataVector.h index dfb8a97b68..f9fc54f869 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/IndexedDataVector.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/IndexedDataVector.h @@ -36,7 +36,8 @@ namespace AZ DataType& GetData(IndexType index); const DataType& GetData(IndexType index) const; size_t GetDataCount() const; - + + AZStd::vector& GetDataVector(); const AZStd::vector& GetDataVector() const; IndexType GetRawIndex(IndexType index) const; diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/IndexedDataVector.inl b/Gems/Atom/Feature/Common/Code/Source/CoreLights/IndexedDataVector.inl index dd714d7110..4d42c9e265 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/IndexedDataVector.inl +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/IndexedDataVector.inl @@ -98,6 +98,12 @@ inline size_t IndexedDataVector::GetDataCount() const return m_data.size(); } +template +inline AZStd::vector& IndexedDataVector::GetDataVector() +{ + return m_data; +} + template inline const AZStd::vector& IndexedDataVector::GetDataVector() const { diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingPass.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingPass.cpp index cb091fdd8c..91b8836cc9 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingPass.cpp @@ -28,8 +28,9 @@ #include #include #include +#include +#include #include -#include #include #include #include @@ -116,18 +117,20 @@ namespace AZ LightCullingPass::LightCullingPass(const RPI::PassDescriptor& descriptor) : RPI::ComputePass(descriptor) { - m_lightdata[eLightTypes_Point].m_lightCountIndex = Name("m_pointLightCount"); - m_lightdata[eLightTypes_Point].m_lightBufferIndex = Name("m_pointLights"); - m_lightdata[eLightTypes_Spot].m_lightCountIndex = Name("m_spotLightCount"); - m_lightdata[eLightTypes_Spot].m_lightBufferIndex = Name("m_spotLights"); - m_lightdata[eLightTypes_Disk].m_lightCountIndex = Name("m_diskLightCount"); - m_lightdata[eLightTypes_Disk].m_lightBufferIndex = Name("m_diskLights"); - m_lightdata[eLightTypes_Capsule].m_lightCountIndex = Name("m_capsuleLightCount"); - m_lightdata[eLightTypes_Capsule].m_lightBufferIndex = Name("m_capsuleLights"); - m_lightdata[eLightTypes_Quad].m_lightCountIndex = Name("m_quadLightCount"); - m_lightdata[eLightTypes_Quad].m_lightBufferIndex = Name("m_quadLights"); - m_lightdata[eLightTypes_Decal].m_lightCountIndex = Name("m_decalCount"); - m_lightdata[eLightTypes_Decal].m_lightBufferIndex = Name("m_decals"); + m_lightdata[eLightTypes_SimplePoint].m_lightCountIndex = Name("m_simplePointLightCount"); + m_lightdata[eLightTypes_SimplePoint].m_lightBufferIndex = Name("m_simplePointLights"); + m_lightdata[eLightTypes_SimpleSpot].m_lightCountIndex = Name("m_simpleSpotLightCount"); + m_lightdata[eLightTypes_SimpleSpot].m_lightBufferIndex = Name("m_simpleSpotLights"); + m_lightdata[eLightTypes_Point].m_lightCountIndex = Name("m_pointLightCount"); + m_lightdata[eLightTypes_Point].m_lightBufferIndex = Name("m_pointLights"); + m_lightdata[eLightTypes_Disk].m_lightCountIndex = Name("m_diskLightCount"); + m_lightdata[eLightTypes_Disk].m_lightBufferIndex = Name("m_diskLights"); + m_lightdata[eLightTypes_Capsule].m_lightCountIndex = Name("m_capsuleLightCount"); + m_lightdata[eLightTypes_Capsule].m_lightBufferIndex = Name("m_capsuleLights"); + m_lightdata[eLightTypes_Quad].m_lightCountIndex = Name("m_quadLightCount"); + m_lightdata[eLightTypes_Quad].m_lightBufferIndex = Name("m_quadLights"); + m_lightdata[eLightTypes_Decal].m_lightCountIndex = Name("m_decalCount"); + m_lightdata[eLightTypes_Decal].m_lightBufferIndex = Name("m_decals"); } void LightCullingPass::CompileResources(const RHI::FrameGraphCompileContext& context) @@ -274,14 +277,18 @@ namespace AZ void LightCullingPass::GetLightDataFromFeatureProcessor() { + const auto simplePointLightFP = m_pipeline->GetScene()->GetFeatureProcessor(); + m_lightdata[eLightTypes_SimplePoint].m_lightBuffer = simplePointLightFP->GetLightBuffer(); + m_lightdata[eLightTypes_SimplePoint].m_lightCount = simplePointLightFP->GetLightCount(); + + const auto simpleSpotLightFP = m_pipeline->GetScene()->GetFeatureProcessor(); + m_lightdata[eLightTypes_SimpleSpot].m_lightBuffer = simpleSpotLightFP->GetLightBuffer(); + m_lightdata[eLightTypes_SimpleSpot].m_lightCount = simpleSpotLightFP->GetLightCount(); + const auto pointLightFP = m_pipeline->GetScene()->GetFeatureProcessor(); m_lightdata[eLightTypes_Point].m_lightBuffer = pointLightFP->GetLightBuffer(); m_lightdata[eLightTypes_Point].m_lightCount = pointLightFP->GetLightCount(); - const auto spotLightFP = m_pipeline->GetScene()->GetFeatureProcessor(); - m_lightdata[eLightTypes_Spot].m_lightBuffer = spotLightFP->GetLightBuffer(); - m_lightdata[eLightTypes_Spot].m_lightCount = spotLightFP->GetLightCount(); - const auto diskLightFP = m_pipeline->GetScene()->GetFeatureProcessor(); m_lightdata[eLightTypes_Disk].m_lightBuffer = diskLightFP->GetLightBuffer(); m_lightdata[eLightTypes_Disk].m_lightCount = diskLightFP->GetLightCount(); diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingPass.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingPass.h index 7dd68e279b..a84c531c06 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingPass.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingPass.h @@ -83,8 +83,9 @@ namespace AZ enum LightTypes { + eLightTypes_SimplePoint, + eLightTypes_SimpleSpot, eLightTypes_Point, - eLightTypes_Spot, eLightTypes_Disk, eLightTypes_Capsule, eLightTypes_Quad, diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingRemap.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingRemap.cpp index 06e4b66253..eb3e87dcd1 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingRemap.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingRemap.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightShadowmapsPass.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/ProjectedShadowmapsPass.cpp similarity index 87% rename from Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightShadowmapsPass.cpp rename to Gems/Atom/Feature/Common/Code/Source/CoreLights/ProjectedShadowmapsPass.cpp index 9c8613fb9c..d77419fe8f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightShadowmapsPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/ProjectedShadowmapsPass.cpp @@ -14,19 +14,19 @@ #include #include #include -#include +#include #include namespace AZ { namespace Render { - RPI::Ptr SpotLightShadowmapsPass::Create(const RPI::PassDescriptor& descriptor) + RPI::Ptr ProjectedShadowmapsPass::Create(const RPI::PassDescriptor& descriptor) { - return aznew SpotLightShadowmapsPass(descriptor); + return aznew ProjectedShadowmapsPass(descriptor); } - SpotLightShadowmapsPass::SpotLightShadowmapsPass(const RPI::PassDescriptor& descriptor) + ProjectedShadowmapsPass::ProjectedShadowmapsPass(const RPI::PassDescriptor& descriptor) : Base(descriptor) { const RPI::RasterPassData* passData = RPI::PassUtils::GetPassData(descriptor); @@ -43,7 +43,7 @@ namespace AZ UpdateShadowmapSizes(shadowmapSizes); } - SpotLightShadowmapsPass::~SpotLightShadowmapsPass() + ProjectedShadowmapsPass::~ProjectedShadowmapsPass() { if (m_drawListTag.IsValid()) { @@ -52,12 +52,12 @@ namespace AZ } } - bool SpotLightShadowmapsPass::IsOfRenderPipeline(const RPI::RenderPipeline& renderPipeline) const + bool ProjectedShadowmapsPass::IsOfRenderPipeline(const RPI::RenderPipeline& renderPipeline) const { return &renderPipeline == m_pipeline; } - const RPI::PipelineViewTag& SpotLightShadowmapsPass::GetPipelineViewTagOfChild(size_t childIndex) + const RPI::PipelineViewTag& ProjectedShadowmapsPass::GetPipelineViewTagOfChild(size_t childIndex) { m_childrenPipelineViewTags.reserve(childIndex + 1); while (m_childrenPipelineViewTags.size() <= childIndex) @@ -69,7 +69,7 @@ namespace AZ return m_childrenPipelineViewTags[childIndex]; } - void SpotLightShadowmapsPass::UpdateShadowmapSizes(const AZStd::vector& sizes) + void ProjectedShadowmapsPass::UpdateShadowmapSizes(const AZStd::vector& sizes) { m_sizes = sizes; m_updateChildren = true; @@ -83,7 +83,7 @@ namespace AZ m_atlas.Finalize(); } - void SpotLightShadowmapsPass::UpdateChildren() + void ProjectedShadowmapsPass::UpdateChildren() { if (!m_updateChildren) { @@ -141,22 +141,22 @@ namespace AZ } } - ShadowmapSize SpotLightShadowmapsPass::GetShadowmapAtlasSize() const + ShadowmapSize ProjectedShadowmapsPass::GetShadowmapAtlasSize() const { return m_atlas.GetBaseShadowmapSize(); } - ShadowmapAtlas::Origin SpotLightShadowmapsPass::GetOriginInAtlas(uint16_t index) const + ShadowmapAtlas::Origin ProjectedShadowmapsPass::GetOriginInAtlas(uint16_t index) const { return m_atlas.GetOrigin(index); } - ShadowmapAtlas& SpotLightShadowmapsPass::GetShadowmapAtlas() + ShadowmapAtlas& ProjectedShadowmapsPass::GetShadowmapAtlas() { return m_atlas; } - void SpotLightShadowmapsPass::BuildAttachmentsInternal() + void ProjectedShadowmapsPass::BuildAttachmentsInternal() { UpdateChildren(); @@ -164,10 +164,10 @@ namespace AZ RPI::Ptr attachment = m_ownedAttachments.front(); if (!attachment) { - AZ_Assert(false, "[SpotLightShadowmapsPass %s] Cannot find shadowmap image attachment.", GetPathName().GetCStr()); + AZ_Assert(false, "[ProjectedShadowmapsPass %s] Cannot find shadowmap image attachment.", GetPathName().GetCStr()); return; } - AZ_Assert(attachment->m_descriptor.m_type == RHI::AttachmentType::Image, "[SpotLightShadowmapsPass %s] requires an image attachment", GetPathName().GetCStr()); + AZ_Assert(attachment->m_descriptor.m_type == RHI::AttachmentType::Image, "[ProjectedShadowmapsPass %s] requires an image attachment", GetPathName().GetCStr()); RPI::PassAttachmentBinding& binding = GetOutputBinding(0); binding.m_attachment = attachment; @@ -180,7 +180,7 @@ namespace AZ Base::BuildAttachmentsInternal(); } - void SpotLightShadowmapsPass::GetPipelineViewTags(RPI::SortedPipelineViewTags& outTags) const + void ProjectedShadowmapsPass::GetPipelineViewTags(RPI::SortedPipelineViewTags& outTags) const { const size_t childrenCount = GetChildren().size(); AZ_Assert(m_childrenPipelineViewTags.size() >= childrenCount, "There are not enough pipeline view tags."); @@ -190,7 +190,7 @@ namespace AZ } } - void SpotLightShadowmapsPass::GetViewDrawListInfo(RHI::DrawListMask& outDrawListMask, RPI::PassesByDrawList& outPassesByDrawList, const RPI::PipelineViewTag& viewTag) const + void ProjectedShadowmapsPass::GetViewDrawListInfo(RHI::DrawListMask& outDrawListMask, RPI::PassesByDrawList& outPassesByDrawList, const RPI::PipelineViewTag& viewTag) const { if (AZStd::find( m_childrenPipelineViewTags.begin(), @@ -203,9 +203,9 @@ namespace AZ } } - RPI::Ptr SpotLightShadowmapsPass::CreateChild(size_t childIndex) + RPI::Ptr ProjectedShadowmapsPass::CreateChild(size_t childIndex) { - const Name passName{ AZStd::string::format("SpotLightShadowmapPass.%zu", childIndex) }; + const Name passName{ AZStd::string::format("ProjectedShadowmapPass.%zu", childIndex) }; auto passData = AZStd::make_shared(); passData->m_drawListTag = m_drawListTagName; @@ -214,7 +214,7 @@ namespace AZ return ShadowmapPass::CreateWithPassRequest(passName, passData); } - void SpotLightShadowmapsPass::SetChildrenCount(size_t childrenCount) + void ProjectedShadowmapsPass::SetChildrenCount(size_t childrenCount) { // Reserve Tags if (childrenCount > 0) diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightShadowmapsPass.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/ProjectedShadowmapsPass.h similarity index 82% rename from Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightShadowmapsPass.h rename to Gems/Atom/Feature/Common/Code/Source/CoreLights/ProjectedShadowmapsPass.h index 25c505950f..63640d22c6 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightShadowmapsPass.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/ProjectedShadowmapsPass.h @@ -23,16 +23,16 @@ namespace AZ { namespace Render { - //! SpotLightShadowmapsPass owns ShadowmapPasses for Spot Lights. - class SpotLightShadowmapsPass final + //! ProjectedShadowmapsPass owns shadowmap passes for projected lights. + class ProjectedShadowmapsPass final : public RPI::ParentPass { - AZ_RPI_PASS(SpotLightShadowmapsPass); + AZ_RPI_PASS(ProjectedShadowmapsPass); using Base = RPI::ParentPass; public: - AZ_CLASS_ALLOCATOR(SpotLightShadowmapsPass, SystemAllocator, 0); - AZ_RTTI(SpotLightShadowmapsPass, "00024B13-1095-40FA-BEC3-B0F68110BEA2", Base); + AZ_CLASS_ALLOCATOR(ProjectedShadowmapsPass, SystemAllocator, 0); + AZ_RTTI(ProjectedShadowmapsPass, "00024B13-1095-40FA-BEC3-B0F68110BEA2", Base); static constexpr uint16_t InvalidIndex = ~0; struct ShadowmapSizeWithIndices @@ -41,8 +41,8 @@ namespace AZ uint16_t m_shadowIndexInSrg = InvalidIndex; }; - virtual ~SpotLightShadowmapsPass(); - static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); + virtual ~ProjectedShadowmapsPass(); + static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); //! This returns true if this pass is of the given render pipeline. bool IsOfRenderPipeline(const RPI::RenderPipeline& renderPipeline) const; @@ -50,8 +50,8 @@ namespace AZ //! This returns the pipeline view tag used in shadowmap passes. const RPI::PipelineViewTag& GetPipelineViewTagOfChild(size_t childIndex); - //! This update shadowmap sizes for each spot light index. - //! @param sizes shadowmap sizes for each spot light index. + //! This update shadowmap sizes for each projected light shadow index. + //! @param sizes shadowmap sizes for each projected light shadow index. void UpdateShadowmapSizes(const AZStd::vector& sizes); //! This returns the image size(width/height) of shadowmap atlas. @@ -67,8 +67,8 @@ namespace AZ ShadowmapAtlas& GetShadowmapAtlas(); private: - SpotLightShadowmapsPass() = delete; - explicit SpotLightShadowmapsPass(const RPI::PassDescriptor& descriptor); + ProjectedShadowmapsPass() = delete; + explicit ProjectedShadowmapsPass(const RPI::PassDescriptor& descriptor); // RPI::Pass overrides... void BuildAttachmentsInternal() override; diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/Shadow.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/Shadow.h index 97d52cdff8..4601e77fa8 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/Shadow.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/Shadow.h @@ -23,7 +23,7 @@ namespace AZ { AZ_ENUM_CLASS_WITH_UNDERLYING_TYPE(ShadowmapType, uint32_t, (Directional, 0), - Spot); + Projected); const Matrix4x4& GetClipToShadowmapTextureMatrix(); } // namespace Shadow diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/SimplePointLightFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/SimplePointLightFeatureProcessor.cpp new file mode 100644 index 0000000000..591abc1b57 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/SimplePointLightFeatureProcessor.cpp @@ -0,0 +1,173 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include + +#include + +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + void SimplePointLightFeatureProcessor::Reflect(ReflectContext* context) + { + if (auto * serializeContext = azrtti_cast(context)) + { + serializeContext + ->Class() + ->Version(0); + } + } + + SimplePointLightFeatureProcessor::SimplePointLightFeatureProcessor() + : SimplePointLightFeatureProcessorInterface() + { + } + + void SimplePointLightFeatureProcessor::Activate() + { + GpuBufferHandler::Descriptor desc; + desc.m_bufferName = "SimplePointLightBuffer"; + desc.m_bufferSrgName = "m_simplePointLights"; + desc.m_elementCountSrgName = "m_simplePointLightCount"; + desc.m_elementSize = sizeof(SimplePointLightData); + desc.m_srgLayout = RPI::RPISystemInterface::Get()->GetViewSrgAsset()->GetLayout(); + + m_lightBufferHandler = GpuBufferHandler(desc); + } + + void SimplePointLightFeatureProcessor::Deactivate() + { + m_pointLightData.Clear(); + m_lightBufferHandler.Release(); + } + + SimplePointLightFeatureProcessor::LightHandle SimplePointLightFeatureProcessor::AcquireLight() + { + uint16_t id = m_pointLightData.GetFreeSlotIndex(); + + if (id == IndexedDataVector::NoFreeSlot) + { + return LightHandle::Null; + } + else + { + m_deviceBufferNeedsUpdate = true; + return LightHandle(id); + } + } + + bool SimplePointLightFeatureProcessor::ReleaseLight(LightHandle& handle) + { + if (handle.IsValid()) + { + m_pointLightData.RemoveIndex(handle.GetIndex()); + m_deviceBufferNeedsUpdate = true; + handle.Reset(); + return true; + } + return false; + } + + SimplePointLightFeatureProcessor::LightHandle SimplePointLightFeatureProcessor::CloneLight(LightHandle sourceLightHandle) + { + AZ_Assert(sourceLightHandle.IsValid(), "Invalid LightHandle passed to SimplePointLightFeatureProcessor::CloneLight()."); + + LightHandle handle = AcquireLight(); + if (handle.IsValid()) + { + m_pointLightData.GetData(handle.GetIndex()) = m_pointLightData.GetData(sourceLightHandle.GetIndex()); + m_deviceBufferNeedsUpdate = true; + } + return handle; + } + + void SimplePointLightFeatureProcessor::Simulate(const FeatureProcessor::SimulatePacket& packet) + { + AZ_ATOM_PROFILE_FUNCTION("RPI", "SimplePointLightFeatureProcessor: Simulate"); + AZ_UNUSED(packet); + + if (m_deviceBufferNeedsUpdate) + { + m_lightBufferHandler.UpdateBuffer(m_pointLightData.GetDataVector()); + m_deviceBufferNeedsUpdate = false; + } + } + + void SimplePointLightFeatureProcessor::Render(const SimplePointLightFeatureProcessor::RenderPacket& packet) + { + AZ_ATOM_PROFILE_FUNCTION("RPI", "SimplePointLightFeatureProcessor: Render"); + + for (const RPI::ViewPtr& view : packet.m_views) + { + m_lightBufferHandler.UpdateSrg(view->GetShaderResourceGroup().get()); + } + } + + void SimplePointLightFeatureProcessor::SetRgbIntensity(LightHandle handle, const PhotometricColor& lightRgbIntensity) + { + AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SimplePointLightFeatureProcessor::SetRgbIntensity()."); + + auto transformedColor = AZ::RPI::TransformColor(lightRgbIntensity, AZ::RPI::ColorSpaceId::LinearSRGB, AZ::RPI::ColorSpaceId::ACEScg); + + AZStd::array& rgbIntensity = m_pointLightData.GetData(handle.GetIndex()).m_rgbIntensity; + rgbIntensity[0] = transformedColor.GetR(); + rgbIntensity[1] = transformedColor.GetG(); + rgbIntensity[2] = transformedColor.GetB(); + + m_deviceBufferNeedsUpdate = true; + } + + void SimplePointLightFeatureProcessor::SetPosition(LightHandle handle, const AZ::Vector3& lightPosition) + { + AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SimplePointLightFeatureProcessor::SetPosition()."); + + AZStd::array& position = m_pointLightData.GetData(handle.GetIndex()).m_position; + lightPosition.StoreToFloat3(position.data()); + + m_deviceBufferNeedsUpdate = true; + } + + void SimplePointLightFeatureProcessor::SetAttenuationRadius(LightHandle handle, float attenuationRadius) + { + AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SimplePointLightFeatureProcessor::SetAttenuationRadius()."); + + attenuationRadius = AZStd::max(attenuationRadius, 0.001f); // prevent divide by zero. + m_pointLightData.GetData(handle.GetIndex()).m_invAttenuationRadiusSquared = 1.0f / (attenuationRadius * attenuationRadius); + m_deviceBufferNeedsUpdate = true; + } + + const Data::Instance SimplePointLightFeatureProcessor::GetLightBuffer() const + { + return m_lightBufferHandler.GetBuffer(); + } + + uint32_t SimplePointLightFeatureProcessor::GetLightCount() const + { + return m_lightBufferHandler.GetElementCount(); + } + + } // namespace Render +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/SimplePointLightFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/SimplePointLightFeatureProcessor.h new file mode 100644 index 0000000000..911868b088 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/SimplePointLightFeatureProcessor.h @@ -0,0 +1,74 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include +#include + +namespace AZ +{ + class Vector3; + class Color; + + namespace Render + { + + struct SimplePointLightData + { + AZStd::array m_position = { { 0.0f, 0.0f, 0.0f } }; + float m_invAttenuationRadiusSquared = 0.0f; // Inverse of the distance at which this light no longer has an effect, squared. Also used for falloff calculations. + AZStd::array m_rgbIntensity = { { 0.0f, 0.0f, 0.0f } }; + float m_padding = 0.0f; // explicit padding. + }; + + class SimplePointLightFeatureProcessor final + : public SimplePointLightFeatureProcessorInterface + { + public: + AZ_RTTI(AZ::Render::SimplePointLightFeatureProcessor, "{310CE42A-FAD1-4778-ABF5-0DE04AC92246}", AZ::Render::SimplePointLightFeatureProcessorInterface); + + static void Reflect(AZ::ReflectContext* context); + + SimplePointLightFeatureProcessor(); + virtual ~SimplePointLightFeatureProcessor() = default; + + // FeatureProcessor overrides ... + void Activate() override; + void Deactivate() override; + void Simulate(const SimulatePacket& packet) override; + void Render(const RenderPacket& packet) override; + + // PointLightFeatureProcessorInterface overrides ... + LightHandle AcquireLight() override; + bool ReleaseLight(LightHandle& handle) override; + LightHandle CloneLight(LightHandle handle) override; + void SetRgbIntensity(LightHandle handle, const PhotometricColor& lightColor) override; + void SetPosition(LightHandle handle, const AZ::Vector3& lightPosition) override; + void SetAttenuationRadius(LightHandle handle, float attenuationRadius) override; + + const Data::Instance GetLightBuffer() const; + uint32_t GetLightCount()const; + + private: + SimplePointLightFeatureProcessor(const SimplePointLightFeatureProcessor&) = delete; + + static constexpr const char* FeatureProcessorName = "SimplePointLightFeatureProcessor"; + + IndexedDataVector m_pointLightData; + GpuBufferHandler m_lightBufferHandler; + bool m_deviceBufferNeedsUpdate = false; + }; + } // namespace Render +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/SimpleSpotLightFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/SimpleSpotLightFeatureProcessor.cpp new file mode 100644 index 0000000000..f26c0b19b3 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/SimpleSpotLightFeatureProcessor.cpp @@ -0,0 +1,189 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include + +#include + +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + void SimpleSpotLightFeatureProcessor::Reflect(ReflectContext* context) + { + if (auto * serializeContext = azrtti_cast(context)) + { + serializeContext + ->Class() + ->Version(0); + } + } + + SimpleSpotLightFeatureProcessor::SimpleSpotLightFeatureProcessor() + : SimpleSpotLightFeatureProcessorInterface() + { + } + + void SimpleSpotLightFeatureProcessor::Activate() + { + GpuBufferHandler::Descriptor desc; + desc.m_bufferName = "SimpleSpotLightBuffer"; + desc.m_bufferSrgName = "m_simpleSpotLights"; + desc.m_elementCountSrgName = "m_simpleSpotLightCount"; + desc.m_elementSize = sizeof(SimpleSpotLightData); + desc.m_srgLayout = RPI::RPISystemInterface::Get()->GetViewSrgAsset()->GetLayout(); + + m_lightBufferHandler = GpuBufferHandler(desc); + } + + void SimpleSpotLightFeatureProcessor::Deactivate() + { + m_pointLightData.Clear(); + m_lightBufferHandler.Release(); + } + + SimpleSpotLightFeatureProcessor::LightHandle SimpleSpotLightFeatureProcessor::AcquireLight() + { + uint16_t id = m_pointLightData.GetFreeSlotIndex(); + + if (id == IndexedDataVector::NoFreeSlot) + { + return LightHandle::Null; + } + else + { + m_deviceBufferNeedsUpdate = true; + return LightHandle(id); + } + } + + bool SimpleSpotLightFeatureProcessor::ReleaseLight(LightHandle& handle) + { + if (handle.IsValid()) + { + m_pointLightData.RemoveIndex(handle.GetIndex()); + m_deviceBufferNeedsUpdate = true; + handle.Reset(); + return true; + } + return false; + } + + SimpleSpotLightFeatureProcessor::LightHandle SimpleSpotLightFeatureProcessor::CloneLight(LightHandle sourceLightHandle) + { + AZ_Assert(sourceLightHandle.IsValid(), "Invalid LightHandle passed to SimpleSpotLightFeatureProcessor::CloneLight()."); + + LightHandle handle = AcquireLight(); + if (handle.IsValid()) + { + m_pointLightData.GetData(handle.GetIndex()) = m_pointLightData.GetData(sourceLightHandle.GetIndex()); + m_deviceBufferNeedsUpdate = true; + } + return handle; + } + + void SimpleSpotLightFeatureProcessor::Simulate(const FeatureProcessor::SimulatePacket& packet) + { + AZ_ATOM_PROFILE_FUNCTION("RPI", "SimpleSpotLightFeatureProcessor: Simulate"); + AZ_UNUSED(packet); + + if (m_deviceBufferNeedsUpdate) + { + m_lightBufferHandler.UpdateBuffer(m_pointLightData.GetDataVector()); + m_deviceBufferNeedsUpdate = false; + } + } + + void SimpleSpotLightFeatureProcessor::Render(const SimpleSpotLightFeatureProcessor::RenderPacket& packet) + { + AZ_ATOM_PROFILE_FUNCTION("RPI", "SimpleSpotLightFeatureProcessor: Render"); + + for (const RPI::ViewPtr& view : packet.m_views) + { + m_lightBufferHandler.UpdateSrg(view->GetShaderResourceGroup().get()); + } + } + + void SimpleSpotLightFeatureProcessor::SetRgbIntensity(LightHandle handle, const PhotometricColor& lightRgbIntensity) + { + AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SimpleSpotLightFeatureProcessor::SetRgbIntensity()."); + + auto transformedColor = AZ::RPI::TransformColor(lightRgbIntensity, AZ::RPI::ColorSpaceId::LinearSRGB, AZ::RPI::ColorSpaceId::ACEScg); + + AZStd::array& rgbIntensity = m_pointLightData.GetData(handle.GetIndex()).m_rgbIntensity; + rgbIntensity[0] = transformedColor.GetR(); + rgbIntensity[1] = transformedColor.GetG(); + rgbIntensity[2] = transformedColor.GetB(); + + m_deviceBufferNeedsUpdate = true; + } + + void SimpleSpotLightFeatureProcessor::SetPosition(LightHandle handle, const AZ::Vector3& lightPosition) + { + AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SimpleSpotLightFeatureProcessor::SetPosition()."); + + AZStd::array& position = m_pointLightData.GetData(handle.GetIndex()).m_position; + lightPosition.StoreToFloat3(position.data()); + + m_deviceBufferNeedsUpdate = true; + } + + void SimpleSpotLightFeatureProcessor::SetDirection(LightHandle handle, const AZ::Vector3& lightDirection) + { + AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SimpleSpotLightFeatureProcessor::SetDirection()."); + + AZStd::array& direction = m_pointLightData.GetData(handle.GetIndex()).m_direction; + lightDirection.StoreToFloat3(direction.data()); + + m_deviceBufferNeedsUpdate = true; + } + + void SimpleSpotLightFeatureProcessor::SetConeAngles(LightHandle handle, float innerRadians, float outerRadians) + { + m_pointLightData.GetData(handle.GetIndex()).m_cosInnerConeAngle = cosf(innerRadians); + m_pointLightData.GetData(handle.GetIndex()).m_cosOuterConeAngle = cosf(outerRadians); + } + + void SimpleSpotLightFeatureProcessor::SetAttenuationRadius(LightHandle handle, float attenuationRadius) + { + AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SimpleSpotLightFeatureProcessor::SetAttenuationRadius()."); + + attenuationRadius = AZStd::max(attenuationRadius, 0.001f); // prevent divide by zero. + m_pointLightData.GetData(handle.GetIndex()).m_invAttenuationRadiusSquared = 1.0f / (attenuationRadius * attenuationRadius); + m_deviceBufferNeedsUpdate = true; + } + + const Data::Instance SimpleSpotLightFeatureProcessor::GetLightBuffer() const + { + return m_lightBufferHandler.GetBuffer(); + } + + uint32_t SimpleSpotLightFeatureProcessor::GetLightCount() const + { + return m_lightBufferHandler.GetElementCount(); + } + + } // namespace Render +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/SimpleSpotLightFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/SimpleSpotLightFeatureProcessor.h new file mode 100644 index 0000000000..1b8d0058dd --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/SimpleSpotLightFeatureProcessor.h @@ -0,0 +1,78 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include +#include + +namespace AZ +{ + class Vector3; + class Color; + + namespace Render + { + + struct SimpleSpotLightData + { + AZStd::array m_position = { { 0.0f, 0.0f, 0.0f } }; + float m_invAttenuationRadiusSquared = 0.0f; // Inverse of the distance at which this light no longer has an effect, squared. Also used for falloff calculations. + AZStd::array m_direction = { { 0.0f, 0.0f, 0.0f } }; + float m_cosInnerConeAngle = 0.0f; // Cosine of the inner cone angle + AZStd::array m_rgbIntensity = { { 0.0f, 0.0f, 0.0f } }; + float m_cosOuterConeAngle = 0.0f; // Cosine of the outer cone angle + }; + + class SimpleSpotLightFeatureProcessor final + : public SimpleSpotLightFeatureProcessorInterface + { + public: + AZ_RTTI(AZ::Render::SimpleSpotLightFeatureProcessor, "{01610AD4-0872-4F80-9F12-22FB7CCF6866}", AZ::Render::SimpleSpotLightFeatureProcessorInterface); + + static void Reflect(AZ::ReflectContext* context); + + SimpleSpotLightFeatureProcessor(); + virtual ~SimpleSpotLightFeatureProcessor() = default; + + // FeatureProcessor overrides ... + void Activate() override; + void Deactivate() override; + void Simulate(const SimulatePacket& packet) override; + void Render(const RenderPacket& packet) override; + + // SimpleSpotLightFeatureProcessorInterface overrides ... + LightHandle AcquireLight() override; + bool ReleaseLight(LightHandle& handle) override; + LightHandle CloneLight(LightHandle handle) override; + void SetRgbIntensity(LightHandle handle, const PhotometricColor& lightColor) override; + void SetPosition(LightHandle handle, const AZ::Vector3& lightPosition) override; + void SetDirection(LightHandle handle, const AZ::Vector3& lightDirection) override; + virtual void SetConeAngles(LightHandle handle, float innerRadians, float outerRadians) override; + void SetAttenuationRadius(LightHandle handle, float attenuationRadius) override; + + const Data::Instance GetLightBuffer() const; + uint32_t GetLightCount()const; + + private: + SimpleSpotLightFeatureProcessor(const SimpleSpotLightFeatureProcessor&) = delete; + + static constexpr const char* FeatureProcessorName = "SimpleSpotLightFeatureProcessor"; + + IndexedDataVector m_pointLightData; + GpuBufferHandler m_lightBufferHandler; + bool m_deviceBufferNeedsUpdate = false; + }; + } // namespace Render +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightFeatureProcessor.cpp deleted file mode 100644 index 3dc31c2f32..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightFeatureProcessor.cpp +++ /dev/null @@ -1,929 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include -#include -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace AZ -{ - namespace Render - { - namespace - { - static AZStd::array GetDepthUnprojectConstants(const RPI::ViewPtr view) - { - AZStd::array unprojectConstants; - unprojectConstants[0] = view->GetViewToClipMatrix().GetRow(2).GetElement(2); - unprojectConstants[1] = view->GetViewToClipMatrix().GetRow(2).GetElement(3); - return unprojectConstants; - } - } - - - void SpotLightFeatureProcessor::Reflect(ReflectContext* context) - { - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext - ->Class() - ->Version(0); - } - } - - void SpotLightFeatureProcessor::Activate() - { - const RHI::ShaderResourceGroupLayout* viewSrgLayout = RPI::RPISystemInterface::Get()->GetViewSrgAsset()->GetLayout(); - - GpuBufferHandler::Descriptor desc; - - desc.m_bufferName = "SpotLightBuffer"; - desc.m_bufferSrgName = "m_spotLights"; - desc.m_elementCountSrgName = "m_spotLightCount"; - desc.m_elementSize = sizeof(SpotLightData); - desc.m_srgLayout = viewSrgLayout; - - m_lightBufferHandler = GpuBufferHandler(desc); - - desc.m_bufferName = "SpotLightShadowBuffer"; - desc.m_bufferSrgName = "m_spotLightShadows"; - desc.m_elementCountSrgName = ""; - desc.m_elementSize = sizeof(SpotLightShadowData); - desc.m_srgLayout = viewSrgLayout; - - m_shadowBufferHandler = GpuBufferHandler(desc); - - desc.m_bufferName = "EsmParameterBuffer(Spot)"; - desc.m_bufferSrgName = "m_esmsSpot"; - desc.m_elementCountSrgName = ""; - desc.m_elementSize = sizeof(EsmShadowmapsPass::FilterParameter); - desc.m_srgLayout = viewSrgLayout; - - m_esmParameterBufferHandler = GpuBufferHandler(desc); - - m_shadowmapAtlasSizeIndex = viewSrgLayout->FindShaderInputConstantIndex(Name("m_shadowmapAtlasSize")); - m_invShadowmapAtlasSize = viewSrgLayout->FindShaderInputConstantIndex(Name("m_invShadowmapAtlasSize")); - - CachePasses(); - EnableSceneNotification(); - } - - void SpotLightFeatureProcessor::Deactivate() - { - DisableSceneNotification(); - - m_spotLightData.Clear(); - m_lightBufferHandler.Release(); - - m_shadowData.Clear(); - m_shadowBufferHandler.Release(); - - m_esmParameterData.Clear(); - m_esmParameterBufferHandler.Release(); - - for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) - { - esmPass->SetEnabledComputation(false); - } - } - - SpotLightFeatureProcessor::LightHandle SpotLightFeatureProcessor::AcquireLight() - { - const uint16_t index = m_spotLightData.GetFreeSlotIndex(); - const uint16_t propIndex = m_lightProperties.GetFreeSlotIndex(); - AZ_Assert(index == propIndex, "light index is illegal."); - if (index == IndexedDataVector::NoFreeSlot) - { - return LightHandle::Null; - } - else - { - m_deviceBufferNeedsUpdate = true; - const LightHandle handle(index); - return handle; - } - } - - bool SpotLightFeatureProcessor::ReleaseLight(LightHandle& handle) - { - if (handle.IsValid()) - { - CleanUpShadow(handle); - m_spotLightData.RemoveIndex(handle.GetIndex()); - m_lightProperties.RemoveIndex(handle.GetIndex()); - - m_deviceBufferNeedsUpdate = true; - handle.Reset(); - return true; - } - return false; - } - - SpotLightFeatureProcessor::LightHandle SpotLightFeatureProcessor::CloneLight(LightHandle sourceLightHandle) - { - AZ_Assert(sourceLightHandle.IsValid(), "Invalid LightHandle passed to SpotLightFeatureProcessor::CloneLight()."); - - LightHandle handle = AcquireLight(); - if (handle.IsValid()) - { - m_spotLightData.GetData(handle.GetIndex()) = m_spotLightData.GetData(sourceLightHandle.GetIndex()); - m_deviceBufferNeedsUpdate = true; - } - return handle; - } - - void SpotLightFeatureProcessor::OnRenderPipelinePassesChanged([[maybe_unused]] RPI::RenderPipeline* renderPipeline) - { - CachePasses(); - } - - void SpotLightFeatureProcessor::OnRenderPipelineAdded(RPI::RenderPipelinePtr pipeline) - { - CachePasses(); - } - - void SpotLightFeatureProcessor::OnRenderPipelineRemoved([[maybe_unused]] RPI::RenderPipeline* pipeline) - { - CachePasses(); - } - - void SpotLightFeatureProcessor::Simulate(const FeatureProcessor::SimulatePacket& packet) - { - AZ_ATOM_PROFILE_FUNCTION("RPI", "SpotLightFeatureProcessor: Simulate"); - AZ_UNUSED(packet); - - UpdateShadowmapViews(); - SetShadowParameterToShadowData(); - - if (m_shadowmapPassNeedsUpdate) - { - AZStd::vector shadowmapSizes(m_shadowProperties.size()); - for (auto& it : m_shadowProperties) - { - const int32_t shadowIndexInSrgSigned = m_spotLightData.GetData(it.first.GetIndex()).m_shadowIndex; - AZ_Assert(shadowIndexInSrgSigned >= 0, "Shadow index in SRG is illegal."); - const uint16_t shadowIndexInSrg = aznumeric_cast(shadowIndexInSrgSigned); - it.second.m_viewTagIndex = shadowIndexInSrg; - SpotLightShadowmapsPass::ShadowmapSizeWithIndices& sizeWithIndices = shadowmapSizes[shadowIndexInSrg]; - sizeWithIndices.m_size = static_cast(m_shadowData.GetData(it.second.m_shadowHandle.GetIndex()).m_shadowmapSize); - sizeWithIndices.m_shadowIndexInSrg = shadowIndexInSrg; - } - for (SpotLightShadowmapsPass* shadowPass : m_spotLightShadowmapsPasses) - { - shadowPass->UpdateShadowmapSizes(shadowmapSizes); - } - for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) - { - esmPass->QueueForBuildAttachments(); - } - - for (const SpotLightShadowmapsPass* shadowPass : m_spotLightShadowmapsPasses) - { - for (const auto& it : m_shadowProperties) - { - const int32_t shadowIndexInSrg = m_spotLightData.GetData(it.first.GetIndex()).m_shadowIndex; - if (shadowIndexInSrg >= 0) - { - const ShadowmapAtlas::Origin origin = shadowPass->GetOriginInAtlas(aznumeric_cast(shadowIndexInSrg)); - SpotLightShadowData& shadow = m_shadowData.GetData(it.second.m_shadowHandle.GetIndex()); - shadow.m_shadowmapArraySlice = origin.m_arraySlice; - shadow.m_shadowmapOriginInSlice = origin.m_originInSlice; - m_deviceBufferNeedsUpdate = true; - } - } - break; - } - m_shadowmapPassNeedsUpdate = false; - } - - // This has to be called after UpdateShadowmapSizes(). - UpdateFilterParameters(); - - if (m_deviceBufferNeedsUpdate) - { - m_lightBufferHandler.UpdateBuffer(m_spotLightData.GetDataVector()); - m_shadowBufferHandler.UpdateBuffer(m_shadowData.GetDataVector()); - m_deviceBufferNeedsUpdate = false; - } - } - - void SpotLightFeatureProcessor::PrepareViews(const PrepareViewsPacket&, AZStd::vector>& outViews) - { - for (SpotLightShadowmapsPass* pass : m_spotLightShadowmapsPasses) - { - RPI::RenderPipeline* renderPipeline = pass->GetRenderPipeline(); - if (renderPipeline) - { - for (auto& it : m_shadowProperties) - { - SpotLightShadowData& shadow = m_shadowData.GetData(it.second.m_shadowHandle.GetIndex()); - if (shadow.m_shadowmapSize == aznumeric_cast(ShadowmapSize::None)) - { - continue; - } - - const RPI::PipelineViewTag& viewTag = pass->GetPipelineViewTagOfChild(it.second.m_viewTagIndex); - const RHI::DrawListMask drawListMask = renderPipeline->GetDrawListMask(viewTag); - if (it.second.m_shadowmapView->GetDrawListMask() != drawListMask) - { - it.second.m_shadowmapView->Reset(); - it.second.m_shadowmapView->SetDrawListMask(drawListMask); - } - - outViews.emplace_back(AZStd::make_pair( - viewTag, - it.second.m_shadowmapView)); - } - } - break; - } - } - - void SpotLightFeatureProcessor::Render(const SpotLightFeatureProcessor::RenderPacket& packet) - { - AZ_ATOM_PROFILE_FUNCTION("RPI", "SpotLightFeatureProcessor: Render"); - - for (const SpotLightShadowmapsPass* pass : m_spotLightShadowmapsPasses) - { - for (const RPI::ViewPtr& view : packet.m_views) - { - if (view->GetUsageFlags() & RPI::View::UsageFlags::UsageCamera) - { - RPI::ShaderResourceGroup* srg = view->GetShaderResourceGroup().get(); - srg->SetConstant(m_shadowmapAtlasSizeIndex, static_cast(pass->GetShadowmapAtlasSize())); - const float invShadowmapSize = 1.0f / static_cast(pass->GetShadowmapAtlasSize()); - srg->SetConstant(m_invShadowmapAtlasSize, invShadowmapSize); - - m_lightBufferHandler.UpdateSrg(srg); - m_shadowBufferHandler.UpdateSrg(srg); - m_esmParameterBufferHandler.UpdateSrg(srg); - } - } - break; - } - } - - void SpotLightFeatureProcessor::SetRgbIntensity(LightHandle handle, const PhotometricColor& lightRgbIntensity) - { - AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SpotLightFeatureProcessor::SetRgbIntensity()."); - - auto transformedColor = AZ::RPI::TransformColor(lightRgbIntensity, AZ::RPI::ColorSpaceId::LinearSRGB, AZ::RPI::ColorSpaceId::ACEScg); - - AZStd::array& rgbIntensity = m_spotLightData.GetData(handle.GetIndex()).m_rgbIntensity; - rgbIntensity[0] = transformedColor.GetR(); - rgbIntensity[1] = transformedColor.GetG(); - rgbIntensity[2] = transformedColor.GetB(); - - m_deviceBufferNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::SetPosition(LightHandle handle, const AZ::Vector3& lightPosition) - { - AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SpotLightFeatureProcessor::SetPosition()."); - - SpotLightData& light = m_spotLightData.GetData(handle.GetIndex()); - lightPosition.StoreToFloat3(light.m_position.data()); - - if (light.m_shadowIndex >= 0) - { - AZ_Assert(m_shadowProperties.find(handle) != m_shadowProperties.end(), "ShadowmapProperty is incorrect."); - m_shadowProperties.at(handle).m_shadowmapViewNeedsUpdate = true; - m_filterParameterNeedsUpdate = true; - } - m_deviceBufferNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::SetDirection(LightHandle handle, const AZ::Vector3& lightDirection) - { - AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SpotLightFeatureProcessor::SetDirection()."); - - SpotLightData& light = m_spotLightData.GetData(handle.GetIndex()); - lightDirection.GetNormalized().StoreToFloat3(light.m_direction.data()); - - if (light.m_shadowIndex >= 0) - { - AZ_Assert(m_shadowProperties.find(handle) != m_shadowProperties.end(), "ShadowmapProperty is incorrect."); - m_shadowProperties.at(handle).m_shadowmapViewNeedsUpdate = true; - m_filterParameterNeedsUpdate = true; - } - m_deviceBufferNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::SetBulbRadius(LightHandle handle, float bulbRadius) - { - SpotLightData& light = m_spotLightData.GetData(handle.GetIndex()); - light.m_bulbRadius = bulbRadius; - UpdateBulbPositionOffset(light); - - if (light.m_shadowIndex >= 0) - { - auto itr = m_shadowProperties.find(handle); - AZ_Assert(itr != m_shadowProperties.end(), "ShadowmapProperty is incorrect."); - itr->second.m_shadowmapViewNeedsUpdate = true; - m_filterParameterNeedsUpdate = true; - } - m_deviceBufferNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::SetConeAngles(LightHandle handle, float innerDegrees, float outerDegrees) - { - AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SpotLightFeatureProcessor::SetConeAngles()."); - SpotLightData& light = m_spotLightData.GetData(handle.GetIndex()); - - if (light.m_shadowIndex < 0) - { - innerDegrees = AZStd::GetMin(innerDegrees, MaxSpotLightConeAngleDegree); - outerDegrees = AZStd::GetMin(outerDegrees, MaxSpotLightConeAngleDegree); - } - else - { - innerDegrees = AZStd::GetMin(innerDegrees, MaxSpotLightConeAngleDegreeWithShadow); - outerDegrees = AZStd::GetMin(outerDegrees, MaxSpotLightConeAngleDegreeWithShadow); - - AZ_Assert(m_shadowProperties.find(handle) != m_shadowProperties.end(), "ShadowmapProperty is incorrect."); - m_shadowProperties[handle].m_shadowmapViewNeedsUpdate = true; - m_filterParameterNeedsUpdate = true; - } - - light.m_innerConeAngle = cosf(DegToRad(innerDegrees) * 0.5f); - light.m_outerConeAngle = cosf(DegToRad(outerDegrees) * 0.5f); - m_lightProperties.GetData(handle.GetIndex()).m_outerConeAngle = DegToRad(outerDegrees); - UpdateBulbPositionOffset(light); - m_deviceBufferNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::SetPenumbraBias(LightHandle handle, float penumbraBias) - { - AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SpotLightFeatureProcessor::SetPenumbraBias()."); - - // Biases at 1.0 and -1.0 exactly can cause div by zero / inf in the shader, so clamp them just inside that range. - penumbraBias = AZStd::clamp(penumbraBias, -0.999f, 0.999f); - - // Change space from (-1.0 to 1.0) to (-1.0 to infinity) - penumbraBias = (2.0f * penumbraBias) / (1.0f - penumbraBias); - - m_spotLightData.GetData(handle.GetIndex()).m_penumbraBias = penumbraBias; - m_deviceBufferNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::SetAttenuationRadius(LightHandle handle, float attenuationRadius) - { - AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SpotLightFeatureProcessor::SetAttenuationRadius()."); - - attenuationRadius = AZStd::max(attenuationRadius, 0.001f); // prevent divide by zero. - SpotLightData& light = m_spotLightData.GetData(handle.GetIndex()); - light.m_invAttenuationRadiusSquared = 1.0f / (attenuationRadius * attenuationRadius); - - if (light.m_shadowIndex >= 0) - { - AZ_Assert(m_shadowProperties.find(handle) != m_shadowProperties.end(), "ShadowmapProperty is incorrect."); - m_shadowProperties[handle].m_shadowmapViewNeedsUpdate = true; - m_filterParameterNeedsUpdate = true; - } - m_deviceBufferNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::SetShadowmapSize(LightHandle handle, ShadowmapSize shadowmapSize) - { - AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SpotLightFeatureProcessor::SetShadowmapSize()."); - - if (shadowmapSize == ShadowmapSize::None) - { - CleanUpShadow(handle); - } - else - { - PrepareForShadow(handle, shadowmapSize); - } - } - - void SpotLightFeatureProcessor::SetShadowFilterMethod(LightHandle handle, ShadowFilterMethod method) - { - ShadowProperty& property = GetOrCreateShadowProperty(handle); - const uint16_t shadowIndex = property.m_shadowHandle.GetIndex(); - m_shadowData.GetData(shadowIndex).m_shadowFilterMethod = aznumeric_cast(method); - - m_deviceBufferNeedsUpdate = true; - property.m_shadowmapViewNeedsUpdate = true; - - if (m_shadowData.GetData(shadowIndex).m_shadowmapSize != - aznumeric_cast(ShadowmapSize::None)) - { - m_filterParameterNeedsUpdate = true; - - for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) - { - esmPass->SetEnabledComputation( - method == ShadowFilterMethod::Esm || - method == ShadowFilterMethod::EsmPcf); - } - } - } - - void SpotLightFeatureProcessor::SetShadowBoundaryWidthAngle(LightHandle handle, float boundaryWidthDegree) - { - const auto& property = GetOrCreateShadowProperty(handle); - const uint16_t shadowIndex = property.m_shadowHandle.GetIndex(); - m_shadowData.GetData(shadowIndex).m_boundaryScale = DegToRad(boundaryWidthDegree / 2.f); - m_filterParameterNeedsUpdate = true; - m_deviceBufferNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::SetPredictionSampleCount(LightHandle handle, uint16_t count) - { - if (count > Shadow::MaxPcfSamplingCount) - { - AZ_Warning("SpotLightFeatureProcessor", false, "Sampling count exceed the limit."); - count = Shadow::MaxPcfSamplingCount; - } - const auto& property = GetOrCreateShadowProperty(handle); - const uint16_t shadowIndex = property.m_shadowHandle.GetIndex(); - m_shadowData.GetData(shadowIndex).m_predictionSampleCount = count; - - m_deviceBufferNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::SetPcfMethod(LightHandle handle, PcfMethod method) - { - const auto& property = GetOrCreateShadowProperty(handle); - const uint16_t shadowIndex = property.m_shadowHandle.GetIndex(); - m_shadowData.GetData(shadowIndex).m_pcfMethod = method; - - m_deviceBufferNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::SetFilteringSampleCount(LightHandle handle, uint16_t count) - { - if (count > Shadow::MaxPcfSamplingCount) - { - AZ_Warning("SpotLightFeatureProcessor", false, "Sampling count exceed the limit."); - count = Shadow::MaxPcfSamplingCount; - } - auto property = m_shadowProperties.find(handle); - if (property == m_shadowProperties.end()) - { - // If shadow has not been ready yet, prepare it - // for placeholder of shadow filter method value. - PrepareForShadow(handle, ShadowmapSize::None); - property = m_shadowProperties.find(handle); - } - - const uint16_t shadowIndex = property->second.m_shadowHandle.GetIndex(); - m_shadowData.GetData(shadowIndex).m_filteringSampleCount = count; - m_deviceBufferNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::SetSpotLightData(LightHandle handle, const SpotLightData& data) - { - AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SpotLightFeatureProcessor::SetSpotLightData()."); - - m_spotLightData.GetData(handle.GetIndex()) = data; - m_deviceBufferNeedsUpdate = true; - m_shadowmapPassNeedsUpdate = true; - } - - const Data::Instance SpotLightFeatureProcessor::GetLightBuffer()const - { - return m_lightBufferHandler.GetBuffer(); - } - - uint32_t SpotLightFeatureProcessor::GetLightCount() const - { - return m_lightBufferHandler.GetElementCount(); - } - - SpotLightFeatureProcessor::ShadowProperty& SpotLightFeatureProcessor::GetOrCreateShadowProperty(LightHandle handle) - { - auto propIt = m_shadowProperties.find(handle); - if (propIt == m_shadowProperties.end()) - { - // If shadow has not been ready yet, prepare it - // for placeholder of shadow filter method value. - PrepareForShadow(handle, ShadowmapSize::None); - propIt = m_shadowProperties.find(handle); - } - return propIt->second; - } - - void SpotLightFeatureProcessor::PrepareForShadow(LightHandle handle, ShadowmapSize size) - { - m_deviceBufferNeedsUpdate = true; - m_shadowmapPassNeedsUpdate = true; - - auto propIt = m_shadowProperties.find(handle); - - // If shadowmap size is already set, early return; - if (propIt != m_shadowProperties.end() && - m_shadowData.GetData(propIt->second.m_shadowHandle.GetIndex()).m_shadowmapSize == aznumeric_cast(size)) - { - return; - } - - // If shadow is not ready, prepare related structures. - if (propIt == m_shadowProperties.end()) - { - const uint16_t shadowIndex = m_shadowData.GetFreeSlotIndex(); - const uint16_t esmIndex = m_esmParameterData.GetFreeSlotIndex(); - AZ_Assert(shadowIndex == esmIndex, "Indices of shadow must coincide."); - - m_spotLightData.GetData(handle.GetIndex()).m_shadowIndex = m_shadowData.GetRawIndex(shadowIndex); - - ShadowProperty property; - property.m_shadowHandle = LightHandle(shadowIndex); - AZ::Name viewName(AZStd::string::format("SpotLightShadowView (lightId:%d)", handle.GetIndex())); - property.m_shadowmapView = RPI::View::CreateView(viewName, RPI::View::UsageShadow); - property.m_shadowmapViewNeedsUpdate = true; - m_shadowProperties.insert(AZStd::make_pair(handle, AZStd::move(property))); - - propIt = m_shadowProperties.find(handle); - } - - // Set shadowmap size to shadow data. - const uint16_t shadowIndex = propIt->second.m_shadowHandle.GetIndex(); - m_shadowData.GetData(shadowIndex).m_shadowmapSize = aznumeric_cast(size); - - m_filterParameterNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::CleanUpShadow(LightHandle handle) - { - const auto& propIt = m_shadowProperties.find(handle); - if (propIt == m_shadowProperties.end()) - { - return; - } - - const uint16_t shadowIndex = propIt->second.m_shadowHandle.GetIndex(); - m_shadowData.RemoveIndex(shadowIndex); - m_esmParameterData.RemoveIndex(shadowIndex); - m_shadowProperties.erase(handle); - m_spotLightData.GetData(handle.GetIndex()).m_shadowIndex = -1; - - // By removing shadow of a light, shadow indices of the other lights - // can become stale. So they should be updated. - for (auto& propIt2 : m_shadowProperties) - { - const LightHandle lightHandle = propIt2.first; - const LightHandle shadowHandle = propIt2.second.m_shadowHandle; - m_spotLightData.GetData(lightHandle.GetIndex()).m_shadowIndex = m_shadowData.GetRawIndex(shadowHandle.GetIndex()); - } - - m_shadowmapPassNeedsUpdate = true; - } - - void SpotLightFeatureProcessor::UpdateShadowmapViews() - { - if (m_spotLightShadowmapsPasses.empty() || m_esmShadowmapsPasses.empty()) - { - return; - } - - for (auto& it : m_shadowProperties) - { - if (!it.second.m_shadowmapViewNeedsUpdate) - { - continue; - } - it.second.m_shadowmapViewNeedsUpdate = false; - const SpotLightData& light = m_spotLightData.GetData(it.first.GetIndex()); - - const float invRadiusSquared = light.m_invAttenuationRadiusSquared; - if (invRadiusSquared <= 0.f) - { - AZ_Assert(false, "Attenuation radius have to be set before use the light."); - continue; - } - const float attenuationRadius = sqrtf(1.f / invRadiusSquared); - - constexpr float SmallAngle = 0.01f; - const float coneAngle = GetMax(m_lightProperties.GetData(it.first.GetIndex()).m_outerConeAngle, SmallAngle); - - // Set view's matrices. - RPI::ViewPtr view = it.second.m_shadowmapView; - Vector3 position = Vector3::CreateFromFloat3(light.m_position.data()); - const Vector3 direction = Vector3::CreateFromFloat3(light.m_direction.data()); - - // To handle bulb radius, set the position of the shadow caster behind the actual light depending on the radius of the bulb - // - // \ / - // \ / - // \_____/ <-- position of light itself (and forward plane of shadow casting view) - // . . - // . . - // * <-- position of shadow casting view - // - position += light.m_bulbPostionOffset * -direction; - const auto transform = Matrix3x4::CreateLookAt(position, position + direction); - view->SetCameraTransform(transform); - - // If you adjust "NearFarRatio" below, the constant "bias" in SpotLightShadow::GetVisibility() - // in SpotLightShadow.azsli should also be adjusted in order to avoid Peter-Pannings. - constexpr float NearFarRatio = 10000.f; - const float minDist = attenuationRadius / NearFarRatio; - - const float nearDist = GetMax(minDist, light.m_bulbPostionOffset); - float farDist = attenuationRadius + light.m_bulbPostionOffset; - - constexpr float AspectRatio = 1.0f; - - Matrix4x4 viewToClipMatrix; - MakePerspectiveFovMatrixRH( - viewToClipMatrix, - coneAngle, - AspectRatio, - nearDist, - farDist); - - view->SetViewToClipMatrix(viewToClipMatrix); - - const uint16_t shadowIndex = it.second.m_shadowHandle.GetIndex(); - SpotLightShadowData& shadow = m_shadowData.GetData(shadowIndex); - - EsmShadowmapsPass::FilterParameter& esmData = m_esmParameterData.GetData(shadowIndex); - if (shadow.m_shadowFilterMethod == aznumeric_cast(ShadowFilterMethod::Esm) || - shadow.m_shadowFilterMethod == aznumeric_cast(ShadowFilterMethod::EsmPcf)) - { - // Set parameters to calculate linear depth if ESM is used. - m_filterParameterNeedsUpdate = true; - esmData.m_isEnabled = true; - esmData.m_n_f_n = nearDist / (farDist - nearDist); - esmData.m_n_f = nearDist - farDist; - esmData.m_f = farDist; - } - else - { - // Reset enabling flag if ESM is not used. - esmData.m_isEnabled = false; - } - } - } - - void SpotLightFeatureProcessor::SetShadowParameterToShadowData() - { - for (const auto& propIt : m_shadowProperties) - { - const LightHandle& shadowHandle = propIt.second.m_shadowHandle; - AZ_Assert(shadowHandle.IsValid(), "Shadow handle is invalid."); - SpotLightShadowData& shadowData = m_shadowData.GetData(shadowHandle.GetIndex()); - - // Set depth bias matrix. - const Matrix4x4& worldToLightClipMatrix = propIt.second.m_shadowmapView->GetWorldToClipMatrix(); - const Matrix4x4 depthBiasMatrix = Shadow::GetClipToShadowmapTextureMatrix() * worldToLightClipMatrix; - shadowData.m_depthBiasMatrix = depthBiasMatrix; - shadowData.m_unprojectConstants = GetDepthUnprojectConstants(propIt.second.m_shadowmapView); - - m_deviceBufferNeedsUpdate = true; - } - } - - uint16_t SpotLightFeatureProcessor::GetLightIndexInSrg(LightHandle handle) const - { - AZ_Assert(handle.IsValid(), "Invalid LightHandle passed to SpotLightFeatureProcessor::GetLightIndexInSrg()."); - - return m_spotLightData.GetRawIndex(handle.GetIndex()); - } - - void SpotLightFeatureProcessor::CachePasses() - { - const AZStd::vector validPipelineIds = CacheSpotLightShadowmapsPass(); - CacheEsmShadowmapsPass(validPipelineIds); - m_shadowmapPassNeedsUpdate = true; - } - - AZStd::vector SpotLightFeatureProcessor::CacheSpotLightShadowmapsPass() - { - const AZStd::vector& renderPipelines = GetParentScene()->GetRenderPipelines(); - const auto* passSystem = RPI::PassSystemInterface::Get(); - const AZStd::vector& passes = passSystem->GetPassesForTemplateName(Name("SpotLightShadowmapsTemplate")); - - AZStd::vector validPipelineIds; - m_spotLightShadowmapsPasses.clear(); - for (RPI::Pass* pass : passes) - { - SpotLightShadowmapsPass* shadowPass = azrtti_cast(pass); - AZ_Assert(shadowPass, "It is not a SpotLightShadowmapsPass."); - for (const RPI::RenderPipelinePtr& pipeline : renderPipelines) - { - if (pipeline.get() == shadowPass->GetRenderPipeline()) - { - m_spotLightShadowmapsPasses.emplace_back(shadowPass); - validPipelineIds.push_back(shadowPass->GetRenderPipeline()->GetId()); - } - } - } - return validPipelineIds; - } - - void SpotLightFeatureProcessor::CacheEsmShadowmapsPass(const AZStd::vector& validPipelineIds) - { - const auto* passSystem = RPI::PassSystemInterface::Get(); - const AZStd::vector passes = passSystem->GetPassesForTemplateName(Name("EsmShadowmapsTemplate")); - - m_esmShadowmapsPasses.clear(); - for (RPI::Pass* pass : passes) - { - EsmShadowmapsPass* esmPass = azrtti_cast(pass); - AZ_Assert(esmPass, "It is not an EsmShadowmapsPass."); - if (esmPass->GetRenderPipeline() && - AZStd::find(validPipelineIds.begin(), validPipelineIds.end(), esmPass->GetRenderPipeline()->GetId()) != validPipelineIds.end() && - esmPass->GetLightTypeName() == m_lightTypeName) - { - m_esmShadowmapsPasses.emplace_back(esmPass); - } - } - } - - void SpotLightFeatureProcessor::UpdateFilterParameters() - { - if (m_filterParameterNeedsUpdate) - { - UpdateStandardDeviations(); - UpdateFilterOffsetsCounts(); - UpdateShadowmapPositionsInAtlas(); - SetFilterParameterToPass(); - m_filterParameterNeedsUpdate = false; - } - } - - void SpotLightFeatureProcessor::UpdateStandardDeviations() - { - if (m_esmShadowmapsPasses.empty()) - { - AZ_Error("SpotLightFeatureProcessor", false, "Cannot find a required pass."); - return; - } - - AZStd::vector standardDeviations(m_shadowData.GetDataCount()); - for (const auto& propIt : m_shadowProperties) - { - if (!NeedsFilterUpdate(propIt.second.m_shadowHandle)) - { - continue; - } - const SpotLightShadowData& shadow = m_shadowData.GetData(propIt.second.m_shadowHandle.GetIndex()); - const float boundaryWidthAngle = shadow.m_boundaryScale * 2.f; - constexpr float SmallAngle = 0.01f; - const float coneAngle = GetMax(m_lightProperties.GetData(propIt.first.GetIndex()).m_outerConeAngle, SmallAngle); - const float ratioToEntireWidth = boundaryWidthAngle / coneAngle; - const float widthInPixels = ratioToEntireWidth * shadow.m_shadowmapSize; - const float standardDeviation = widthInPixels / (2 * GaussianMathFilter::ReliableSectionFactor); - const int32_t shadowIndexInSrg = m_spotLightData.GetData(propIt.first.GetIndex()).m_shadowIndex; - standardDeviations[shadowIndexInSrg] = standardDeviation; - } - if (standardDeviations.empty()) - { - for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) - { - esmPass->SetEnabledComputation(false); - } - return; - } - for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) - { - esmPass->SetEnabledComputation(true); - esmPass->SetFilterParameters(standardDeviations); - } - } - - void SpotLightFeatureProcessor::UpdateFilterOffsetsCounts() - { - if (m_esmShadowmapsPasses.empty()) - { - AZ_Error("SpotLightFeatureProcessor", false, "Cannot find a required pass."); - return; - } - - // Get array of filter counts for the camera view. - const AZStd::array_view filterCounts = m_esmShadowmapsPasses.front()->GetFilterCounts(); - - // Create array of filter offsets. - AZStd::vector filterOffsets; - filterOffsets.reserve(filterCounts.size()); - uint32_t filterOffset = 0; - for (const uint32_t count : filterCounts) - { - filterOffsets.push_back(filterOffset); - filterOffset += count; - } - - for (auto& propIt : m_shadowProperties) - { - const LightHandle shadowHandle = propIt.second.m_shadowHandle; - EsmShadowmapsPass::FilterParameter& filterParameter = m_esmParameterData.GetData(shadowHandle.GetIndex()); - if (NeedsFilterUpdate(shadowHandle)) - { - // Write filter offsets and filter counts to ESM data. - const int32_t shadowIndexInSrg = m_spotLightData.GetData(propIt.first.GetIndex()).m_shadowIndex; - AZ_Assert(shadowIndexInSrg >= 0, "Shadow index in SRG must be non-negative."); - filterParameter.m_parameterOffset = filterOffsets[shadowIndexInSrg]; - filterParameter.m_parameterCount = filterCounts[shadowIndexInSrg]; - } - else - { - // If filter is not required, reset offsets and counts of filter in ESM data. - filterParameter.m_parameterOffset = 0; - filterParameter.m_parameterCount = 0; - } - } - } - - void SpotLightFeatureProcessor::UpdateShadowmapPositionsInAtlas() - { - if (m_spotLightShadowmapsPasses.empty()) - { - AZ_Error("SpotLightFeatureProcessor", false, "Cannot find a required pass."); - return; - } - - const ShadowmapAtlas& atlas = m_spotLightShadowmapsPasses.front()->GetShadowmapAtlas(); - for (auto& propIt : m_shadowProperties) - { - const uint16_t shadowIndex = propIt.second.m_shadowHandle.GetIndex(); - EsmShadowmapsPass::FilterParameter& esmData = m_esmParameterData.GetData(shadowIndex); - - // Set shadowmap size to ESM data. - const uint32_t shadowmapSize = m_shadowData.GetData(shadowIndex).m_shadowmapSize; - esmData.m_shadowmapSize = shadowmapSize; - - // Set shadowmap origin to ESM data. - const int32_t shadowIndexInSrg = m_spotLightData.GetData(propIt.first.GetIndex()).m_shadowIndex; - AZ_Assert(shadowIndexInSrg >= 0, "Shadow index required to be non-negative.") - const ShadowmapAtlas::Origin origin = atlas.GetOrigin(aznumeric_cast(shadowIndexInSrg)); - const AZStd::array originInSlice = origin.m_originInSlice; - esmData.m_shadowmapOriginInSlice = originInSlice; - } - } - - void SpotLightFeatureProcessor::SetFilterParameterToPass() - { - if (m_spotLightShadowmapsPasses.empty() || m_esmShadowmapsPasses.empty()) - { - AZ_Error("SpotLightFeatureProcessor", false, "Cannot find a required pass."); - return; - } - - // Create index table buffer. - const AZStd::string indexTableBufferName = - AZStd::string::format("IndexTableBuffer(Spot) %d", - m_shadowmapIndexTableBufferNameIndex++); - const ShadowmapAtlas& atlas = m_spotLightShadowmapsPasses.front()->GetShadowmapAtlas(); - const Data::Instance indexTableBuffer = atlas.CreateShadowmapIndexTableBuffer(indexTableBufferName); - - // Update ESM parameter buffer which is attached to - // both of Forward Pass and ESM Shadowmaps Pass. - m_esmParameterBufferHandler.UpdateBuffer(m_esmParameterData.GetDataVector()); - - // Set index table buffer and ESM parameter buffer to ESM pass. - for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) - { - esmPass->SetShadowmapIndexTableBuffer(indexTableBuffer); - esmPass->SetFilterParameterBuffer(m_esmParameterBufferHandler.GetBuffer()); - } - } - - bool SpotLightFeatureProcessor::NeedsFilterUpdate(LightHandle shadowHandle) const - { - const SpotLightShadowData& shadow = m_shadowData.GetData(shadowHandle.GetIndex()); - const bool useEsm = - (aznumeric_cast(shadow.m_shadowFilterMethod) == ShadowFilterMethod::Esm || - aznumeric_cast(shadow.m_shadowFilterMethod) == ShadowFilterMethod::EsmPcf); - return (aznumeric_cast(shadow.m_shadowmapSize) != ShadowmapSize::None) && useEsm; - } - - void SpotLightFeatureProcessor::UpdateBulbPositionOffset(SpotLightData& light) - { - // If we have the outer cone angle in radians, the offset is (radius * tan(pi/2 - coneRadians)). However - // light stores the cosine of outerConeRadians, making the equation (radius * tan(pi/2 - acosf(cosConeRadians)). - // This simplifies to the equation below. - float cosConeRadians = light.m_outerConeAngle; - light.m_bulbPostionOffset = light.m_bulbRadius * cosConeRadians / sqrt(1 - cosConeRadians * cosConeRadians); - } - } // namespace Render -} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightFeatureProcessor.h deleted file mode 100644 index fc48dde1a7..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/SpotLightFeatureProcessor.h +++ /dev/null @@ -1,158 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace AZ -{ - class Vector3; - class Color; - - namespace Render - { - struct SpotLightShadowData - { - Matrix4x4 m_depthBiasMatrix = Matrix4x4::CreateIdentity(); - uint32_t m_shadowmapArraySlice = 0; // array slice who has shadowmap in the atlas. - AZStd::array m_shadowmapOriginInSlice = { {0, 0 } }; // shadowmap origin in the slice of the atlas. - uint32_t m_shadowmapSize = static_cast(ShadowmapSize::None); // width and height of shadowmap. - uint32_t m_shadowFilterMethod = 0; // filtering method of shadows. - float m_boundaryScale = 0.f; // the half of boundary of lit/shadowed areas. (in degrees) - uint32_t m_predictionSampleCount = 0; // sample count to judge whether it is on the shadow boundary or not. - uint32_t m_filteringSampleCount = 0; - AZStd::array m_unprojectConstants = { {0, 0} }; - float m_bias = 0.0f; // Consider making this variable or the slope-scale depth bias be tuneable in the Editor - PcfMethod m_pcfMethod = PcfMethod::BoundarySearch; - }; - - class SpotLightFeatureProcessor final - : public SpotLightFeatureProcessorInterface - { - public: - AZ_RTTI(AZ::Render::SpotLightFeatureProcessor, "{8823AFBB-761E-42A2-B665-BBDF6F63E10A}", AZ::Render::SpotLightFeatureProcessorInterface); - - static void Reflect(AZ::ReflectContext* context); - - SpotLightFeatureProcessor() = default; - virtual ~SpotLightFeatureProcessor() = default; - - // FeatureProcessor overrides ... - void Activate() override; - void Deactivate() override; - void Simulate(const SimulatePacket& packet) override; - void PrepareViews(const PrepareViewsPacket&, AZStd::vector>&) override; - void Render(const RenderPacket& packet) override; - - // SpotLightFeatureProcessorInterface overrides ... - LightHandle AcquireLight() override; - bool ReleaseLight(LightHandle& handle) override; - LightHandle CloneLight(LightHandle handle) override; - void SetRgbIntensity(LightHandle handle, const PhotometricColor& lightColor) override; - void SetPosition(LightHandle handle, const Vector3& lightPosition) override; - void SetDirection(LightHandle handle, const Vector3& direction) override; - void SetBulbRadius(LightHandle handle, float bulbRadius) override; - void SetConeAngles(LightHandle handle, float innerDegrees, float outerDegrees) override; - void SetPenumbraBias(LightHandle handle, float penumbraBias) override; - void SetAttenuationRadius(LightHandle handle, float attenuationRadius) override; - void SetShadowmapSize(LightHandle lightId, ShadowmapSize shadowmapSize) override; - void SetShadowFilterMethod(LightHandle handle, ShadowFilterMethod method) override; - void SetShadowBoundaryWidthAngle(LightHandle handle, float boundaryWidthDegree) override; - void SetPredictionSampleCount(LightHandle handle, uint16_t count) override; - void SetFilteringSampleCount(LightHandle handle, uint16_t count) override; - void SetPcfMethod(LightHandle handle, PcfMethod method); - void SetSpotLightData(LightHandle handle, const SpotLightData& data) override; - - const Data::Instance GetLightBuffer() const; - uint32_t GetLightCount()const; - - private: - struct LightProperty - { - float m_outerConeAngle = 0.f; // in radians. - }; - struct ShadowProperty - { - LightHandle m_shadowHandle; - RPI::ViewPtr m_shadowmapView; - uint16_t m_viewTagIndex = SpotLightShadowmapsPass::InvalidIndex; - bool m_shadowmapViewNeedsUpdate = false; - }; - - SpotLightFeatureProcessor(const SpotLightFeatureProcessor&) = delete; - - // RPI::SceneNotificationBus::Handler overrides... - void OnRenderPipelinePassesChanged(RPI::RenderPipeline* renderPipeline) override; - void OnRenderPipelineAdded(RPI::RenderPipelinePtr pipeline) override; - void OnRenderPipelineRemoved(RPI::RenderPipeline* pipeline) override; - - uint16_t GetLightIndexInSrg(LightHandle handle) const; - - // shadow specific functions - ShadowProperty& GetOrCreateShadowProperty(LightHandle handle); - void PrepareForShadow(LightHandle handle, ShadowmapSize size); - void CleanUpShadow(LightHandle handle); - void UpdateShadowmapViews(); - void SetShadowParameterToShadowData(); - - void UpdateBulbPositionOffset(SpotLightData& light); - - // This caches SpotLightShadowmapsPass and EsmShadowmapsPass. - void CachePasses(); - AZStd::vector CacheSpotLightShadowmapsPass(); - void CacheEsmShadowmapsPass(const AZStd::vector& validPipelineIds); - - //! This updates the parameter of Gaussian filter used in ESM. - void UpdateFilterParameters(); - void UpdateStandardDeviations(); - void UpdateFilterOffsetsCounts(); - void UpdateShadowmapPositionsInAtlas(); - void SetFilterParameterToPass(); - bool NeedsFilterUpdate(LightHandle shadowHandle) const; - - AZStd::unordered_map m_shadowProperties; - IndexedDataVector m_lightProperties; - - AZStd::vector m_spotLightShadowmapsPasses; - AZStd::vector m_esmShadowmapsPasses; - - GpuBufferHandler m_lightBufferHandler; - IndexedDataVector m_spotLightData; - - GpuBufferHandler m_shadowBufferHandler; - IndexedDataVector m_shadowData; - - GpuBufferHandler m_esmParameterBufferHandler; - IndexedDataVector m_esmParameterData; - - bool m_deviceBufferNeedsUpdate = false; - bool m_shadowmapPassNeedsUpdate = true; - bool m_filterParameterNeedsUpdate = false; - uint32_t m_shadowmapIndexTableBufferNameIndex = 0; - - RHI::ShaderInputConstantIndex m_shadowmapAtlasSizeIndex; - RHI::ShaderInputConstantIndex m_invShadowmapAtlasSize; - - const Name m_lightTypeName = Name("spot"); - }; - } // namespace Render -} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.cpp index 87f7396fc4..7abc6698fa 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.cpp @@ -265,7 +265,7 @@ namespace AZ void DecalFeatureProcessor::SetDecalTransform(DecalHandle handle, const AZ::Transform& world) { // https://jira.agscollab.com/browse/ATOM-4330 - // Original Lumberyard uploads a 4x4 matrix rather than quaternion, rotation, scale. + // Original Open 3D Engine uploads a 4x4 matrix rather than quaternion, rotation, scale. // That is more memory but less calculation because it is doing a matrix inverse rather than a polar decomposition // I've done some experiments and uploading a 3x4 transform matrix with 3x3 matrix inverse should be possible // I am putting it as part of a separate Jira because I would have to upload different data to the light culling system diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGrid.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGrid.cpp index e96c119a5a..eeb32cdd07 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGrid.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGrid.cpp @@ -25,7 +25,7 @@ namespace AZ { DiffuseProbeGrid::~DiffuseProbeGrid() { - m_scene->GetCullingSystem()->UnregisterCullable(m_cullable); + m_scene->GetCullingScene()->UnregisterCullable(m_cullable); } void DiffuseProbeGrid::Init(RPI::Scene* scene, DiffuseProbeGridRenderData* renderData) @@ -646,7 +646,7 @@ namespace AZ m_cullable.m_cullData.m_visibilityEntry.m_typeFlags = AzFramework::VisibilityEntry::TYPE_RPI_Cullable; // register with culling system - m_scene->GetCullingSystem()->RegisterOrUpdateCullable(m_cullable); + m_scene->GetCullingScene()->RegisterOrUpdateCullable(m_cullable); } } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp index 694a8be9dd..95bbe13586 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp @@ -473,7 +473,7 @@ namespace AZ void MeshDataInstance::DeInit() { - m_scene->GetCullingSystem()->UnregisterCullable(m_cullable); + m_scene->GetCullingScene()->UnregisterCullable(m_cullable); // remove from ray tracing RayTracingFeatureProcessor* rayTracingFeatureProcessor = m_scene->GetFeatureProcessor(); @@ -851,7 +851,7 @@ namespace AZ m_cullable.m_cullData.m_visibilityEntry.m_boundingVolume = localAabb.GetTransformedAabb(localToWorld); m_cullable.m_cullData.m_visibilityEntry.m_userData = &m_cullable; m_cullable.m_cullData.m_visibilityEntry.m_typeFlags = AzFramework::VisibilityEntry::TYPE_RPI_Cullable; - m_scene->GetCullingSystem()->RegisterOrUpdateCullable(m_cullable); + m_scene->GetCullingScene()->RegisterOrUpdateCullable(m_cullable); m_cullBoundsNeedsUpdate = false; } diff --git a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp index d01eb1e8a4..d7bbc315ed 100644 --- a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp @@ -55,17 +55,29 @@ namespace AZ return false; } - // Get the shader variant and instance SRG - const RPI::ShaderVariant& shaderVariant = m_morphTargetShader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId); + AZ::RPI::ShaderOptionGroup shaderOptionGroup = m_morphTargetShader->CreateShaderOptionGroup(); + // In case there are several options you don't care about, it's good practice to initialize them with default values. + shaderOptionGroup.SetUnspecifiedToDefaultValues(); + shaderOptionGroup.SetValue(AZ::Name("o_hasColorDeltas"), RPI::ShaderOptionValue{ m_morphTargetMetaData.m_hasColorDeltas }); - RHI::PipelineStateDescriptorForDispatch pipelineStateDescriptor; - shaderVariant.ConfigurePipelineState(pipelineStateDescriptor); + // Get the shader variant and instance SRG + RPI::ShaderReloadNotificationBus::Handler::BusConnect(m_morphTargetShader->GetAssetId()); + const RPI::ShaderVariant& shaderVariant = m_morphTargetShader->GetVariant(shaderOptionGroup.GetShaderVariantId()); if (!InitPerInstanceSRG()) { return false; } + if (!shaderVariant.IsFullyBaked() && m_instanceSrg->HasShaderVariantKeyFallbackEntry()) + { + m_instanceSrg->SetShaderVariantKeyFallbackValue(shaderOptionGroup.GetShaderVariantKeyFallbackValue()); + } + + RHI::PipelineStateDescriptorForDispatch pipelineStateDescriptor; + shaderVariant.ConfigurePipelineState(pipelineStateDescriptor); + + InitRootConstants(pipelineStateDescriptor.m_pipelineLayoutDescriptor->GetRootConstantsLayout()); m_dispatchItem.m_pipelineState = m_morphTargetShader->AcquirePipelineState(pipelineStateDescriptor); @@ -130,6 +142,9 @@ namespace AZ AZ_Error("MorphTargetDispatchItem", tangentOffsetIndex.IsValid(), "Could not find root constant 's_targetTangentOffset' in the shader"); auto bitangentOffsetIndex = rootConstantsLayout->FindShaderInputIndex(AZ::Name{ "s_targetBitangentOffset" }); AZ_Error("MorphTargetDispatchItem", bitangentOffsetIndex.IsValid(), "Could not find root constant 's_targetBitangentOffset' in the shader"); + auto colorOffsetIndex = rootConstantsLayout->FindShaderInputIndex(AZ::Name{ "s_targetColorOffset" }); + AZ_Error("MorphTargetDispatchItem", colorOffsetIndex.IsValid(), "Could not find root constant 's_targetColorOffset' in the shader"); + auto minIndex = rootConstantsLayout->FindShaderInputIndex(AZ::Name{ "s_min" }); AZ_Error("MorphTargetDispatchItem", minIndex.IsValid(), "Could not find root constant 's_min' in the shader"); auto maxIndex = rootConstantsLayout->FindShaderInputIndex(AZ::Name{ "s_max" }); @@ -151,6 +166,11 @@ namespace AZ m_rootConstantData.SetConstant(tangentOffsetIndex, m_morphInstanceMetaData.m_accumulatedTangentDeltaOffsetInBytes / 4); m_rootConstantData.SetConstant(bitangentOffsetIndex, m_morphInstanceMetaData.m_accumulatedBitangentDeltaOffsetInBytes / 4); + if (m_morphTargetMetaData.m_hasColorDeltas) + { + m_rootConstantData.SetConstant(colorOffsetIndex, m_morphInstanceMetaData.m_accumulatedColorDeltaOffsetInBytes / 4); + } + m_dispatchItem.m_rootConstantSize = m_rootConstantData.GetConstantData().size(); m_dispatchItem.m_rootConstants = m_rootConstantData.GetConstantData().data(); } @@ -179,6 +199,22 @@ namespace AZ } } + void MorphTargetDispatchItem::OnShaderAssetReinitialized([[maybe_unused]] const Data::Asset& shaderAsset) + { + if (!Init()) + { + AZ_Error("MorphTargetDispatchItem", false, "Failed to re-initialize after the shader asset was re-loaded."); + } + } + + void MorphTargetDispatchItem::OnShaderVariantReinitialized([[maybe_unused]] const RPI::Shader& shader, [[maybe_unused]] const RPI::ShaderVariantId& shaderVariantId, [[maybe_unused]] RPI::ShaderVariantStableId shaderVariantStableId) + { + if (!Init()) + { + AZ_Error("MorphTargetDispatchItem", false, "Failed to re-initialize after the shader variant was loaded."); + } + } + float ComputeMorphTargetIntegerEncoding(const AZStd::vector& morphTargetMetaDatas) { // The accumulation buffer must be stored as an int to support InterlockedAdd in AZSL diff --git a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.h b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.h index c12de5ec9a..46680eb465 100644 --- a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.h +++ b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.h @@ -72,6 +72,8 @@ namespace AZ // ShaderInstanceNotificationBus::Handler overrides void OnShaderReinitialized(const RPI::Shader& shader) override; + void OnShaderAssetReinitialized(const Data::Asset& shaderAsset) override; + void OnShaderVariantReinitialized(const RPI::Shader& shader, const RPI::ShaderVariantId& shaderVariantId, RPI::ShaderVariantStableId shaderVariantStableId) override; RHI::DispatchItem m_dispatchItem; diff --git a/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp index 68de2b87bb..6e95944dab 100644 --- a/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -195,14 +194,6 @@ namespace AZ constantIndex = srgLayout->FindShaderInputConstantIndex(AZ::Name("m_directionalLightCount")); m_rayTracingSceneSrg->SetConstant(constantIndex, directionalLightFP->GetLightCount()); - // spot lights - const auto spotLightFP = GetParentScene()->GetFeatureProcessor(); - bufferIndex = srgLayout->FindShaderInputBufferIndex(AZ::Name("m_spotLights")); - m_rayTracingSceneSrg->SetBufferView(bufferIndex, spotLightFP->GetLightBuffer()->GetBufferView()); - - constantIndex = srgLayout->FindShaderInputConstantIndex(AZ::Name("m_spotLightCount")); - m_rayTracingSceneSrg->SetConstant(constantIndex, spotLightFP->GetLightCount()); - // point lights const auto pointLightFP = GetParentScene()->GetFeatureProcessor(); bufferIndex = srgLayout->FindShaderInputBufferIndex(AZ::Name("m_pointLights")); diff --git a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp index 51303436ee..86c012731c 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp @@ -31,7 +31,7 @@ namespace AZ ReflectionProbe::~ReflectionProbe() { Data::AssetBus::MultiHandler::BusDisconnect(); - m_scene->GetCullingSystem()->UnregisterCullable(m_cullable); + m_scene->GetCullingScene()->UnregisterCullable(m_cullable); m_meshFeatureProcessor->ReleaseMesh(m_visualizationMeshHandle); } @@ -363,7 +363,7 @@ namespace AZ m_cullable.m_cullData.m_visibilityEntry.m_typeFlags = AzFramework::VisibilityEntry::TYPE_RPI_Cullable; // register with culling system - m_scene->GetCullingSystem()->RegisterOrUpdateCullable(m_cullable); + m_scene->GetCullingScene()->RegisterOrUpdateCullable(m_cullable); } } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.cpp new file mode 100644 index 0000000000..216a126953 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.cpp @@ -0,0 +1,632 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace AZ::Render +{ + void ProjectedShadowFeatureProcessor::Reflect(ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext + ->Class() + ->Version(0); + } + } + + void ProjectedShadowFeatureProcessor::Activate() + { + const RHI::ShaderResourceGroupLayout* viewSrgLayout = RPI::RPISystemInterface::Get()->GetViewSrgAsset()->GetLayout(); + + GpuBufferHandler::Descriptor desc; + + desc.m_bufferName = "ProjectedShadowBuffer"; + desc.m_bufferSrgName = "m_projectedShadows"; + desc.m_elementCountSrgName = ""; + desc.m_elementSize = sizeof(ShadowData); + desc.m_srgLayout = viewSrgLayout; + + m_shadowBufferHandler = GpuBufferHandler(desc); + + desc.m_bufferName = "ProjectedFilterParamsBuffer"; + desc.m_bufferSrgName = "m_projectedFilterParams"; + desc.m_elementCountSrgName = ""; + desc.m_elementSize = sizeof(EsmShadowmapsPass::FilterParameter); + desc.m_srgLayout = viewSrgLayout; + + m_filterParamBufferHandler = GpuBufferHandler(desc); + + m_shadowmapAtlasSizeIndex = viewSrgLayout->FindShaderInputConstantIndex(Name("m_shadowmapAtlasSize")); + m_invShadowmapAtlasSizeIndex = viewSrgLayout->FindShaderInputConstantIndex(Name("m_invShadowmapAtlasSize")); + + CachePasses(); + EnableSceneNotification(); + } + + void ProjectedShadowFeatureProcessor::Deactivate() + { + DisableSceneNotification(); + + m_shadowData.Clear(); + m_shadowBufferHandler.Release(); + m_filterParamBufferHandler.Release(); + + m_shadowProperties.Clear(); + + m_projectedShadowmapsPasses.clear(); + m_esmShadowmapsPasses.clear(); + + for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) + { + esmPass->SetEnabledComputation(false); + } + } + + + ProjectedShadowFeatureProcessor::ShadowId ProjectedShadowFeatureProcessor::AcquireShadow() + { + // Reserve a new slot in m_shadowData + size_t index = m_shadowData.Reserve(); + if (index >= std::numeric_limits::max()) + { + m_shadowData.Release(index); + return ShadowId::Null; + } + + ShadowId id = ShadowId(aznumeric_cast(index)); + InitializeShadow(id); + + return id; + } + + void ProjectedShadowFeatureProcessor::ReleaseShadow(ShadowId id) + { + if (id.IsValid()) + { + m_shadowProperties.RemoveIndex(m_shadowData.GetElement(id.GetIndex())); + m_shadowData.Release(id.GetIndex()); + } + + m_shadowmapPassNeedsUpdate = true; + } + + void ProjectedShadowFeatureProcessor::SetShadowTransform(ShadowId id, Transform transform) + { + ShadowProperty& shadowProperty = GetShadowPropertyFromShadowId(id); + shadowProperty.m_desc.m_transform = transform; + UpdateShadowView(shadowProperty); + } + + void ProjectedShadowFeatureProcessor::SetNearFarPlanes(ShadowId id, float nearPlaneDistance, float farPlaneDistance) + { + AZ_Assert(id.IsValid(), "Invalid ShadowId passed to ProjectedShadowFeatureProcessor::SetFrontBackPlanes()."); + + ShadowProperty& shadowProperty = GetShadowPropertyFromShadowId(id); + shadowProperty.m_desc.m_nearPlaneDistance = GetMax(nearPlaneDistance, 0.0001f); + shadowProperty.m_desc.m_farPlaneDistance = GetMax(farPlaneDistance, nearPlaneDistance + 0.0001f); + UpdateShadowView(shadowProperty); + } + + void ProjectedShadowFeatureProcessor::SetAspectRatio(ShadowId id, float aspectRatio) + { + AZ_Assert(id.IsValid(), "Invalid ShadowId passed to ProjectedShadowFeatureProcessor::SetAspectRatio()."); + + ShadowProperty& shadowProperty = GetShadowPropertyFromShadowId(id); + shadowProperty.m_desc.m_aspectRatio = aspectRatio; + UpdateShadowView(shadowProperty); + } + + void ProjectedShadowFeatureProcessor::SetFieldOfViewY(ShadowId id, float fieldOfViewYRadians) + { + AZ_Assert(id.IsValid(), "Invalid ShadowId passed to ProjectedShadowFeatureProcessor::SetFieldOfViewY()."); + + ShadowProperty& shadowProperty = GetShadowPropertyFromShadowId(id); + shadowProperty.m_desc.m_fieldOfViewYRadians = fieldOfViewYRadians; + UpdateShadowView(shadowProperty); + } + + void ProjectedShadowFeatureProcessor::SetShadowmapMaxResolution(ShadowId id, ShadowmapSize size) + { + AZ_Assert(id.IsValid(), "Invalid ShadowId passed to ProjectedShadowFeatureProcessor::SetShadowmapMaxResolution()."); + AZ_Assert(size != ShadowmapSize::None, "Shadowmap size cannot be set to None, remove the shadow instead."); + + FilterParameter& esmData = m_shadowData.GetElement(id.GetIndex()); + esmData.m_shadowmapSize = aznumeric_cast(size); + + m_deviceBufferNeedsUpdate = true; + m_shadowmapPassNeedsUpdate = true; + m_filterParameterNeedsUpdate = true; + } + + void ProjectedShadowFeatureProcessor::SetPcfMethod(ShadowId id, PcfMethod method) + { + ShadowData& shadowData = m_shadowData.GetElement(id.GetIndex()); + shadowData.m_pcfMethod = method; + + m_deviceBufferNeedsUpdate = true; + } + + void ProjectedShadowFeatureProcessor::SetShadowFilterMethod(ShadowId id, ShadowFilterMethod method) + { + AZ_Assert(id.IsValid(), "Invalid ShadowId passed to ProjectedShadowFeatureProcessor::SetShadowFilterMethod()."); + + ShadowProperty& shadowProperty = GetShadowPropertyFromShadowId(id); + ShadowData& shadowData = m_shadowData.GetElement(id.GetIndex()); + shadowData.m_shadowFilterMethod = aznumeric_cast(method); + + UpdateShadowView(shadowProperty); + + m_shadowmapPassNeedsUpdate = true; + m_filterParameterNeedsUpdate = true; + } + + void ProjectedShadowFeatureProcessor::SetSofteningBoundaryWidthAngle(ShadowId id, float boundaryWidthRadians) + { + AZ_Assert(id.IsValid(), "Invalid ShadowId passed to ProjectedShadowFeatureProcessor::SetShadowBoundaryWidthAngle()."); + + ShadowData& shadowData = m_shadowData.GetElement(id.GetIndex()); + shadowData.m_boundaryScale = boundaryWidthRadians / 2.0f; + + m_shadowmapPassNeedsUpdate = true; + m_filterParameterNeedsUpdate = true; + } + + void ProjectedShadowFeatureProcessor::SetPredictionSampleCount(ShadowId id, uint16_t count) + { + AZ_Assert(id.IsValid(), "Invalid ShadowId passed to ProjectedShadowFeatureProcessor::SetPredictionSampleCount()."); + + AZ_Warning("ProjectedShadowFeatureProcessor", count <= Shadow::MaxPcfSamplingCount, "Sampling count exceed the limit."); + count = GetMin(count, Shadow::MaxPcfSamplingCount); + + ShadowData& shadowData = m_shadowData.GetElement(id.GetIndex()); + shadowData.m_predictionSampleCount = count; + + m_deviceBufferNeedsUpdate = true; + } + + void ProjectedShadowFeatureProcessor::SetFilteringSampleCount(ShadowId id, uint16_t count) + { + AZ_Assert(id.IsValid(), "Invalid ShadowId passed to ProjectedShadowFeatureProcessor::SetFilteringSampleCount()."); + + AZ_Warning("ProjectedShadowFeatureProcessor", count <= Shadow::MaxPcfSamplingCount, "Sampling count exceed the limit."); + count = GetMin(count, Shadow::MaxPcfSamplingCount); + + ShadowData& shadowData = m_shadowData.GetElement(id.GetIndex()); + shadowData.m_filteringSampleCount = count; + + m_deviceBufferNeedsUpdate = true; + } + + void ProjectedShadowFeatureProcessor::SetShadowProperties(ShadowId id, const ProjectedShadowDescriptor& descriptor) + { + AZ_Assert(id.IsValid(), "Invalid ShadowId passed to ProjectedShadowFeatureProcessor::SetShadowProperties()."); + ShadowProperty& shadowProperty = GetShadowPropertyFromShadowId(id); + shadowProperty.m_desc = descriptor; + UpdateShadowView(shadowProperty); + m_shadowmapPassNeedsUpdate = true; + m_filterParameterNeedsUpdate = true; + } + + auto ProjectedShadowFeatureProcessor::GetShadowProperties(ShadowId id) -> const ProjectedShadowDescriptor& + { + AZ_Assert(id.IsValid(), "Invalid ShadowId passed to ProjectedShadowFeatureProcessor::GetShadowProperties()."); + return GetShadowPropertyFromShadowId(id).m_desc; + } + + void ProjectedShadowFeatureProcessor::UpdateShadowView(ShadowProperty& shadowProperty) + { + const ProjectedShadowDescriptor& desc = shadowProperty.m_desc; + float nearDist = desc.m_nearPlaneDistance; + float farDist = desc.m_farPlaneDistance; + + // Adjust the near plane if it's too close to ensure accuracy. + constexpr float NearFarRatio = 1000.0f; + const float minDist = desc.m_farPlaneDistance / NearFarRatio; + nearDist = GetMax(minDist, nearDist); + + Matrix4x4 viewToClipMatrix; + MakePerspectiveFovMatrixRH( + viewToClipMatrix, + GetMax(desc.m_fieldOfViewYRadians, MinimumFieldOfView), + desc.m_aspectRatio, + nearDist, + farDist); + + RPI::ViewPtr view = shadowProperty.m_shadowmapView; + view->SetViewToClipMatrix(viewToClipMatrix); + view->SetCameraTransform(Matrix3x4::CreateFromTransform(desc.m_transform)); + + ShadowData& shadowData = m_shadowData.GetElement(shadowProperty.m_shadowId.GetIndex()); + shadowData.m_bias = (nearDist / farDist) * 0.1f; + + FilterParameter& esmData = m_shadowData.GetElement(shadowProperty.m_shadowId.GetIndex()); + if (FilterMethodIsEsm(shadowData)) + { + // Set parameters to calculate linear depth if ESM is used. + m_filterParameterNeedsUpdate = true; + esmData.m_isEnabled = true; + esmData.m_n_f_n = nearDist / (farDist - nearDist); + esmData.m_n_f = nearDist - farDist; + esmData.m_f = farDist; + } + else + { + // Reset enabling flag if ESM is not used. + esmData.m_isEnabled = false; + } + + for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) + { + esmPass->SetEnabledComputation(esmData.m_isEnabled); + } + + // Set depth bias matrix. + const Matrix4x4& worldToLightClipMatrix = view->GetWorldToClipMatrix(); + const Matrix4x4 depthBiasMatrix = Shadow::GetClipToShadowmapTextureMatrix() * worldToLightClipMatrix; + shadowData.m_depthBiasMatrix = depthBiasMatrix; + + shadowData.m_unprojectConstants[0] = view->GetViewToClipMatrix().GetRow(2).GetElement(2); + shadowData.m_unprojectConstants[1] = view->GetViewToClipMatrix().GetRow(2).GetElement(3); + + m_deviceBufferNeedsUpdate = true; + } + + void ProjectedShadowFeatureProcessor::InitializeShadow(ShadowId shadowId) + { + m_deviceBufferNeedsUpdate = true; + m_shadowmapPassNeedsUpdate = true; + + // Reserve a slot in m_shadowProperties, and store that index in m_shadowData's second vector + uint16_t shadowPropertyIndex = m_shadowProperties.GetFreeSlotIndex(); + m_shadowData.GetElement(shadowId.GetIndex()) = shadowPropertyIndex; + + ShadowProperty& shadowProperty = m_shadowProperties.GetData(shadowPropertyIndex); + shadowProperty.m_shadowId = shadowId; + + AZ::Name viewName(AZStd::string::format("ProjectedShadowView (shadowId:%d)", shadowId.GetIndex())); + shadowProperty.m_shadowmapView = RPI::View::CreateView(viewName, RPI::View::UsageShadow); + + UpdateShadowView(shadowProperty); + } + + void ProjectedShadowFeatureProcessor::OnRenderPipelinePassesChanged(RPI::RenderPipeline* /*renderPipeline*/) + { + CachePasses(); + } + + void ProjectedShadowFeatureProcessor::OnRenderPipelineAdded(RPI::RenderPipelinePtr /*renderPipeline*/) + { + CachePasses(); + } + + void ProjectedShadowFeatureProcessor::OnRenderPipelineRemoved( RPI::RenderPipeline* /*renderPipeline*/) + { + CachePasses(); + } + + void ProjectedShadowFeatureProcessor::CachePasses() + { + const AZStd::vector validPipelineIds = CacheProjectedShadowmapsPass(); + CacheEsmShadowmapsPass(validPipelineIds); + m_shadowmapPassNeedsUpdate = true; + } + + AZStd::vector ProjectedShadowFeatureProcessor::CacheProjectedShadowmapsPass() + { + const AZStd::vector& renderPipelines = GetParentScene()->GetRenderPipelines(); + const auto* passSystem = RPI::PassSystemInterface::Get();; + const AZStd::vector& passes = passSystem->GetPassesForTemplateName(Name("ProjectedShadowmapsTemplate")); + + AZStd::vector validPipelineIds; + m_projectedShadowmapsPasses.clear(); + for (RPI::Pass* pass : passes) + { + ProjectedShadowmapsPass* shadowPass = static_cast(pass); + for (const RPI::RenderPipelinePtr& pipeline : renderPipelines) + { + if (pipeline.get() == shadowPass->GetRenderPipeline()) + { + m_projectedShadowmapsPasses.emplace_back(shadowPass); + validPipelineIds.push_back(shadowPass->GetRenderPipeline()->GetId()); + } + } + } + return validPipelineIds; + } + + void ProjectedShadowFeatureProcessor::CacheEsmShadowmapsPass(const AZStd::vector& validPipelineIds) + { + static const Name LightTypeName = Name("projected"); + + const auto* passSystem = RPI::PassSystemInterface::Get(); + const AZStd::vector passes = passSystem->GetPassesForTemplateName(Name("EsmShadowmapsTemplate")); + + m_esmShadowmapsPasses.clear(); + for (RPI::Pass* pass : passes) + { + EsmShadowmapsPass* esmPass = static_cast(pass); + if (esmPass->GetRenderPipeline() && + AZStd::find(validPipelineIds.begin(), validPipelineIds.end(), esmPass->GetRenderPipeline()->GetId()) != validPipelineIds.end() && + esmPass->GetLightTypeName() == LightTypeName) + { + m_esmShadowmapsPasses.emplace_back(esmPass); + } + } + } + + void ProjectedShadowFeatureProcessor::UpdateFilterParameters() + { + if (m_filterParameterNeedsUpdate) + { + UpdateStandardDeviations(); + UpdateFilterOffsetsCounts(); + SetFilterParameterToPass(); + m_filterParameterNeedsUpdate = false; + } + } + + void ProjectedShadowFeatureProcessor::UpdateStandardDeviations() + { + if (m_esmShadowmapsPasses.empty()) + { + AZ_Error("ProjectedShadowFeatureProcessor", false, "Cannot find a required pass."); + return; + } + + AZStd::vector standardDeviations(m_shadowProperties.GetDataCount()); + + for (uint32_t i = 0; i < m_shadowProperties.GetDataCount(); ++i) + { + ShadowProperty& shadowProperty = m_shadowProperties.GetDataVector().at(i); + const ShadowData& shadow = m_shadowData.GetElement(shadowProperty.m_shadowId.GetIndex()); + if (!FilterMethodIsEsm(shadow)) + { + continue; + } + const FilterParameter& filter = m_shadowData.GetElement(shadowProperty.m_shadowId.GetIndex()); + const float boundaryWidthAngle = shadow.m_boundaryScale * 2.0f; + constexpr float SmallAngle = 0.01f; + const float fieldOfView = GetMax(shadowProperty.m_desc.m_fieldOfViewYRadians, MinimumFieldOfView); + const float ratioToEntireWidth = boundaryWidthAngle / fieldOfView; + const float widthInPixels = ratioToEntireWidth * filter.m_shadowmapSize; + standardDeviations.at(i) = widthInPixels / (2.0f * GaussianMathFilter::ReliableSectionFactor); + } + if (standardDeviations.empty()) + { + for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) + { + esmPass->SetEnabledComputation(false); + } + return; + } + for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) + { + esmPass->SetEnabledComputation(true); + esmPass->SetFilterParameters(standardDeviations); + } + } + + void ProjectedShadowFeatureProcessor::UpdateFilterOffsetsCounts() + { + if (m_esmShadowmapsPasses.empty()) + { + AZ_Error("ProjectedShadowFeatureProcessor", false, "Cannot find a required pass."); + return; + } + + // Get array of filter counts for the camera view. + const AZStd::array_view filterCounts = m_esmShadowmapsPasses.front()->GetFilterCounts(); + + // Create array of filter offsets. + AZStd::vector filterOffsets; + filterOffsets.reserve(filterCounts.size()); + uint32_t filterOffset = 0; + for (const uint32_t count : filterCounts) + { + filterOffsets.push_back(filterOffset); + filterOffset += count; + } + + auto& shadowProperties = m_shadowProperties.GetDataVector(); + for (uint32_t i = 0; i < shadowProperties.size(); ++i) + { + ShadowProperty& shadowProperty = shadowProperties.at(i); + const ShadowId shadowId = shadowProperty.m_shadowId; + ShadowData& shadowData = m_shadowData.GetElement(shadowId.GetIndex()); + FilterParameter& filterData = m_shadowData.GetElement(shadowId.GetIndex()); + + if (FilterMethodIsEsm(shadowData)) + { + filterData.m_parameterOffset = filterOffsets[i]; + filterData.m_parameterCount = filterCounts[i]; + } + else + { + // If filter is not required, reset offsets and counts of filter in ESM data. + filterData.m_parameterOffset = 0; + filterData.m_parameterCount = 0; + } + } + } + + void ProjectedShadowFeatureProcessor::SetFilterParameterToPass() + { + static uint32_t nameIndex = 0; + if (m_projectedShadowmapsPasses.empty() || m_esmShadowmapsPasses.empty()) + { + AZ_Error("ProjectedShadowFeatureProcessor", false, "Cannot find a required pass."); + return; + } + + // Create index table buffer. + // [GFX TODO ATOM-14851] Should not be creating a new buffer here, just map the data or orphan with new data. + const AZStd::string indexTableBufferName = AZStd::string::format("IndexTableBuffer(Projected) %d", nameIndex++); + const ShadowmapAtlas& atlas = m_projectedShadowmapsPasses.front()->GetShadowmapAtlas(); + const Data::Instance indexTableBuffer = atlas.CreateShadowmapIndexTableBuffer(indexTableBufferName); + + m_filterParamBufferHandler.UpdateBuffer(m_shadowData.GetRawData(), m_shadowData.GetSize()); + + // Set index table buffer and ESM parameter buffer to ESM pass. + for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) + { + esmPass->SetShadowmapIndexTableBuffer(indexTableBuffer); + esmPass->SetFilterParameterBuffer(m_filterParamBufferHandler.GetBuffer()); + } + } + + void ProjectedShadowFeatureProcessor::Simulate(const FeatureProcessor::SimulatePacket& /*packet*/) + { + AZ_ATOM_PROFILE_FUNCTION("RPI", "ProjectedShadowFeatureProcessor: Simulate"); + + if (m_shadowmapPassNeedsUpdate) + { + // Rebuild the shadow map sizes + AZStd::vector shadowmapSizes; + shadowmapSizes.reserve(m_shadowProperties.GetDataCount()); + + auto& shadowProperties = m_shadowProperties.GetDataVector(); + for (uint32_t i = 0; i < shadowProperties.size(); ++i) + { + ShadowProperty& shadowProperty = shadowProperties.at(i); + uint16_t shadowIndex = shadowProperty.m_shadowId.GetIndex(); + FilterParameter& filterData = m_shadowData.GetElement(shadowIndex); + + shadowmapSizes.push_back(); + ProjectedShadowmapsPass::ShadowmapSizeWithIndices& sizeWithIndices = shadowmapSizes.back(); + sizeWithIndices.m_size = static_cast(filterData.m_shadowmapSize); + sizeWithIndices.m_shadowIndexInSrg = shadowIndex; + } + + for (ProjectedShadowmapsPass* shadowPass : m_projectedShadowmapsPasses) + { + shadowPass->UpdateShadowmapSizes(shadowmapSizes); + } + + for (EsmShadowmapsPass* esmPass : m_esmShadowmapsPasses) + { + esmPass->QueueForBuildAttachments(); + } + + for (ProjectedShadowmapsPass* shadowPass : m_projectedShadowmapsPasses) + { + for (const auto& shadowProperty : shadowProperties) + { + const int16_t shadowIndexInSrg = shadowProperty.m_shadowId.GetIndex(); + ShadowData& shadowData = m_shadowData.GetElement(shadowIndexInSrg); + FilterParameter& filterData = m_shadowData.GetElement(shadowIndexInSrg); + const ShadowmapAtlas::Origin origin = shadowPass->GetOriginInAtlas(shadowIndexInSrg); + + shadowData.m_shadowmapArraySlice = origin.m_arraySlice; + filterData.m_shadowmapOriginInSlice = origin.m_originInSlice; + m_deviceBufferNeedsUpdate = true; + } + break; + } + + m_shadowmapPassNeedsUpdate = false; + } + + // This has to be called after UpdateShadowmapSizes(). + UpdateFilterParameters(); + + if (m_deviceBufferNeedsUpdate) + { + m_shadowBufferHandler.UpdateBuffer(m_shadowData.GetRawData(), m_shadowData.GetSize()); + m_deviceBufferNeedsUpdate = false; + } + } + + void ProjectedShadowFeatureProcessor::PrepareViews(const PrepareViewsPacket&, AZStd::vector>& outViews) + { + for (ProjectedShadowmapsPass* pass : m_projectedShadowmapsPasses) + { + RPI::RenderPipeline* renderPipeline = pass->GetRenderPipeline(); + if (renderPipeline) + { + auto& shadowProperties = m_shadowProperties.GetDataVector(); + for (uint32_t i = 0; i < shadowProperties.size(); ++i) + { + ShadowProperty& shadowProperty = shadowProperties.at(i); + uint16_t shadowIndex = shadowProperty.m_shadowId.GetIndex(); + const FilterParameter& filterData = m_shadowData.GetElement(shadowIndex); + if (filterData.m_shadowmapSize == aznumeric_cast(ShadowmapSize::None)) + { + continue; + } + + const RPI::PipelineViewTag& viewTag = pass->GetPipelineViewTagOfChild(i); + const RHI::DrawListMask drawListMask = renderPipeline->GetDrawListMask(viewTag); + if (shadowProperty.m_shadowmapView->GetDrawListMask() != drawListMask) + { + shadowProperty.m_shadowmapView->Reset(); + shadowProperty.m_shadowmapView->SetDrawListMask(drawListMask); + } + + outViews.emplace_back(AZStd::make_pair(viewTag, shadowProperty.m_shadowmapView)); + } + } + break; + } + } + + void ProjectedShadowFeatureProcessor::Render(const ProjectedShadowFeatureProcessor::RenderPacket& packet) + { + AZ_ATOM_PROFILE_FUNCTION("RPI", "ProjectedShadowFeatureProcessor: Render"); + + for (const ProjectedShadowmapsPass* pass : m_projectedShadowmapsPasses) + { + for (const RPI::ViewPtr& view : packet.m_views) + { + if (view->GetUsageFlags() & RPI::View::UsageFlags::UsageCamera) + { + RPI::ShaderResourceGroup* srg = view->GetShaderResourceGroup().get(); + + srg->SetConstant(m_shadowmapAtlasSizeIndex, static_cast(pass->GetShadowmapAtlasSize())); + const float invShadowmapSize = 1.0f / static_cast(pass->GetShadowmapAtlasSize()); + srg->SetConstant(m_invShadowmapAtlasSizeIndex, invShadowmapSize); + + m_shadowBufferHandler.UpdateSrg(srg); + m_filterParamBufferHandler.UpdateSrg(srg); + } + } + break; + } + } + + bool ProjectedShadowFeatureProcessor::FilterMethodIsEsm(const ShadowData& shadowData) const + { + return + aznumeric_cast(shadowData.m_shadowFilterMethod) == ShadowFilterMethod::Esm || + aznumeric_cast(shadowData.m_shadowFilterMethod) == ShadowFilterMethod::EsmPcf; + } + + auto ProjectedShadowFeatureProcessor::GetShadowPropertyFromShadowId(ShadowId id) -> ShadowProperty& + { + AZ_Assert(id.IsValid(), "Error: Invalid ShadowId"); + uint16_t shadowPropertyId = m_shadowData.GetElement(id.GetIndex()); + return m_shadowProperties.GetData(shadowPropertyId); + } + +} diff --git a/Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.h new file mode 100644 index 0000000000..a131c914f2 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/Shadows/ProjectedShadowFeatureProcessor.h @@ -0,0 +1,141 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace AZ::Render +{ + //! This feature processor handles creation of shadow passes and manages shadow related data. Use AcquireShadow() + //! to create a new shadow. The ID that is returned from AcquireShadow() corresponds to an index in the + //! m_projectedShadows and m_projectedFilterParams buffers in the View SRG. + class ProjectedShadowFeatureProcessor final + : public ProjectedShadowFeatureProcessorInterface + { + public: + + AZ_RTTI(AZ::Render::ProjectedShadowFeatureProcessor, "{02AFA06D-8B37-4D47-91BD-849CAC7FB330}", AZ::Render::ProjectedShadowFeatureProcessorInterface); + + static void Reflect(AZ::ReflectContext* context); + + ProjectedShadowFeatureProcessor() = default; + virtual ~ProjectedShadowFeatureProcessor() = default; + + // FeatureProcessor overrides ... + void Activate() override; + void Deactivate() override; + void Simulate(const SimulatePacket& packet) override; + void PrepareViews(const PrepareViewsPacket&, AZStd::vector>&) override; + void Render(const RenderPacket& packet) override; + + // ProjectedShadowFeatureProcessorInterface overrides ... + ShadowId AcquireShadow() override; + void ReleaseShadow(ShadowId id) override; + void SetShadowTransform(ShadowId id, Transform transform) override; + void SetNearFarPlanes(ShadowId id, float nearPlaneDistance, float farPlaneDistance) override; + void SetAspectRatio(ShadowId id, float aspectRatio) override; + void SetFieldOfViewY(ShadowId id, float fieldOfViewYRadians) override; + void SetShadowmapMaxResolution(ShadowId id, ShadowmapSize size) override; + void SetPcfMethod(ShadowId id, PcfMethod method); + void SetShadowFilterMethod(ShadowId id, ShadowFilterMethod method) override; + void SetSofteningBoundaryWidthAngle(ShadowId id, float boundaryWidthRadians) override; + void SetPredictionSampleCount(ShadowId id, uint16_t count) override; + void SetFilteringSampleCount(ShadowId id, uint16_t count) override; + void SetShadowProperties(ShadowId id, const ProjectedShadowDescriptor& descriptor) override; + const ProjectedShadowDescriptor& GetShadowProperties(ShadowId id) override; + + private: + + // GPU data stored in m_projectedShadows. + struct ShadowData + { + Matrix4x4 m_depthBiasMatrix = Matrix4x4::CreateIdentity(); + uint32_t m_shadowmapArraySlice = 0; // array slice who has shadowmap in the atlas. + uint16_t m_shadowFilterMethod = 0; // filtering method of shadows. + PcfMethod m_pcfMethod = PcfMethod::BoundarySearch; // method for performing Pcf (uint16_t) + float m_boundaryScale = 0.f; // the half of boundary of lit/shadowed areas. (in degrees) + uint32_t m_predictionSampleCount = 0; // sample count to judge whether it is on the shadow boundary or not. + uint32_t m_filteringSampleCount = 0; + AZStd::array m_unprojectConstants = { {0, 0} }; + float m_bias; + }; + + // CPU data used for constructing & updating ShadowData + struct ShadowProperty + { + ProjectedShadowDescriptor m_desc; + RPI::ViewPtr m_shadowmapView; + ShadowId m_shadowId; + }; + + using FilterParameter = EsmShadowmapsPass::FilterParameter; + static constexpr float MinimumFieldOfView = 0.001f; + + // RPI::SceneNotificationBus::Handler overrides... + void OnRenderPipelinePassesChanged(RPI::RenderPipeline* renderPipeline) override; + void OnRenderPipelineAdded(RPI::RenderPipelinePtr pipeline) override; + void OnRenderPipelineRemoved(RPI::RenderPipeline* pipeline) override; + + // Shadow specific functions + void UpdateShadowView(ShadowProperty& shadowProperty); + void InitializeShadow(ShadowId shadowId); + + // Functions for caching the ProjectedShadowmapsPass and EsmShadowmapsPass. + void CachePasses(); + AZStd::vector CacheProjectedShadowmapsPass(); + void CacheEsmShadowmapsPass(const AZStd::vector& validPipelineIds); + + //! Functions to update the parameter of Gaussian filter used in ESM. + void UpdateFilterParameters(); + void UpdateStandardDeviations(); + void UpdateFilterOffsetsCounts(); + void SetFilterParameterToPass(); + bool FilterMethodIsEsm(const ShadowData& shadowData) const; + + ShadowProperty& GetShadowPropertyFromShadowId(ShadowId id); + + GpuBufferHandler m_shadowBufferHandler; // For ViewSRG m_projectedShadows + GpuBufferHandler m_filterParamBufferHandler; // For ViewSRG m_projectedFilterParams + + // Stores CPU side shadow information in a packed vector so it's easy to iterate through. + IndexedDataVector m_shadowProperties; + + // Used for easier indexing of m_shadowData + enum + { + ShadowDataIndex, + FilterParamIndex, + ShadowPropertyIdIndex, + }; + + // Stores GPU data that is pushed to buffers in the View SRG. ShadowData corresponds to m_projectedShadows and + // FilterParameter corresponds to m_projectedFilterParams. The uint16_t is used to reference data in + // m_shadowProperties. + MultiSparseVector m_shadowData; + + AZStd::vector m_projectedShadowmapsPasses; + AZStd::vector m_esmShadowmapsPasses; + + RHI::ShaderInputConstantIndex m_shadowmapAtlasSizeIndex; + RHI::ShaderInputConstantIndex m_invShadowmapAtlasSizeIndex; + + bool m_deviceBufferNeedsUpdate = false; + bool m_shadowmapPassNeedsUpdate = true; + bool m_filterParameterNeedsUpdate = false; + }; +} diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp index e415d25038..c9054fc6c8 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp @@ -52,6 +52,10 @@ namespace AZ { m_shaderOptions.m_applyMorphTargets = true; } + if (inputBuffers->GetLod(lodIndex).HasDynamicColors()) + { + m_shaderOptions.m_applyColorMorphTargets = true; + } // CreateShaderOptionGroup will also connect to the SkinnedMeshShaderOptionNotificationBus m_shaderOptionGroup = skinnedMeshComputePass->CreateShaderOptionGroup(m_shaderOptions, *this); @@ -129,9 +133,18 @@ namespace AZ AZ_Assert(false, "Invalid skinning method for SkinnedMeshDispatchItem."); } - AZ_Assert(aznumeric_cast(m_outputBufferOffsetsInBytes.size()) == static_cast(SkinnedMeshOutputVertexStreams::NumVertexStreams), "Not enough offsets were given to the SkinnedMeshDispatchItem"); + AZ_Assert(aznumeric_cast(m_outputBufferOffsetsInBytes.size()) == static_cast(SkinnedMeshOutputVertexStreams::NumVertexStreams) && m_shaderOptions.m_applyColorMorphTargets + || aznumeric_cast(m_outputBufferOffsetsInBytes.size()) == static_cast(SkinnedMeshOutputVertexStreams::NumVertexStreams) - 1 && !m_shaderOptions.m_applyColorMorphTargets, + "Not enough offsets were given to the SkinnedMeshDispatchItem"); + for (uint8_t outputStream = 0; outputStream < static_cast(SkinnedMeshOutputVertexStreams::NumVertexStreams); outputStream++) { + // Skip colors if they are not being morphed + if (outputStream == static_cast(SkinnedMeshOutputVertexStreams::Color) && !m_shaderOptions.m_applyColorMorphTargets) + { + continue; + } + // Set the buffer offsets const SkinnedMeshOutputVertexStreamInfo& outputStreamInfo = SkinnedMeshVertexStreamPropertyInterface::Get()->GetOutputStreamInfo(static_cast(outputStream)); { @@ -142,7 +155,7 @@ namespace AZ return false; } - // The shader has a view of with 4 bytes per element + // The shader has a view with 4 bytes per element // Divide the byte offset here so it doesn't need to be done in the shader m_instanceSrg->SetConstant(outputOffsetIndex, m_outputBufferOffsetsInBytes[outputStream] / 4); } @@ -164,6 +177,13 @@ namespace AZ // The buffer is using 32-bit integers, so divide the offset by 4 here so it doesn't have to be done in the shader m_instanceSrg->SetConstant(morphBitangentOffsetIndex, m_morphTargetInstanceMetaData.m_accumulatedBitangentDeltaOffsetInBytes / 4); + if (m_shaderOptions.m_applyColorMorphTargets) + { + RHI::ShaderInputConstantIndex morphColorOffsetIndex = m_instanceSrg->FindShaderInputConstantIndex(Name{ "m_morphTargetColorDeltaOffset" }); + // The buffer is using 32-bit integers, so divide the offset by 4 here so it doesn't have to be done in the shader + m_instanceSrg->SetConstant(morphColorOffsetIndex, m_morphTargetInstanceMetaData.m_accumulatedColorDeltaOffsetInBytes / 4); + } + RHI::ShaderInputConstantIndex morphDeltaIntegerEncodingIndex = m_instanceSrg->FindShaderInputConstantIndex(Name{ "m_morphTargetDeltaInverseIntegerEncoding" }); m_instanceSrg->SetConstant(morphDeltaIntegerEncodingIndex, 1.0f / m_morphTargetDeltaIntegerEncoding); diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp index f6ad70ddce..343370ae35 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp @@ -74,7 +74,7 @@ namespace AZ return m_vertexCount; } - void SkinnedMeshInputLod::SetIndexBuffer(const Data::Asset bufferAsset) + void SkinnedMeshInputLod::SetIndexBufferAsset(const Data::Asset bufferAsset) { m_indexBufferAsset = bufferAsset; m_indexBuffer = RPI::Buffer::FindOrCreate(bufferAsset); @@ -109,12 +109,35 @@ namespace AZ m_inputBuffers[static_cast(inputStream)] = RPI::Buffer::FindOrCreate(bufferAsset); } + void SkinnedMeshInputLod::SetModelLodAsset(const Data::Asset& modelLodAsset) + { + m_modelLodAsset = modelLodAsset; + } + void SkinnedMeshInputLod::SetSkinningInputBufferAsset(const Data::Asset bufferAsset, SkinnedMeshInputVertexStreams inputStream) { + if (inputStream == SkinnedMeshInputVertexStreams::Color) + { + AZ_Assert(!m_hasStaticColors, "Attempting to set colors as skinning input (meaning they are dynamic) when they already exist as a static stream"); + m_hasDynamicColors = true; + } + m_inputBufferAssets[static_cast(inputStream)] = bufferAsset; m_inputBuffers[static_cast(inputStream)] = RPI::Buffer::FindOrCreate(bufferAsset); } + void SkinnedMeshInputLod::SetStaticBufferAsset(const Data::Asset bufferAsset, SkinnedMeshStaticVertexStreams staticStream) + { + if (staticStream == SkinnedMeshStaticVertexStreams::Color) + { + AZ_Assert(!m_hasDynamicColors, "Attempting to set colors as a static stream on a skinned mesh, when they already exist as a dynamic stream"); + m_hasStaticColors = true; + } + + m_staticBufferAssets[static_cast(staticStream)] = bufferAsset; + m_staticBuffers[static_cast(staticStream)] = RPI::Buffer::FindOrCreate(bufferAsset); + } + void SkinnedMeshInputLod::CreateStaticBuffer(void* data, SkinnedMeshStaticVertexStreams staticStream, const AZStd::string& bufferNamePrefix) { AZ_Assert(m_vertexCount > 0, "SkinnedMeshInputLod::CreateStaticBuffer called with a vertex count of 0. Make sure SetVertexCount has been called before trying to create any buffers."); @@ -169,24 +192,30 @@ namespace AZ void SkinnedMeshInputLod::CreateSharedSubMeshBufferViews() { - m_sharedSubMeshViews.resize(m_subMeshProperties.size()); - - // The index and static buffer views will be shared by all instances that use the same SkinnedMeshInputBuffers, so create them here - for (size_t i = 0; i < m_subMeshProperties.size(); ++i) - { - // Create the view into the index buffer - RHI::BufferViewDescriptor indexBufferViewDescriptor = RHI::BufferViewDescriptor::CreateTyped(m_subMeshProperties[i].m_indexOffset, m_subMeshProperties[i].m_indexCount, RHI::Format::R32_UINT); + AZStd::array_view meshes = m_modelLodAsset->GetMeshes(); + m_sharedSubMeshViews.resize(meshes.size()); - m_sharedSubMeshViews[i].m_indexBufferView = RPI::BufferAssetView{ m_indexBufferAsset, indexBufferViewDescriptor }; + // The index and static buffer views will be shared by all instances that use the same SkinnedMeshInputBuffers, so set them here + for (size_t i = 0; i < meshes.size(); ++i) + { + // Set the view into the index buffer + m_sharedSubMeshViews[i].m_indexBufferView = meshes[i].GetIndexBufferAssetView(); - // Create the views into the static buffers + // Set the views into the static buffers for (uint8_t staticStreamIndex = 0; staticStreamIndex < static_cast(SkinnedMeshStaticVertexStreams::NumVertexStreams); ++staticStreamIndex) { - const SkinnedMeshVertexStreamInfo& streamInfo = SkinnedMeshVertexStreamPropertyInterface::Get()->GetStaticStreamInfo(static_cast(staticStreamIndex)); - RHI::BufferViewDescriptor viewDescriptor = RHI::BufferViewDescriptor::CreateTyped(m_subMeshProperties[i].m_vertexOffset, m_subMeshProperties[i].m_vertexCount, streamInfo.m_elementFormat); + // Skip colors if they don't exist or are dynamic + if (staticStreamIndex == static_cast(SkinnedMeshStaticVertexStreams::Color) && !m_hasStaticColors) + { + continue; + } - RPI::BufferAssetView bufferView{ m_staticBufferAssets[staticStreamIndex], viewDescriptor }; - m_sharedSubMeshViews[i].m_staticStreamViews[staticStreamIndex] = bufferView; + const SkinnedMeshVertexStreamInfo& streamInfo = SkinnedMeshVertexStreamPropertyInterface::Get()->GetStaticStreamInfo(static_cast(staticStreamIndex)); + const RPI::BufferAssetView* bufferView = meshes[i].GetSemanticBufferAssetView(streamInfo.m_semantic.m_name); + if (bufferView) + { + m_sharedSubMeshViews[i].m_staticStreamViews[staticStreamIndex] = bufferView; + } } } } @@ -194,11 +223,24 @@ namespace AZ void SkinnedMeshInputLod::AddMorphTarget(const RPI::MorphTargetMetaAsset::MorphTarget& morphTarget, const Data::Asset& morphBufferAsset, const AZStd::string& bufferNamePrefix, float minWeight = 0.0f, float maxWeight = 1.0f) { m_morphTargetMetaDatas.push_back(MorphTargetMetaData{ minWeight, maxWeight, morphTarget.m_minPositionDelta, morphTarget.m_maxPositionDelta, morphTarget.m_numVertices, morphTarget.m_startIndex }); + + // Create a view into the larger per-lod morph buffer for this particular morph RHI::BufferViewDescriptor morphView = RHI::BufferViewDescriptor::CreateStructured(morphTarget.m_startIndex, morphTarget.m_numVertices, sizeof(RPI::PackedCompressedMorphTargetDelta)); RPI::BufferAssetView morphTargetDeltaView{ morphBufferAsset, morphView }; + m_morphTargetInputBuffers.push_back(aznew MorphTargetInputBuffers{ morphTargetDeltaView, bufferNamePrefix }); + + // If colors are going to be morphed, the SkinnedMeshInputLod needs to know so that it allocates memory for the dynamically updated colors + if (morphTarget.m_hasColorDeltas) + { + m_hasDynamicColors = true; + } } + bool SkinnedMeshInputLod::HasDynamicColors() const + { + return m_hasDynamicColors; + } const AZStd::vector& SkinnedMeshInputLod::GetMorphTargetMetaDatas() const { @@ -265,11 +307,22 @@ namespace AZ // Get the SRG indices for each input stream for (uint8_t inputStream = 0; inputStream < static_cast(SkinnedMeshInputVertexStreams::NumVertexStreams); ++inputStream) { + // Skip colors if they don't exist or are not being morphed + if (inputStream == static_cast(SkinnedMeshInputVertexStreams::Color) && !m_lods[lodIndex].m_hasDynamicColors) + { + continue; + } + const SkinnedMeshVertexStreamInfo& streamInfo = SkinnedMeshVertexStreamPropertyInterface::Get()->GetInputStreamInfo(static_cast(inputStream)); RHI::ShaderInputBufferIndex srgIndex = perInstanceSRG->FindShaderInputBufferIndex(streamInfo.m_shaderResourceGroupName); AZ_Error("SkinnedMeshInputBuffers", srgIndex.IsValid(), "Failed to find shader input index for '%s' in the skinning compute shader per-instance SRG.", streamInfo.m_shaderResourceGroupName.GetCStr()); - [[maybe_unused]] bool success = perInstanceSRG->SetBufferView(srgIndex, m_lods[lodIndex].m_inputBuffers[inputStream]->GetBufferView()); + [[maybe_unused]] bool success = false; + if (m_lods[lodIndex].m_inputBuffers[inputStream]) + { + success = perInstanceSRG->SetBufferView(srgIndex, m_lods[lodIndex].m_inputBuffers[inputStream]->GetBufferView()); + } + AZ_Error("SkinnedMeshInputBuffers", success, "Failed to bind buffer view for %s", streamInfo.m_bufferName.GetCStr()); } @@ -336,7 +389,22 @@ namespace AZ // used for dependency tracking between passes. This can be switched to a transient memory pool so that the memory is free // later in the frame once skinning is finished ATOM-14429 - AZStd::intrusive_ptr allocation = SkinnedMeshOutputStreamManagerInterface::Get()->Allocate(vertexCount * static_cast(MorphTargetConstants::s_unpackedMorphTargetDeltaSizeInBytes) * MorphTargetConstants::s_morphTargetDeltaTypeCount); + size_t perVertexSizeInBytes = static_cast(MorphTargetConstants::s_unpackedMorphTargetDeltaSizeInBytes) * MorphTargetConstants::s_morphTargetDeltaTypeCount; + if (lod.HasDynamicColors()) + { + // Naively, if colors are morphed by any of the morph targets, + // we'll allocate enough memory to store the accumulated color deltas for every vertex in the lod. + // This could be reduced by ATOM-14427 + + // We assume that the model has been padded to include colors even for the meshes which don't use them + // this could be reduced by dispatching the skinning shade + // for one mesh at a time instead of the entire lod at once ATOM-15078 + + // Add four floats for colors + perVertexSizeInBytes += 4 * sizeof(float); + } + + AZStd::intrusive_ptr allocation = SkinnedMeshOutputStreamManagerInterface::Get()->Allocate(vertexCount * perVertexSizeInBytes); if (!allocation) { // Suppress the OnMemoryFreed signal when releasing the previous successful allocations @@ -367,6 +435,16 @@ namespace AZ instanceMetaData.m_accumulatedTangentDeltaOffsetInBytes = instanceMetaData.m_accumulatedNormalDeltaOffsetInBytes + deltaStreamSizeInBytes; instanceMetaData.m_accumulatedBitangentDeltaOffsetInBytes = instanceMetaData.m_accumulatedTangentDeltaOffsetInBytes + deltaStreamSizeInBytes; + // Followed by colors + if (lod.HasDynamicColors()) + { + instanceMetaData.m_accumulatedColorDeltaOffsetInBytes = instanceMetaData.m_accumulatedBitangentDeltaOffsetInBytes + deltaStreamSizeInBytes; + } + else + { + instanceMetaData.m_accumulatedColorDeltaOffsetInBytes = MorphTargetConstants::s_invalidDeltaOffset; + } + // Track both the allocation and the metadata in the instance instance->m_morphTargetInstanceMetaData.push_back(instanceMetaData); lodAllocations.push_back(allocation); @@ -481,6 +559,12 @@ namespace AZ // So we want to pack all the positions for each sub-mesh together, all the normals together, etc. for (uint8_t outputStreamIndex = 0; outputStreamIndex < static_cast(SkinnedMeshOutputVertexStreams::NumVertexStreams); ++outputStreamIndex) { + // Skip colors if they don't exist or are not being morphed + if (outputStreamIndex == static_cast(SkinnedMeshOutputVertexStreams::Color) && !lod.m_hasDynamicColors) + { + continue; + } + if (!AllocateLodStream(outputStreamIndex, aznumeric_cast(lod.m_vertexCount), instance, streamOffsetsFromBufferStart, lodAllocations)) { return nullptr; @@ -513,14 +597,26 @@ namespace AZ // Create and set the views into the skinning output buffers for (uint8_t outputStreamIndex = 0; outputStreamIndex < static_cast(SkinnedMeshOutputVertexStreams::NumVertexStreams); ++outputStreamIndex) { + // Skip colors if they don't exist or are not being morphed + if (outputStreamIndex == static_cast(SkinnedMeshOutputVertexStreams::Color) && !lod.m_hasDynamicColors) + { + continue; + } AddSubMeshViewToModelLodCreator(outputStreamIndex, lod.m_vertexCount, lod.m_subMeshProperties[i].m_vertexCount, skinnedMeshOutputBufferAsset, streamOffsetsFromBufferStart, subMeshOffsetsFromStreamStart, modelLodCreator); } // Set the views into the static buffers for (uint8_t staticStreamIndex = 0; staticStreamIndex < static_cast(SkinnedMeshStaticVertexStreams::NumVertexStreams); ++staticStreamIndex) { + // Skip colors if they don't exist or are dynamic + if (!lod.m_sharedSubMeshViews[i].m_staticStreamViews[staticStreamIndex] + || (staticStreamIndex == static_cast(SkinnedMeshStaticVertexStreams::Color) && !lod.m_hasStaticColors)) + { + continue; + } + const SkinnedMeshVertexStreamInfo& staticStreamInfo = SkinnedMeshVertexStreamPropertyInterface::Get()->GetStaticStreamInfo(static_cast(staticStreamIndex)); - modelLodCreator.AddMeshStreamBuffer(staticStreamInfo.m_semantic, AZ::Name(), lod.m_sharedSubMeshViews[i].m_staticStreamViews[staticStreamIndex]); + modelLodCreator.AddMeshStreamBuffer(staticStreamInfo.m_semantic, AZ::Name(), *lod.m_sharedSubMeshViews[i].m_staticStreamViews[staticStreamIndex]); } Aabb localAabb = lod.m_subMeshProperties[i].m_aabb; diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshShaderOptionsCache.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshShaderOptionsCache.cpp index e5f5018b77..a799acff7f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshShaderOptionsCache.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshShaderOptionsCache.cpp @@ -32,6 +32,10 @@ namespace AZ m_applyMorphTargetFalseValue = layout->FindValue(m_applyMorphTargetOptionIndex, AZ::Name("false")); m_applyMorphTargetTrueValue = layout->FindValue(m_applyMorphTargetOptionIndex, AZ::Name("true")); + m_applyColorMorphTargetOptionIndex = layout->FindShaderOptionIndex(AZ::Name("o_applyColorMorphTargets")); + m_applyColorMorphTargetFalseValue = layout->FindValue(m_applyColorMorphTargetOptionIndex, AZ::Name("false")); + m_applyColorMorphTargetTrueValue = layout->FindValue(m_applyColorMorphTargetOptionIndex, AZ::Name("true")); + SkinnedMeshShaderOptionNotificationBus::Event(this, &SkinnedMeshShaderOptionNotificationBus::Events::OnShaderReinitialized, this); } @@ -62,6 +66,15 @@ namespace AZ shaderOptionGroup.SetValue(m_applyMorphTargetOptionIndex, m_applyMorphTargetFalseValue); } + if (shaderOptions.m_applyColorMorphTargets) + { + shaderOptionGroup.SetValue(m_applyColorMorphTargetOptionIndex, m_applyColorMorphTargetTrueValue); + } + else + { + shaderOptionGroup.SetValue(m_applyColorMorphTargetOptionIndex, m_applyColorMorphTargetFalseValue); + } + shaderOptionGroup.SetUnspecifiedToDefaultValues(); return shaderOptionGroup; diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshShaderOptionsCache.h b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshShaderOptionsCache.h index 23fe796141..aeff874f6f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshShaderOptionsCache.h +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshShaderOptionsCache.h @@ -59,6 +59,10 @@ namespace AZ RPI::ShaderOptionIndex m_applyMorphTargetOptionIndex; RPI::ShaderOptionValue m_applyMorphTargetFalseValue; RPI::ShaderOptionValue m_applyMorphTargetTrueValue; + + RPI::ShaderOptionIndex m_applyColorMorphTargetOptionIndex; + RPI::ShaderOptionValue m_applyColorMorphTargetFalseValue; + RPI::ShaderOptionValue m_applyColorMorphTargetTrueValue; }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshVertexStreamProperties.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshVertexStreamProperties.cpp index 1fd3019050..de82d103ea 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshVertexStreamProperties.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshVertexStreamProperties.cpp @@ -74,6 +74,14 @@ namespace AZ RHI::ShaderSemantic{Name{"UNUSED"}} }; + m_inputStreamInfo[static_cast(SkinnedMeshInputVertexStreams::Color)] = SkinnedMeshVertexStreamInfo{ + RHI::Format::R32G32B32A32_FLOAT, + sizeof(AZ::Vector4), + Name{"SkinnedMeshInputColors"}, + Name{"m_sourceColors"}, + RHI::ShaderSemantic{Name{"UNUSED"}} + }; + // Attributes of the vertex buffers that are not used or modified during skinning, but are shared between all target models that share the same source m_staticStreamInfo[static_cast(SkinnedMeshStaticVertexStreams::UV_0)] = SkinnedMeshVertexStreamInfo{ RHI::Format::R32G32_FLOAT, @@ -83,6 +91,14 @@ namespace AZ RHI::ShaderSemantic{Name{"UV"}} }; + m_staticStreamInfo[static_cast(SkinnedMeshStaticVertexStreams::Color)] = SkinnedMeshVertexStreamInfo{ + RHI::Format::R32G32B32A32_FLOAT, + sizeof(AZ::Vector4), + Name{"SkinnedMeshStaticColors"}, + Name{"unused"}, + RHI::ShaderSemantic{Name{"COLOR"}} + }; + // Attributes of the vertex streams of the target model that is written to during skinning m_outputStreamInfo[static_cast(SkinnedMeshOutputVertexStreams::Position)] = SkinnedMeshOutputVertexStreamInfo{ RHI::Format::R32G32B32_FLOAT, @@ -119,6 +135,15 @@ namespace AZ RHI::ShaderSemantic{Name{"BITANGENT"}}, SkinnedMeshInputVertexStreams::BiTangent }; + + m_outputStreamInfo[static_cast(SkinnedMeshOutputVertexStreams::Color)] = SkinnedMeshOutputVertexStreamInfo{ + RHI::Format::R32G32B32A32_FLOAT, + sizeof(AZ::Vector4), + Name{"SkinnedMeshOutputColors"}, + Name{"m_targetColors"}, + RHI::ShaderSemantic{Name{"COLOR"}}, + SkinnedMeshInputVertexStreams::Color + }; { auto bufferPoolDesc = AZStd::make_unique(); diff --git a/Gems/Atom/Feature/Common/Code/Tests/SparseVectorTests.cpp b/Gems/Atom/Feature/Common/Code/Tests/SparseVectorTests.cpp new file mode 100644 index 0000000000..df46db36ff --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Tests/SparseVectorTests.cpp @@ -0,0 +1,292 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include + +namespace UnitTest +{ + using namespace AZ; + using namespace AZ::Render; + + class SparseVectorTests + : public UnitTest::AllocatorsTestFixture + { + public: + void SetUp() override + { + UnitTest::AllocatorsTestFixture::SetUp(); + } + + void TearDown() override + { + UnitTest::AllocatorsTestFixture::TearDown(); + } + }; + + struct TestData + { + static constexpr int DefaultValueA = 100; + static constexpr float DefaultValueB = 123.45f; + static constexpr bool DefaultValueC = true; + + int a = DefaultValueA; + float b = DefaultValueB; + bool c = DefaultValueC; + }; + + TEST_F(SparseVectorTests, SparseVectorCreate) + { + // Simple test to make sure we can create a SparseVector and it initializes with no values. + SparseVector container; + EXPECT_EQ(0, container.GetSize()); + container.Clear(); + EXPECT_EQ(0, container.GetSize()); + } + + TEST_F(SparseVectorTests, SparseVectorReserveRelease) + { + SparseVector container; + constexpr size_t Count = 10; + size_t indices[Count]; + + // Create some elements + for (size_t i = 0; i < Count; ++i) + { + indices[i] = container.Reserve(); + } + + EXPECT_EQ(container.GetSize(), Count); + + // Ensure that the elements were created with valid indices + for (size_t i = 0; i < Count; ++i) + { + EXPECT_EQ(indices[i], i); + } + + // Check default initialization of struct and initialize primitive types + for (size_t i = 0; i < Count; ++i) + { + TestData& data = container.GetElement(indices[i]); + + // Ensure that the data was initialized properly. + EXPECT_EQ(data.a, TestData::DefaultValueA); + EXPECT_EQ(data.b, TestData::DefaultValueB); + EXPECT_EQ(data.c, TestData::DefaultValueC); + + // Assign new unique values + data.a = TestData::DefaultValueA * i; + data.b = TestData::DefaultValueB * float(i); + data.c = i % 2 == 0; + } + + // Release every other element. + for (size_t i = 0; i < Count; i += 2) + { + container.Release(indices[i]); + } + + // Size should be unaffected by release since it just leaves empty slots. + EXPECT_EQ(container.GetSize(), Count); + + // Check the remaining slots to make sure the data is still correct + for (size_t i = 1; i < Count; i += 2) + { + TestData& data = container.GetElement(indices[i]); + + EXPECT_EQ(data.a, TestData::DefaultValueA * i); + EXPECT_EQ(data.b, TestData::DefaultValueB * float(i)); + EXPECT_EQ(data.c, i % 2 == 0); + } + + // Re-reserve the previously deleted elements + for (size_t i = 0; i < Count; i += 2) + { + indices[i] = container.Reserve(); + } + + // Make sure the new elements data is initialized to default. + for (size_t i = 0; i < Count; i += 2) + { + TestData& data = container.GetElement(indices[i]); + + // Ensure that the data was initialized properly. + EXPECT_EQ(data.a, TestData::DefaultValueA); + EXPECT_EQ(data.b, TestData::DefaultValueB); + EXPECT_EQ(data.c, TestData::DefaultValueC); + } + + } + + TEST_F(SparseVectorTests, SparseVectorGetRawData) + { + SparseVector container; + constexpr size_t Count = 10; + size_t indices[Count]; + + // Create some elements + for (size_t i = 0; i < Count; ++i) + { + indices[i] = container.Reserve(); + } + + // Get the raw data pointer + const TestData* testData = container.GetRawData(); + + // Make sure the data in the raw array matches what's expected. + for (size_t i = 0; i < container.GetSize(); ++i) + { + const TestData& data = testData[i]; + EXPECT_EQ(data.a, TestData::DefaultValueA); + EXPECT_EQ(data.b, TestData::DefaultValueB); + EXPECT_EQ(data.c, TestData::DefaultValueC); + } + + container.Clear(); + EXPECT_EQ(0, container.GetSize()); + } + + TEST_F(SparseVectorTests, MultiSparseVectorCreate) + { + // Simple test to make sure we can create a MultiSparseVector and it initializes with no values. + MultiSparseVector container; + EXPECT_EQ(0, container.GetSize()); + container.Clear(); + EXPECT_EQ(0, container.GetSize()); + } + + TEST_F(SparseVectorTests, MultiSparseVectorReserve) + { + MultiSparseVector container; + constexpr size_t Count = 10; + size_t indices[Count]; + + // Create some elements + for (size_t i = 0; i < Count; ++i) + { + indices[i] = container.Reserve(); + } + + EXPECT_EQ(container.GetSize(), Count); + + // Ensure that the elements were created with valid indices + for (size_t i = 0; i < Count; ++i) + { + EXPECT_EQ(indices[i], i); + } + + // Ensure that the data was initialized properly. + for (size_t i = 0; i < Count; ++i) + { + TestData& data = container.GetElement<0>(indices[i]); + + EXPECT_EQ(data.a, TestData::DefaultValueA); + EXPECT_EQ(data.b, TestData::DefaultValueB); + EXPECT_EQ(data.c, TestData::DefaultValueC); + + data.a = TestData::DefaultValueA * i; + data.b = TestData::DefaultValueB * float(i); + data.c = i % 2 == 0; + + // Assign some values to the uninitialized primitive types + container.GetElement<1>(indices[i]) = i * 10; + container.GetElement<2>(indices[i]) = i * 20.0f; + } + + // Release every other element + for (size_t i = 0; i < Count; i += 2) + { + container.Release(indices[i]); + } + + // Size should be unaffected by release since it just leaves empty slots. + EXPECT_EQ(container.GetSize(), Count); + + // Check the remaining slots to make sure the data is still correct + for (size_t i = 1; i < Count; i += 2) + { + TestData& data = container.GetElement<0>(indices[i]); + + EXPECT_EQ(data.a, TestData::DefaultValueA * i); + EXPECT_EQ(data.b, TestData::DefaultValueB * float(i)); + EXPECT_EQ(data.c, i % 2 == 0); + + EXPECT_EQ(container.GetElement<1>(indices[i]), i * 10); + EXPECT_EQ(container.GetElement<2>(indices[i]), i * 20.0f); + } + + // Re-reserve the previously deleted elements + for (size_t i = 0; i < Count; i += 2) + { + indices[i] = container.Reserve(); + } + + // Make sure the new elements data is initialized to default. + for (size_t i = 0; i < Count; i += 2) + { + TestData& data = container.GetElement<0>(indices[i]); + + // Ensure that the data was initialized properly. + EXPECT_EQ(data.a, TestData::DefaultValueA); + EXPECT_EQ(data.b, TestData::DefaultValueB); + EXPECT_EQ(data.c, TestData::DefaultValueC); + + EXPECT_EQ(container.GetElement<1>(indices[i]), 0); + EXPECT_EQ(container.GetElement<2>(indices[i]), 0.0f); + } + + } + + TEST_F(SparseVectorTests, MultiSparseVectorGetRawData) + { + MultiSparseVector container; + constexpr size_t Count = 10; + size_t indices[Count]; + + // Create some elements and give them values to check later. + for (size_t i = 0; i < Count; ++i) + { + indices[i] = container.Reserve(); + + container.GetElement<1>(i) = i * 10; + container.GetElement<2>(i) = i * 20.0f; + } + + // Get raw data arrays + const TestData* testData = container.GetRawData<0>(); + const int* testints = container.GetRawData<1>(); + const float* testfloats = container.GetRawData<2>(); + + // Check all the data to make sure it's accurate. + for (size_t i = 0; i < container.GetSize(); ++i) + { + const TestData& data = testData[i]; + EXPECT_EQ(data.a, TestData::DefaultValueA); + EXPECT_EQ(data.b, TestData::DefaultValueB); + EXPECT_EQ(data.c, TestData::DefaultValueC); + } + + for (size_t i = 0; i < container.GetSize(); ++i) + { + EXPECT_EQ(testints[i], i * 10); + } + + for (size_t i = 0; i < container.GetSize(); ++i) + { + EXPECT_EQ(testfloats[i], i * 20.0f); + } + + container.Clear(); + EXPECT_EQ(0, container.GetSize()); + } +} diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake index 954a418ac0..7e23bc340f 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake @@ -42,7 +42,9 @@ set(FILES Include/Atom/Feature/Utils/FrameCaptureBus.h Include/Atom/Feature/Utils/GpuBufferHandler.h Include/Atom/Feature/Utils/MultiIndexedDataVector.h + Include/Atom/Feature/Utils/MultiSparseVector.h Include/Atom/Feature/Utils/ProfilingCaptureBus.h + Include/Atom/Feature/Utils/SparseVector.h Include/Atom/Feature/LuxCore/LuxCoreBus.h Include/Atom/Feature/LuxCore/LuxCoreTexturePass.h Include/Atom/Feature/LuxCore/RenderTexturePass.h @@ -83,16 +85,18 @@ set(FILES Source/CoreLights/IndexedDataVector.inl Source/CoreLights/LtcCommon.h Source/CoreLights/LtcCommon.cpp - Source/CoreLights/SpotLightFeatureProcessor.h - Source/CoreLights/SpotLightFeatureProcessor.cpp - Source/CoreLights/SpotLightShadowmapsPass.h - Source/CoreLights/SpotLightShadowmapsPass.cpp Source/CoreLights/PointLightFeatureProcessor.h Source/CoreLights/PointLightFeatureProcessor.cpp Source/CoreLights/PolygonLightFeatureProcessor.h Source/CoreLights/PolygonLightFeatureProcessor.cpp + Source/CoreLights/ProjectedShadowmapsPass.h + Source/CoreLights/ProjectedShadowmapsPass.cpp Source/CoreLights/QuadLightFeatureProcessor.h Source/CoreLights/QuadLightFeatureProcessor.cpp + Source/CoreLights/SimplePointLightFeatureProcessor.h + Source/CoreLights/SimplePointLightFeatureProcessor.cpp + Source/CoreLights/SimpleSpotLightFeatureProcessor.h + Source/CoreLights/SimpleSpotLightFeatureProcessor.cpp Source/CoreLights/Shadow.h Source/CoreLights/Shadow.cpp Source/CoreLights/ShadowmapAtlas.h @@ -246,10 +250,6 @@ set(FILES Source/PostProcessing/SsaoPasses.h Source/PostProcessing/SubsurfaceScatteringPass.cpp Source/PostProcessing/SubsurfaceScatteringPass.h - Source/ScreenSpace/DeferredFogSettings.cpp - Source/ScreenSpace/DeferredFogSettings.h - Source/ScreenSpace/DeferredFogPass.cpp - Source/ScreenSpace/DeferredFogPass.h Source/RayTracing/RayTracingFeatureProcessor.h Source/RayTracing/RayTracingFeatureProcessor.cpp Source/RayTracing/RayTracingAccelerationStructurePass.cpp @@ -262,6 +262,12 @@ set(FILES Source/ReflectionScreenSpace/ReflectionScreenSpaceBlurChildPass.h Source/ReflectionScreenSpace/ReflectionCopyFrameBufferPass.cpp Source/ReflectionScreenSpace/ReflectionCopyFrameBufferPass.h + Source/ScreenSpace/DeferredFogSettings.cpp + Source/ScreenSpace/DeferredFogSettings.h + Source/ScreenSpace/DeferredFogPass.cpp + Source/ScreenSpace/DeferredFogPass.h + Source/Shadows/ProjectedShadowFeatureProcessor.h + Source/Shadows/ProjectedShadowFeatureProcessor.cpp Source/SkinnedMesh/SkinnedMeshComputePass.cpp Source/SkinnedMesh/SkinnedMeshComputePass.h Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_public_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_public_files.cmake index 7565c462e8..9034859707 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_public_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_public_files.cmake @@ -18,8 +18,9 @@ set(FILES Include/Atom/Feature/CoreLights/PointLightFeatureProcessorInterface.h Include/Atom/Feature/CoreLights/PolygonLightFeatureProcessorInterface.h Include/Atom/Feature/CoreLights/QuadLightFeatureProcessorInterface.h + Include/Atom/Feature/CoreLights/SimplePointLightFeatureProcessorInterface.h + Include/Atom/Feature/CoreLights/SimpleSpotLightFeatureProcessorInterface.h Include/Atom/Feature/CoreLights/ShadowConstants.h - Include/Atom/Feature/CoreLights/SpotLightFeatureProcessorInterface.h Include/Atom/Feature/Decals/DecalFeatureProcessorInterface.h Include/Atom/Feature/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessorInterface.h Include/Atom/Feature/DisplayMapper/DisplayMapperFeatureProcessorInterface.h @@ -64,6 +65,7 @@ set(FILES Include/Atom/Feature/ScreenSpace/DeferredFogSettingsInterface.h Include/Atom/Feature/ScreenSpace/DeferredFogParams.inl Include/Atom/Feature/ReflectionProbe/ReflectionProbeFeatureProcessorInterface.h + Include/Atom/Feature/Shadows/ProjectedShadowFeatureProcessorInterface.h Include/Atom/Feature/SkinnedMesh/SkinnedMeshFeatureProcessorBus.h Include/Atom/Feature/SkinnedMesh/SkinnedMeshFeatureProcessorInterface.h Include/Atom/Feature/SkinnedMesh/SkinnedMeshInputBuffers.h diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_tests_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_tests_files.cmake index 33b851aa25..17a596effa 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_tests_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_tests_files.cmake @@ -15,6 +15,7 @@ set(FILES Tests/CoreLights/ShadowmapAtlasTest.cpp Tests/IndexedDataVectorTests.cpp Tests/IndexableListTests.cpp + Tests/SparseVectorTests.cpp Tests/SkinnedMesh/SkinnedMeshDispatchItemTests.cpp Tests/Decals/DecalTextureArrayTests.cpp ) diff --git a/Gems/Atom/RHI/Vulkan/3rdParty/Findglad_vulkan.cmake b/Gems/Atom/RHI/Vulkan/3rdParty/Findglad_vulkan.cmake index 0a201e808a..1142e59009 100644 --- a/Gems/Atom/RHI/Vulkan/3rdParty/Findglad_vulkan.cmake +++ b/Gems/Atom/RHI/Vulkan/3rdParty/Findglad_vulkan.cmake @@ -12,6 +12,6 @@ ly_add_external_target( NAME glad_vulkan VERSION 2.0.0-beta - 3RDPARTY_ROOT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../External/glad + 3RDPARTY_ROOT_DIRECTORY ${LY_ROOT_FOLDER}/Gems/Atom/RHI/Vulkan/External/glad INCLUDE_DIRECTORIES include ) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Culling.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Culling.h index c082e20332..c7e9cc4706 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Culling.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Culling.h @@ -197,26 +197,26 @@ namespace AZ //! Selects an lod (based on size-in-screnspace) and adds the appropriate DrawPackets to the view. uint32_t AddLodDataToView(const Vector3& pos, const Cullable::LodData& lodData, RPI::View& view); - //! Centralized manager for culling-related processing. - //! There is one CullingSystem owned by each Scene, so external systems (such as FeatureProcessors) should - //! access the CullingSystem via their parent Scene. - class CullingSystem + //! Centralized manager for culling-related processing for a given scene. + //! There is one CullingScene owned by each Scene, so external systems (such as FeatureProcessors) should + //! access the CullingScene via their parent Scene. + class CullingScene { public: - AZ_RTTI(CullingSystem, "{5B23B55B-8A1D-4B0D-9760-15E87FC8518A}"); - AZ_CLASS_ALLOCATOR(CullingSystem, AZ::SystemAllocator, 0); - AZ_DISABLE_COPY_MOVE(CullingSystem); + AZ_RTTI(CullingScene, "{5B23B55B-8A1D-4B0D-9760-15E87FC8518A}"); + AZ_CLASS_ALLOCATOR(CullingScene, AZ::SystemAllocator, 0); + AZ_DISABLE_COPY_MOVE(CullingScene); - CullingSystem() = default; - virtual ~CullingSystem() = default; + CullingScene() = default; + virtual ~CullingScene() = default; void Activate(const class Scene* parentScene); void Deactivate(); - //! Notifies the CullingSystem that culling will begin for this frame. + //! Notifies the CullingScene that culling will begin for this frame. void BeginCulling(const AZStd::vector& views); - //! Notifies the CullingSystem that the culling is done for this frame. + //! Notifies the CullingScene that the culling is done for this frame. void EndCulling(); //! Performs render culling and lod selection for a View, then adds the visible renderpackets to that View. @@ -235,7 +235,7 @@ namespace AZ //! Is not threadsafe, so call this from the main thread outside of Begin/EndCulling() void UnregisterCullable(Cullable& cullable); - //! Returns the number of cullables that have been added to the CullingSystem + //! Returns the number of cullables that have been added to the CullingScene uint32_t GetNumCullables() const; CullingDebugContext& GetDebugContext() @@ -244,12 +244,13 @@ namespace AZ } static const size_t WorkListCapacity = 5; - using WorkListType = AZStd::fixed_vector; + using WorkListType = AZStd::fixed_vector; protected: size_t CountObjectsInScene(); const Scene* m_parentScene = nullptr; + AzFramework::IVisibilityScene* m_visScene = nullptr; CullingDebugContext m_debugCtx; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/FeatureProcessor.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/FeatureProcessor.h index cf280bbd75..ccc5103bfc 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/FeatureProcessor.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/FeatureProcessor.h @@ -70,7 +70,7 @@ namespace AZ //! Whether to run jobs in parallel or not (for debugging) RHI::JobPolicy m_jobPolicy; - class CullingSystem* m_cullingSystem; + class CullingScene* m_cullingScene; }; AZ_RTTI(FeatureProcessor, "{B8027170-C65C-4237-964D-B557FC9D7575}"); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Scene.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Scene.h index a848f42068..aac6f4fb97 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Scene.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Scene.h @@ -44,7 +44,7 @@ namespace AZ class FeatureProcessor; class ShaderResourceGroup; class ShaderResourceGroupAsset; - class CullingSystem; + class CullingScene; class DynamicDrawSystem; // Callback function to modify values of a ShaderResourceGroup @@ -162,9 +162,9 @@ namespace AZ bool HasOutputForPipelineState(RHI::DrawListTag drawListTag) const; - AZ::RPI::CullingSystem* GetCullingSystem() + AZ::RPI::CullingScene* GetCullingScene() { - return m_cullingSystem; + return m_cullingScene; } RenderPipelinePtr FindRenderPipelineForWindow(AzFramework::NativeWindowHandle windowHandle); @@ -212,7 +212,7 @@ namespace AZ // CPU simulation job completion for track all feature processors' simulation jobs AZ::JobCompletion* m_simulationCompletion = nullptr; - AZ::RPI::CullingSystem* m_cullingSystem; + AZ::RPI::CullingScene* m_cullingScene; // Cached views for current rendering frame. It gets re-built every frame. AZ::RPI::FeatureProcessor::SimulatePacket m_simulatePacket; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/MorphTargetDelta.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/MorphTargetDelta.h index 6d3a6805ef..2cc46dc748 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/MorphTargetDelta.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/MorphTargetDelta.h @@ -16,6 +16,23 @@ namespace AZ::RPI { + namespace MorphTargetDeltaConstants + { + // Min/max values for compression should correspond to what is used in MorphTargetCompression.azsli + + // A tangent/bitangent/normal will be between -1.0 and 1.0 on any given axis + // The largest a delta needs to be is 2.0 in either positive or negative direction + // to modify a value from 1 to -1 or from -1 to 1 + constexpr float s_tangentSpaceDeltaMin = -2.0f; + constexpr float s_tangentSpaceDeltaMax = 2.0f; + + // A color will be between 0.0 and 1.0 for any given channel + // The largest a delta needs to be is positive or negative 1.0 + // to modify a value from 0 to 1 or from 1 to 0 + constexpr float s_colorDeltaMin = -1.0f; + constexpr float s_colorDeltaMax = 1.0f; + } + //! This class represents the data that is passed to the morph target compute shader for an individual delta //! See MorphTargetSRG.azsli for the corresponding shader struct //! It is 16-byte aligned to work with structured buffers @@ -32,8 +49,10 @@ namespace AZ::RPI uint32_t m_normalZTangentXYZ; // 8 bit padding plus 8 bits per component for bitangent deltas uint32_t m_padBitangentXYZ; + // 8 bits per component for color deltas + uint32_t m_colorRGBA; // Explicit padding so the struct is 16 byte aligned for structured buffers - uint32_t m_pad[3]; + uint32_t m_pad[2]; }; //! A morph target delta that is compressed, but split into individual components @@ -60,6 +79,12 @@ namespace AZ::RPI uint8_t m_bitangentX; uint8_t m_bitangentY; uint8_t m_bitangentZ; + + // 8 bits per channel for color deltas + uint8_t m_colorR; + uint8_t m_colorG; + uint8_t m_colorB; + uint8_t m_colorA; }; PackedCompressedMorphTargetDelta PackMorphTargetDelta(const CompressedMorphTargetDelta& compressedDelta); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/MorphTargetMetaAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/MorphTargetMetaAsset.h index 19b18347bc..5b92047226 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/MorphTargetMetaAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/MorphTargetMetaAsset.h @@ -56,6 +56,9 @@ namespace AZ::RPI float m_minPositionDelta; float m_maxPositionDelta; + //! Boolean to indicate the presence or absence of color deltas + bool m_hasColorDeltas = false; + static void Reflect(AZ::ReflectContext* context); }; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp index 4a26746e28..f16d2c6fc9 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.cpp @@ -114,7 +114,7 @@ namespace AZ if (auto* serialize = azrtti_cast(context)) { serialize->Class() - ->Version(25); // [ATOM-14876] + ->Version(26); // [ATOM-14992] } } @@ -375,6 +375,8 @@ namespace AZ { ProductMeshContentList lodMeshes = SourceMeshListToProductMeshList(context, sourceMeshContentList, jointNameToIndexMap, morphTargetMetaCreator); + PadVerticesForSkinning(lodMeshes); + // By default, we merge meshes that share the same material bool canMergeMeshes = true; @@ -881,6 +883,61 @@ namespace AZ return productMeshList; } + void ModelAssetBuilderComponent::PadVerticesForSkinning(ProductMeshContentList& productMeshList) + { + // Check if this is a skinned mesh + if (!productMeshList.empty() && !productMeshList[0].m_skinWeights.empty()) + { + // First, do a pass to see if any mesh has morphed colors + bool hasMorphedColors = false; + for (ProductMeshContent& productMesh : productMeshList) + { + if (productMesh.m_hasMorphedColors) + { + hasMorphedColors = true; + break; + } + } + + for (ProductMeshContent& productMesh : productMeshList) + { + size_t vertexCount = productMesh.m_positions.size() / PositionFloatsPerVert; + + // Skinned meshes require that positions, normals, tangents, bitangents, all exist and have the same number + // of total elements. Pad buffers with missing data to make them align with positions and normals + if (productMesh.m_tangents.empty()) + { + productMesh.m_tangents.resize(vertexCount * TangentFloatsPerVert, 1.0f); + AZ_Warning(s_builderName, false, "Mesh '%s' is missing tangents and no defaults were generated. Skinned meshes require tangents. Dummy tangents will be inserted, which may result in rendering artifacts.", productMesh.m_name.GetCStr()); + } + if (productMesh.m_bitangents.empty()) + { + productMesh.m_bitangents.resize(vertexCount * BitangentFloatsPerVert, 1.0f); + AZ_Warning(s_builderName, false, "Mesh '%s' is missing bitangents and no defaults were generated. Skinned meshes require bitangents. Dummy bitangents will be inserted, which may result in rendering artifacts.", productMesh.m_name.GetCStr()); + } + + // If any of the meshes have morphed colors, padd all the meshes so that the color stream is aligned with the other skinned streams + if (hasMorphedColors) + { + if (productMesh.m_colorCustomNames.empty()) + { + productMesh.m_colorCustomNames.push_back(Name{ "COLOR" }); + } + + if (productMesh.m_colorSets.empty()) + { + productMesh.m_colorSets.resize(1); + } + + if (productMesh.m_colorSets[0].empty()) + { + productMesh.m_colorSets[0].resize(vertexCount * ColorFloatsPerVert, 0.0f); + } + } + } + } + } + void ModelAssetBuilderComponent::GatherVertexSkinningInfluences( const SourceMeshContent& sourceMesh, ProductMeshContent& productMesh, diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.h b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.h index 44a49a72cb..a4fb569ef1 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.h +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/ModelAssetBuilderComponent.h @@ -124,6 +124,7 @@ namespace AZ MaterialUid m_materialUid; bool CanBeMerged() const { return m_clothData.empty(); } + bool m_hasMorphedColors = false; }; using ProductMeshContentList = AZStd::vector; @@ -197,6 +198,12 @@ namespace AZ AZStd::unordered_map& jointNameToIndexMap, MorphTargetMetaAssetCreator& morphTargetMetaCreator); + //! Checks if this is a skinned mesh and if soe, + //! adds some extra padding to make vertex streams align for skinning + //! Skinning is applied on an entire lod at once, so it presumes that + //! Each vertex stream that is modified by skinning is the same length + void PadVerticesForSkinning(ProductMeshContentList& productMeshList); + //! Takes in a ProductMeshContentList and merges all elements that share the same MaterialUid. ProductMeshContentList MergeMeshesByMaterialUid( const ProductMeshContentList& productMeshList); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp index 65d2fe72e4..7aace50760 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp @@ -232,25 +232,35 @@ namespace AZ::RPI const AZ::Vector3 deltaNormal = targetNormal - neutralNormal; - currentDelta.m_normalX = Compress(deltaNormal.GetX(), -2.0f, 2.0f); - currentDelta.m_normalY = Compress(deltaNormal.GetY(), -2.0f, 2.0f); - currentDelta.m_normalZ = Compress(deltaNormal.GetZ(), -2.0f, 2.0f); + currentDelta.m_normalX = Compress(deltaNormal.GetX(), MorphTargetDeltaConstants::s_tangentSpaceDeltaMin, MorphTargetDeltaConstants::s_tangentSpaceDeltaMax); + currentDelta.m_normalY = Compress(deltaNormal.GetY(), MorphTargetDeltaConstants::s_tangentSpaceDeltaMin, MorphTargetDeltaConstants::s_tangentSpaceDeltaMax); + currentDelta.m_normalZ = Compress(deltaNormal.GetZ(), MorphTargetDeltaConstants::s_tangentSpaceDeltaMin, MorphTargetDeltaConstants::s_tangentSpaceDeltaMax); } // Tangent { // Insert zero-delta until morphed tangents are supported in SceneAPI - currentDelta.m_tangentX = Compress(0.0f, -2.0f, 2.0f); - currentDelta.m_tangentY = Compress(0.0f, -2.0f, 2.0f); - currentDelta.m_tangentZ = Compress(0.0f, -2.0f, 2.0f); + currentDelta.m_tangentX = Compress(0.0f, MorphTargetDeltaConstants::s_tangentSpaceDeltaMin, MorphTargetDeltaConstants::s_tangentSpaceDeltaMax); + currentDelta.m_tangentY = Compress(0.0f, MorphTargetDeltaConstants::s_tangentSpaceDeltaMin, MorphTargetDeltaConstants::s_tangentSpaceDeltaMax); + currentDelta.m_tangentZ = Compress(0.0f, MorphTargetDeltaConstants::s_tangentSpaceDeltaMin, MorphTargetDeltaConstants::s_tangentSpaceDeltaMax); } // Bitangent { // Insert zero-delta until morphed bitangents are supported in SceneAPI - currentDelta.m_bitangentX = Compress(0.0f, -2.0f, 2.0f); - currentDelta.m_bitangentY = Compress(0.0f, -2.0f, 2.0f); - currentDelta.m_bitangentZ = Compress(0.0f, -2.0f, 2.0f); + currentDelta.m_bitangentX = Compress(0.0f, MorphTargetDeltaConstants::s_tangentSpaceDeltaMin, MorphTargetDeltaConstants::s_tangentSpaceDeltaMax); + currentDelta.m_bitangentY = Compress(0.0f, MorphTargetDeltaConstants::s_tangentSpaceDeltaMin, MorphTargetDeltaConstants::s_tangentSpaceDeltaMax); + currentDelta.m_bitangentZ = Compress(0.0f, MorphTargetDeltaConstants::s_tangentSpaceDeltaMin, MorphTargetDeltaConstants::s_tangentSpaceDeltaMax); + } + + // Color + { + metaData.m_hasColorDeltas = true; + productMesh.m_hasMorphedColors = true; + currentDelta.m_colorR = Compress(0.0f, MorphTargetDeltaConstants::s_colorDeltaMin, MorphTargetDeltaConstants::s_colorDeltaMax); + currentDelta.m_colorG = Compress(0.0f, MorphTargetDeltaConstants::s_colorDeltaMin, MorphTargetDeltaConstants::s_colorDeltaMax); + currentDelta.m_colorB = Compress(0.0f, MorphTargetDeltaConstants::s_colorDeltaMin, MorphTargetDeltaConstants::s_colorDeltaMax); + currentDelta.m_colorA = Compress(0.0f, MorphTargetDeltaConstants::s_colorDeltaMin, MorphTargetDeltaConstants::s_colorDeltaMax); } } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp index e05dc6f506..c64f08e4f8 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Culling.cpp @@ -237,25 +237,23 @@ namespace AZ } } - void CullingSystem::RegisterOrUpdateCullable(Cullable& cullable) + void CullingScene::RegisterOrUpdateCullable(Cullable& cullable) { - // [GFX TODO][ATOM-15036] Remove lock from CullingSystem visibility updates - m_mutex.lock(); - AZ::Interface::Get()->InsertOrUpdateEntry(cullable.m_cullData.m_visibilityEntry); - m_mutex.unlock(); + m_cullDataConcurrencyCheck.soft_lock(); + m_visScene->InsertOrUpdateEntry(cullable.m_cullData.m_visibilityEntry); + m_cullDataConcurrencyCheck.soft_unlock(); } - void CullingSystem::UnregisterCullable(Cullable& cullable) + void CullingScene::UnregisterCullable(Cullable& cullable) { - // [GFX TODO][ATOM-15036] Remove lock from CullingSystem visibility updates - m_mutex.lock(); - AZ::Interface::Get()->RemoveEntry(cullable.m_cullData.m_visibilityEntry); - m_mutex.unlock(); + m_cullDataConcurrencyCheck.soft_lock(); + m_visScene->RemoveEntry(cullable.m_cullData.m_visibilityEntry); + m_cullDataConcurrencyCheck.soft_unlock(); } - uint32_t CullingSystem::GetNumCullables() const + uint32_t CullingScene::GetNumCullables() const { - return AZ::Interface::Get()->GetEntryCount(); + return m_visScene->GetEntryCount(); } class AddObjectsToViewJob final @@ -269,10 +267,10 @@ namespace AZ const Scene* m_scene; View* m_view; Frustum m_frustum; - CullingSystem::WorkListType m_worklist; + CullingScene::WorkListType m_worklist; public: - AddObjectsToViewJob(CullingDebugContext& debugCtx, const Scene& scene, View& view, Frustum& frustum, CullingSystem::WorkListType& worklist) + AddObjectsToViewJob(CullingDebugContext& debugCtx, const Scene& scene, View& view, Frustum& frustum, CullingScene::WorkListType& worklist) : Job(true, nullptr) //auto-deletes, no JobContext , m_debugCtx(&debugCtx) , m_scene(&scene) @@ -292,7 +290,7 @@ namespace AZ uint32_t numDrawPackets = 0; uint32_t numVisibleCullables = 0; - for (const AzFramework::IVisibilitySystem::NodeData& nodeData : m_worklist) + for (const AzFramework::IVisibilityScene::NodeData& nodeData : m_worklist) { //If a node is entirely contained within the frustum, then we can skip the fine grained culling. bool nodeIsContainedInFrustum = ShapeIntersection::Contains(m_frustum, nodeData.m_bounds); @@ -415,9 +413,9 @@ namespace AZ } }; - void CullingSystem::ProcessCullables(const Scene& scene, View& view, AZ::Job& parentJob) + void CullingScene::ProcessCullables(const Scene& scene, View& view, AZ::Job& parentJob) { - AZ_PROFILE_SCOPE_DYNAMIC(Debug::ProfileCategory::AzRender, "CullingSystem::ProcessCullables() - %s", view.GetName().GetCStr()); + AZ_PROFILE_SCOPE_DYNAMIC(Debug::ProfileCategory::AzRender, "CullingScene::ProcessCullables() - %s", view.GetName().GetCStr()); const Matrix4x4& worldToClip = view.GetWorldToClipMatrix(); Frustum frustum = Frustum::CreateFromMatrixColumnMajor(worldToClip); @@ -447,7 +445,7 @@ namespace AZ } WorkListType worklist; - auto nodeVisitorLambda = [this, &scene, &view, &parentJob, &frustum, &worklist](const AzFramework::IVisibilitySystem::NodeData& nodeData) -> void + auto nodeVisitorLambda = [this, &scene, &view, &parentJob, &frustum, &worklist](const AzFramework::IVisibilityScene::NodeData& nodeData) -> void { AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "nodeVisitorLambda()"); AZ_Assert(nodeData.m_entries.size() > 0, "should not get called with 0 entries"); @@ -469,11 +467,11 @@ namespace AZ if (m_debugCtx.m_enableFrustumCulling) { - AZ::Interface::Get()->Enumerate(frustum, nodeVisitorLambda); + m_visScene->Enumerate(frustum, nodeVisitorLambda); } else { - AZ::Interface::Get()->EnumerateNoCull(nodeVisitorLambda); + m_visScene->EnumerateNoCull(nodeVisitorLambda); } if (worklist.size() > 0) @@ -534,23 +532,34 @@ namespace AZ return numVisibleDrawPackets; } - void CullingSystem::Activate(const Scene* parentScene) + void CullingScene::Activate(const Scene* parentScene) { m_parentScene = parentScene; + AZ_Assert(m_visScene == nullptr, "IVisibilityScene already created for this RPI::Scene"); + char sceneIdBuf[40] = ""; + m_parentScene->GetId().ToString(sceneIdBuf); + AZ::Name visSceneName(AZStd::string::format("RenderCullScene[%s]", sceneIdBuf)); + m_visScene = AZ::Interface::Get()->CreateVisibilityScene(visSceneName); + #ifdef AZ_CULL_DEBUG_ENABLED AZ_Assert(CountObjectsInScene() == 0, "The culling system should start with 0 entries in this scene."); #endif } - void CullingSystem::Deactivate() + void CullingScene::Deactivate() { #ifdef AZ_CULL_DEBUG_ENABLED AZ_Assert(CountObjectsInScene() == 0, "All culling entries must be removed from the scene before shutdown."); #endif + if (m_visScene) + { + AZ::Interface::Get()->DestroyVisibilityScene(m_visScene); + m_visScene = nullptr; + } } - void CullingSystem::BeginCulling(const AZStd::vector& views) + void CullingScene::BeginCulling(const AZStd::vector& views) { m_cullDataConcurrencyCheck.soft_lock(); @@ -591,16 +600,16 @@ namespace AZ } } - void CullingSystem::EndCulling() + void CullingScene::EndCulling() { m_cullDataConcurrencyCheck.soft_unlock(); } - size_t CullingSystem::CountObjectsInScene() + size_t CullingScene::CountObjectsInScene() { size_t numObjects = 0; - AZ::Interface::Get()->EnumerateNoCull( - [this, &numObjects](const AzFramework::IVisibilitySystem::NodeData& nodeData) + m_visScene->EnumerateNoCull( + [this, &numObjects](const AzFramework::IVisibilityScene::NodeData& nodeData) { for (AzFramework::VisibilityEntry* visibleEntry : nodeData.m_entries) { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RasterPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RasterPass.cpp index a9c2714653..84d1499602 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RasterPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RasterPass.cpp @@ -136,15 +136,16 @@ namespace AZ // -- View & DrawList -- const AZStd::vector& views = m_pipeline->GetViews(GetPipelineViewTag()); m_drawListView = {}; - for (const ViewPtr& view : views) + + if (!views.empty()) { + const ViewPtr& view = views.front(); + // Assert the view has our draw list (the view's DrawlistTags are collected from passes using its viewTag) AZ_Assert(view->HasDrawListTag(m_drawListTag), "View's DrawListTags out of sync with pass'. "); // Draw List m_drawListView = view->GetDrawList(m_drawListTag); - - break; } RenderPass::FrameBeginInternal(params); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp index dc3b56e7d3..00054881a1 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Scene.cpp @@ -85,7 +85,7 @@ namespace AZ Scene::Scene() { m_id = Uuid::CreateRandom(); - m_cullingSystem = aznew CullingSystem(); + m_cullingScene = aznew CullingScene(); SceneRequestBus::Handler::BusConnect(m_id); } @@ -105,7 +105,7 @@ namespace AZ m_pipelines.clear(); AZ::RPI::PassSystemInterface::Get()->ProcessQueuedChanges(); - delete m_cullingSystem; + delete m_cullingScene; } void Scene::Activate() @@ -114,7 +114,7 @@ namespace AZ m_activated = true; - m_cullingSystem->Activate(this); + m_cullingScene->Activate(this); // We have to tick the PassSystem in order for all the pass attachments to get created. // This has to be done before FeatureProcessors are activated, because they may try to @@ -139,7 +139,7 @@ namespace AZ fp->Deactivate(); } - m_cullingSystem->Deactivate(); + m_cullingScene->Deactivate(); m_activated = false; m_pipelineStatesLookup.clear(); @@ -424,8 +424,8 @@ namespace AZ // Init render packet m_renderPacket.m_views.clear(); - AZ_Assert(m_cullingSystem, "Culling System is not initialized"); - m_renderPacket.m_cullingSystem = m_cullingSystem; + AZ_Assert(m_cullingScene, "m_cullingScene is not initialized"); + m_renderPacket.m_cullingScene = m_cullingScene; m_renderPacket.m_jobPolicy = jobPolicy; @@ -486,15 +486,15 @@ namespace AZ } // Launch CullingSystem::ProcessCullables() jobs (will run concurrently with FeatureProcessor::Render() jobs) - m_cullingSystem->BeginCulling(m_renderPacket.m_views); + m_cullingScene->BeginCulling(m_renderPacket.m_views); for (ViewPtr& viewPtr : m_renderPacket.m_views) { AZ::Job* processCullablesJob = AZ::CreateJobFunction([this, &viewPtr](AZ::Job& thisJob) { - m_cullingSystem->ProcessCullables(*this, *viewPtr, thisJob); + m_cullingScene->ProcessCullables(*this, *viewPtr, thisJob); }, true, nullptr); //auto-deletes - if (m_cullingSystem->GetDebugContext().m_parallelOctreeTraversal) + if (m_cullingScene->GetDebugContext().m_parallelOctreeTraversal) { processCullablesJob->SetDependent(collectDrawPacketsCompletion); processCullablesJob->Start(); @@ -507,7 +507,7 @@ namespace AZ WaitAndCleanCompletionJob(collectDrawPacketsCompletion); - m_cullingSystem->EndCulling(); + m_cullingScene->EndCulling(); // Add dynamic draw data for all the views if (m_dynamicDrawSystem) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderVariantAsyncLoader.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderVariantAsyncLoader.cpp index 5b58e6ec6c..92ab90a9ab 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderVariantAsyncLoader.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderVariantAsyncLoader.cpp @@ -103,7 +103,6 @@ namespace AZ pairItor->m_shaderAsset->GetShaderOptionGroupLayout(), pairItor->m_shaderVariantId); if (searchResult.IsRoot()) { - AZ_Error(LogName, false, "Searching for a variant should never yield the root variant: %s", shaderVariantTreeAsset.GetHint().c_str()); pairItor = newShaderVariantPendingRequests.erase(pairItor); continue; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/MorphTargetDelta.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/MorphTargetDelta.cpp index 287f7892c7..d49d42a001 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/MorphTargetDelta.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/MorphTargetDelta.cpp @@ -18,7 +18,7 @@ namespace AZ::RPI PackedCompressedMorphTargetDelta PackMorphTargetDelta(const CompressedMorphTargetDelta& compressedDelta) { - PackedCompressedMorphTargetDelta packedDelta{ 0,0,0,0,0,{0,0,0} }; + PackedCompressedMorphTargetDelta packedDelta{ 0,0,0,0,0,0,{0,0} }; packedDelta.m_morphedVertexIndex = compressedDelta.m_morphedVertexIndex; // Position x is in the most significant 16 bits, y is in the least significant 16 bits @@ -45,6 +45,12 @@ namespace AZ::RPI packedDelta.m_padBitangentXYZ |= static_cast(compressedDelta.m_bitangentY) << 8; packedDelta.m_padBitangentXYZ |= static_cast(compressedDelta.m_bitangentZ); + // Colors are in the least significant 24 bits (8 bits per channel) + packedDelta.m_colorRGBA |= static_cast(compressedDelta.m_colorR) << 24; + packedDelta.m_colorRGBA |= static_cast(compressedDelta.m_colorG) << 16; + packedDelta.m_colorRGBA |= static_cast(compressedDelta.m_colorB) << 8; + packedDelta.m_colorRGBA |= static_cast(compressedDelta.m_colorA); + return packedDelta; } @@ -77,6 +83,12 @@ namespace AZ::RPI compressedDelta.m_bitangentY = (packedDelta.m_padBitangentXYZ >> 8 ) & 0x000000FF; compressedDelta.m_bitangentZ = packedDelta.m_padBitangentXYZ & 0x000000FF; + // Colors are 4 channels, 8 bits per channel + compressedDelta.m_colorR = (packedDelta.m_colorRGBA >> 24) & 0x000000FF; + compressedDelta.m_colorG = (packedDelta.m_colorRGBA >> 16) & 0x000000FF; + compressedDelta.m_colorB = (packedDelta.m_colorRGBA >> 8) & 0x000000FF; + compressedDelta.m_colorA = packedDelta.m_colorRGBA & 0x000000FF; + return compressedDelta; } } // namespace AZ::RPI diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/MorphTargetMetaAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/MorphTargetMetaAsset.cpp index ce91e66bd5..313e0bea31 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/MorphTargetMetaAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/MorphTargetMetaAsset.cpp @@ -28,6 +28,7 @@ namespace AZ::RPI ->Field("numVertices", &MorphTargetMetaAsset::MorphTarget::m_numVertices) ->Field("minPositionDelta", &MorphTargetMetaAsset::MorphTarget::m_minPositionDelta) ->Field("maxPositionDelta", &MorphTargetMetaAsset::MorphTarget::m_maxPositionDelta) + ->Field("hasColorDeltas", &MorphTargetMetaAsset::MorphTarget::m_hasColorDeltas) ; } } diff --git a/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp b/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp index e80e2870bb..980a9ac320 100644 --- a/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp @@ -934,6 +934,7 @@ namespace UnitTest // *---*---*---* // \ / \ / \ / \ // *---*---*---* + template class TD; class TwoSeparatedPlanesMesh { public: diff --git a/Gems/Atom/RPI/Code/Tests/System/SceneTests.cpp b/Gems/Atom/RPI/Code/Tests/System/SceneTests.cpp index 527ea76b18..9acdc264c0 100644 --- a/Gems/Atom/RPI/Code/Tests/System/SceneTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/System/SceneTests.cpp @@ -204,6 +204,8 @@ namespace UnitTest EXPECT_TRUE(feature->m_viewSetCount == 1); pipeline2->SetPersistentView(viewTag, nullptr); EXPECT_TRUE(feature->m_viewSetCount == 2); + + testScene->Deactivate(); } TEST_F(SceneTests, SceneNotificationTest_ConnectAfterRenderPipelineAdded) @@ -253,6 +255,8 @@ namespace UnitTest EXPECT_TRUE(feature->m_lastPipeline == pipeline1.get()); EXPECT_TRUE(feature->m_viewSetCount == 1); EXPECT_TRUE(feature->m_pipelineChangedCount == 0); + + testScene->Deactivate(); } @@ -286,6 +290,8 @@ namespace UnitTest testScene->DisableFeatureProcessor(); EXPECT_TRUE(testScene->GetFeatureProcessor() == nullptr); EXPECT_TRUE(testScene->GetFeatureProcessor() == nullptr); + + testScene->Deactivate(); } TEST_F(SceneTests, GetFeatureProcessorByNameId_UsingStringForFeatureProcessorId_ReturnsValidFeatureProcessor) @@ -297,6 +303,8 @@ namespace UnitTest testScene->Activate(); EXPECT_TRUE(testScene->GetFeatureProcessor(FeatureProcessorId{ "TestFeatureProcessor1" }) != nullptr); + + testScene->Deactivate(); } // @@ -315,6 +323,8 @@ namespace UnitTest FeatureProcessor* secondImplementation = testScene->EnableFeatureProcessor(FeatureProcessorId{ TestFeatureProcessorImplementation2::RTTI_TypeName() }); EXPECT_TRUE(secondImplementation != nullptr); + + testScene->Deactivate(); } TEST_F(SceneTests, EnableDisableFeatureProcessorByType_MultipleImplmentationsOfTheSameInterface_ReturnsValidFeatureProcessor) @@ -330,6 +340,8 @@ namespace UnitTest FeatureProcessor* secondImplementation = testScene->EnableFeatureProcessor(); EXPECT_TRUE(secondImplementation != nullptr); + + testScene->Deactivate(); } TEST_F(SceneTests, GetFeatureProcessorByNameId_MultipleImplmentationsOfTheSameInterface_ReturnsValidFeatureProcessor) @@ -347,6 +359,8 @@ namespace UnitTest FeatureProcessor* secondImplementation = testScene->EnableFeatureProcessor(); featureProcessor = testScene->GetFeatureProcessor(FeatureProcessorId{ TestFeatureProcessorImplementation2::RTTI_TypeName() }); EXPECT_TRUE(secondImplementation == featureProcessor); + + testScene->Deactivate(); } TEST_F(SceneTests, GetFeatureProcessorByInterface_MultipleImplmentationsOfTheSameInterface_ReturnsValidFeatureProcessor) @@ -366,6 +380,8 @@ namespace UnitTest featureProcessorInterface = testScene->GetFeatureProcessor(); EXPECT_TRUE(secondImplementation == featureProcessorInterface); + + testScene->Deactivate(); } // @@ -384,6 +400,8 @@ namespace UnitTest EXPECT_TRUE(featureProcessor == nullptr); EXPECT_TRUE(testScene->GetFeatureProcessor() == nullptr); EXPECT_TRUE(testScene->GetFeatureProcessor() == nullptr); + + testScene->Deactivate(); } TEST_F(SceneTests, DisableFeatureProcessor_ByInterface_FailsToDisable) @@ -396,6 +414,8 @@ namespace UnitTest testScene->DisableFeatureProcessor(FeatureProcessorId{ TestFeatureProcessorInterface::RTTI_TypeName() }); EXPECT_TRUE(testScene->GetFeatureProcessor() != nullptr); EXPECT_TRUE(testScene->GetFeatureProcessor() != nullptr); + + testScene->Deactivate(); } TEST_F(SceneTests, EnableFeatureProcessor_MultipleImplmentationsOfTheSameInterface_FailsToEnable) @@ -416,6 +436,8 @@ namespace UnitTest // If another implementation that uses the same interface exists, that will be the feature processor that is returned EXPECT_TRUE(secondImplementation == firstImplementation); + + testScene->Deactivate(); } } // namespace UnitTest diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp index 9fe3c8093c..31a291c845 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "Inspector/ui_InspectorWidget.h" +#include namespace AtomToolsFramework { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditor.ico b/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditor.ico deleted file mode 100644 index 0ab3150890..0000000000 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditor.ico +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:41c2e2ba186961c89b25789cdd3f59655367f5a6529c1cf6bb49cef5b7252406 -size 103713 diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/MaterialEditor.ico b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/MaterialEditor.ico new file mode 100644 index 0000000000..ce7d79def7 --- /dev/null +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/MaterialEditor.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40dd06da9f9dcfef7536255fb53278c9dc4e7ee175d0395f655df6714912ce02 +size 109153 diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditor.rc b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/MaterialEditor.rc similarity index 100% rename from Gems/Atom/Tools/MaterialEditor/Code/Source/MaterialEditor.rc rename to Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/MaterialEditor.rc diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/platform_windows_files.cmake b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/platform_windows_files.cmake index e5882dcd3d..7c6923b5f8 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/platform_windows_files.cmake +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Platform/Windows/platform_windows_files.cmake @@ -13,4 +13,5 @@ set(FILES MaterialEditor_Traits_Platform.h MaterialEditor_Traits_Windows.h MaterialEditor_Windows.cpp + MaterialEditor.rc ) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp index ece05f04c1..e1bfaa3872 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp @@ -357,6 +357,11 @@ namespace MaterialEditor return; } + if (preset->m_modelAsset.GetId() == m_modelAssetId) + { + return; + } + AZ::Render::MeshComponentRequestBus::Event(m_modelEntity->GetId(), &AZ::Render::MeshComponentRequestBus::Events::SetModelAsset, preset->m_modelAsset); diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.h index 9eaa2db5c7..bf39671343 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.h @@ -14,7 +14,7 @@ #include -#include +#include #include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.h index 3dd1147ce0..f516ecf28a 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/PresetBrowserDialogs/PresetBrowserDialog.h @@ -18,7 +18,7 @@ #include #endif -#include +#include class QImage; class QListWidgetItem; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.cpp index 0b3c5e1cfc..dad4a34b1e 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.cpp @@ -1,30 +1,29 @@ /* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ -#include -#include -#include #include +#include #include - #include -#include +#include +#include +#include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT #include +#include #include #include #include -#include AZ_POP_DISABLE_WARNING namespace MaterialEditor @@ -35,24 +34,25 @@ namespace MaterialEditor AzQtComponents::ToolBar::addMainToolBarStyle(this); // Add toggle grid button - QAction* toggleGrid = addAction(QIcon(":/Icons/grid.svg"), "Toggle Grid"); - toggleGrid->setCheckable(true); - connect(toggleGrid, &QAction::triggered, [this, toggleGrid]() { - MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SetGridEnabled, toggleGrid->isChecked()); - }); + m_toggleGrid = addAction(QIcon(":/Icons/grid.svg"), "Toggle Grid"); + m_toggleGrid->setCheckable(true); + connect(m_toggleGrid, &QAction::triggered, [this]() { + MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SetGridEnabled, m_toggleGrid->isChecked()); + }); bool enableGrid = false; MaterialViewportRequestBus::BroadcastResult(enableGrid, &MaterialViewportRequestBus::Events::GetGridEnabled); - toggleGrid->setChecked(enableGrid); + m_toggleGrid->setChecked(enableGrid); // Add toggle shadow catcher button - QAction* toggleShadowCatcher = addAction(QIcon(":/Icons/shadow.svg"), "Toggle Shadow Catcher"); - toggleShadowCatcher->setCheckable(true); - connect(toggleShadowCatcher, &QAction::triggered, [this, toggleShadowCatcher]() { - MaterialViewportRequestBus::Broadcast(&MaterialViewportRequestBus::Events::SetShadowCatcherEnabled, toggleShadowCatcher->isChecked()); - }); + m_toggleShadowCatcher = addAction(QIcon(":/Icons/shadow.svg"), "Toggle Shadow Catcher"); + m_toggleShadowCatcher->setCheckable(true); + connect(m_toggleShadowCatcher, &QAction::triggered, [this]() { + MaterialViewportRequestBus::Broadcast( + &MaterialViewportRequestBus::Events::SetShadowCatcherEnabled, m_toggleShadowCatcher->isChecked()); + }); bool enableShadowCatcher = false; MaterialViewportRequestBus::BroadcastResult(enableShadowCatcher, &MaterialViewportRequestBus::Events::GetShadowCatcherEnabled); - toggleShadowCatcher->setChecked(enableShadowCatcher); + m_toggleShadowCatcher->setChecked(enableShadowCatcher); // Add mapping selection button //[GFX TODO][ATOM-3992] @@ -60,13 +60,13 @@ namespace MaterialEditor QMenu* toneMappingMenu = new QMenu(toneMappingButton); toneMappingMenu->addAction("None", [this]() { MaterialEditorSettingsRequestBus::Broadcast(&MaterialEditorSettingsRequests::SetStringProperty, "toneMapping", "None"); - }); + }); toneMappingMenu->addAction("Gamma2.2", [this]() { MaterialEditorSettingsRequestBus::Broadcast(&MaterialEditorSettingsRequests::SetStringProperty, "toneMapping", "Gamma2.2"); - }); + }); toneMappingMenu->addAction("ACES", [this]() { MaterialEditorSettingsRequestBus::Broadcast(&MaterialEditorSettingsRequests::SetStringProperty, "toneMapping", "ACES"); - }); + }); toneMappingButton->setMenu(toneMappingMenu); toneMappingButton->setText("Tone Mapping"); toneMappingButton->setIcon(QIcon(":/Icons/toneMapping.svg")); @@ -85,7 +85,25 @@ namespace MaterialEditor auto lightingPresetComboBox = new LightingPresetComboBox(this); lightingPresetComboBox->setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy::AdjustToContents); addWidget(lightingPresetComboBox); + + MaterialViewportNotificationBus::Handler::BusConnect(); + } + + MaterialEditorToolBar::~MaterialEditorToolBar() + { + MaterialViewportNotificationBus::Handler::BusDisconnect(); } + + void MaterialEditorToolBar::OnGridEnabledChanged(bool enable) + { + m_toggleGrid->setChecked(enable); + } + + void MaterialEditorToolBar::OnShadowCatcherEnabledChanged(bool enable) + { + m_toggleShadowCatcher->setChecked(enable); + } + } // namespace MaterialEditor #include diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.h index 63dd5ae84d..147608bc23 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.h @@ -13,16 +13,28 @@ #pragma once #if !defined(Q_MOC_RUN) +#include #include +#include #endif namespace MaterialEditor { class MaterialEditorToolBar : public QToolBar + , public MaterialViewportNotificationBus::Handler { Q_OBJECT public: MaterialEditorToolBar(QWidget* parent = 0); + ~MaterialEditorToolBar(); + + private: + // MaterialViewportNotificationBus::Handler overrides... + void OnShadowCatcherEnabledChanged([[maybe_unused]] bool enable) override; + void OnGridEnabledChanged([[maybe_unused]] bool enable) override; + + QAction* m_toggleGrid = {}; + QAction* m_toggleShadowCatcher = {}; }; } // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp index ee936d7476..8efed36197 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ViewportSettingsInspector/ViewportSettingsInspector.cpp @@ -134,7 +134,7 @@ namespace MaterialEditor if (m_modelPreset) { auto inspectorWidget = new AtomToolsFramework::InspectorPropertyGroupWidget( - m_modelPreset.get(), nullptr, m_modelPreset.get()->TYPEINFO_Uuid(), nullptr, groupWidget); + m_modelPreset.get(), nullptr, m_modelPreset.get()->TYPEINFO_Uuid(), this, groupWidget); groupWidget->layout()->addWidget(inspectorWidget); } @@ -221,7 +221,7 @@ namespace MaterialEditor if (m_lightingPreset) { auto inspectorWidget = new AtomToolsFramework::InspectorPropertyGroupWidget( - m_lightingPreset.get(), nullptr, m_lightingPreset.get()->TYPEINFO_Uuid(), nullptr, groupWidget); + m_lightingPreset.get(), nullptr, m_lightingPreset.get()->TYPEINFO_Uuid(), this, groupWidget); groupWidget->layout()->addWidget(inspectorWidget); } diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/main.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/main.cpp index eb80638a4d..92d76c4373 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/main.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/main.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/ShaderManagementConsole.ico b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/ShaderManagementConsole.ico new file mode 100644 index 0000000000..05273e213f --- /dev/null +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/ShaderManagementConsole.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:090db466524f15068d1bc30466e51a7123f403798176a273e8060abf72d366d8 +size 109469 diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsole.rc b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/ShaderManagementConsole.rc similarity index 100% rename from Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsole.rc rename to Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/ShaderManagementConsole.rc diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/platform_windows_files.cmake b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/platform_windows_files.cmake index bf1e8d6fec..aa202bad51 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/platform_windows_files.cmake +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Platform/Windows/platform_windows_files.cmake @@ -13,4 +13,5 @@ set(FILES ShaderManagementConsole_Traits_Platform.h ShaderManagementConsole_Traits_Windows.h ShaderManagementConsole_Windows.cpp + ShaderManagementConsole.rc ) diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsole.ico b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsole.ico deleted file mode 100644 index 0ab3150890..0000000000 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/ShaderManagementConsole.ico +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:41c2e2ba186961c89b25789cdd3f59655367f5a6529c1cf6bb49cef5b7252406 -size 103713 diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/main.cpp b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/main.cpp index 5692522e58..795b835027 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/main.cpp +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/main.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiCullingDebug.inl b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiCullingDebug.inl index a6f1a34ad2..1b1adb0f3c 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiCullingDebug.inl +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiCullingDebug.inl @@ -30,8 +30,8 @@ namespace AZ { using namespace RPI; - CullingSystem* cullSys = scene->GetCullingSystem(); - CullingDebugContext& debugCtx = cullSys->GetDebugContext(); + CullingScene* cullScene = scene->GetCullingScene(); + CullingDebugContext& debugCtx = cullScene->GetDebugContext(); ImGui::SetNextWindowSize(ImVec2(900.f, 700.f), ImGuiCond_Once); if (ImGui::Begin("Culling Debug", &draw, ImGuiWindowFlags_None)) diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiFrameVisualizer.inl b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiFrameVisualizer.inl index 15c6990dcc..b5cf2e8f6b 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiFrameVisualizer.inl +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiFrameVisualizer.inl @@ -454,7 +454,6 @@ namespace ImGui { return m_rootNode->AddChild(name, numInputs, numOutputs); } - return nullptr; } //!Resolve all the overlapping nodes. diff --git a/Gems/AtomLyIntegration/AtomImGuiTools/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomImGuiTools/Code/CMakeLists.txt index d653d54f6b..82db2c7271 100644 --- a/Gems/AtomLyIntegration/AtomImGuiTools/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomImGuiTools/Code/CMakeLists.txt @@ -17,8 +17,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PUBLIC AZ::AzCore @@ -34,8 +32,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE Gem::AtomImGuiTools.Static diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/AreaLightBus.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/AreaLightBus.h index 76ac5f6123..f4cb319c2f 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/AreaLightBus.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/AreaLightBus.h @@ -77,6 +77,72 @@ namespace AZ //! Sets the photometric unit to the one provided and converts the intensity to the photometric unit so actual light intensity remains constant. virtual void ConvertToIntensityMode(PhotometricUnit intensityMode) = 0; + + // Shutters + + //! Returns true if shutters are enabled. + virtual bool GetEnableShutters() const = 0; + + //! Sets if shutters should be enabled. + virtual void SetEnableShutters(bool enabled) = 0; + + //! Returns the inner angle of the shutters in degrees + virtual float GetInnerShutterAngle() const = 0; + + //! Sets the inner angle of the shutters in degrees + virtual void SetInnerShutterAngle(float degrees) = 0; + + //! Returns the outer angle of the shutters in degrees + virtual float GetOuterShutterAngle() const = 0; + + //! Sets the outer angle of the shutters in degrees + virtual void SetOuterShutterAngle(float degrees) = 0; + + // Shadows + + //! Returns true if shadows are enabled. + virtual bool GetEnableShadow() const = 0; + + //! Sets if shadows should be enabled. + virtual void SetEnableShadow(bool enabled) = 0; + + //! Returns the maximum width and height of shadowmap. + virtual ShadowmapSize GetShadowmapMaxSize() const = 0; + + //! Sets the maximum width and height of shadowmap. + virtual void SetShadowmapMaxSize(ShadowmapSize size) = 0; + + //! Returns the filter method of shadows. + virtual ShadowFilterMethod GetShadowFilterMethod() const = 0; + + //! Sets the filter method of shadows. + virtual void SetShadowFilterMethod(ShadowFilterMethod method) = 0; + + //! Gets the width of softening boundary between shadowed area and lit area in degrees. + virtual float GetSofteningBoundaryWidthAngle() const = 0; + + //! Sets the width of softening boundary between shadowed area and lit area in degrees. + //! 0 disables softening. + virtual void SetSofteningBoundaryWidthAngle(float degrees) = 0; + + //! Gets the sample count to predict boundary of shadow. + virtual uint32_t GetPredictionSampleCount() const = 0; + + //! Sets the sample count to predict boundary of shadow. Maximum 16, and should also be + //! less than the filtering sample count. + virtual void SetPredictionSampleCount(uint32_t count) = 0; + + //! Gets the sample count for filtering of the shadow boundary. + virtual uint32_t GetFilteringSampleCount() const = 0; + + //! Sets the sample count for filtering of the shadow boundary. Maximum 64. + virtual void SetFilteringSampleCount(uint32_t count) = 0; + + //! Gets the type of Pcf (percentage-closer filtering) to use. + virtual PcfMethod GetPcfMethod() const = 0; + + //! Sets the type of Pcf (percentage-closer filtering) to use. + virtual void SetPcfMethod(PcfMethod method) = 0; }; //! The EBus for requests to for setting and getting light component properties. diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/AreaLightComponentConfig.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/AreaLightComponentConfig.h index 66a30285c2..857e795257 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/AreaLightComponentConfig.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/AreaLightComponentConfig.h @@ -14,9 +14,9 @@ #include #include +#include #include #include -#include namespace AZ { @@ -28,6 +28,20 @@ namespace AZ AZ_RTTI(AZ::Render::AreaLightComponentConfig, "{11C08FED-7F94-4926-8517-46D08E4DD837}", ComponentConfig); static void Reflect(AZ::ReflectContext* context); + enum class LightType : uint8_t + { + Unknown, + Sphere, + SpotDisk, + Capsule, + Quad, + Polygon, + SimplePoint, + SimpleSpot, + + LightTypeCount, + }; + static constexpr float CutoffIntensity = 0.1f; AZ::Color m_color = AZ::Color::CreateOne(); @@ -39,17 +53,50 @@ namespace AZ bool m_useFastApproximation = false; AZ::Crc32 m_shapeType; + bool m_enableShutters = false; + LightType m_lightType = LightType::Unknown; + float m_innerShutterAngleDegrees = 35.0f; + float m_outerShutterAngleDegrees = 45.0f; + + // Shadows (only used for supported shapes) + bool m_enableShadow = false; + ShadowmapSize m_shadowmapMaxSize = ShadowmapSize::Size256; + ShadowFilterMethod m_shadowFilterMethod = ShadowFilterMethod::None; + PcfMethod m_pcfMethod = PcfMethod::BoundarySearch; + float m_boundaryWidthInDegrees = 0.25f; + uint16_t m_predictionSampleCount = 4; + uint16_t m_filteringSampleCount = 12; + // The following functions provide information to an EditContext... + AZStd::vector> GetValidPhotometricUnits() const; + + bool RequiresShapeComponent() const; + //! Returns true if m_attenuationRadiusMode is set to LightAttenuationRadiusMode::Automatic bool IsAttenuationRadiusModeAutomatic() const; - //! Returns true if the shape type is a 2D surface - bool Is2DSurface() const; + //! Returns true if the shape type can emit light from both sides + bool SupportsBothDirections() const; //! Returns true if the light type supports a faster and less accurate approximation for the lighting algorithm. bool SupportsFastApproximation() const; + //! Returns true if the light type supports restricting the light beam to an angle + bool SupportsShutters() const; + + //! Returns true if the light type supports shutters, but they must be turned on. + bool ShuttersMustBeEnabled() const; + + //! Returns true if shutters are turned off + bool ShuttersDisabled() const; + + //! Returns true if the light type supports shadows. + bool SupportsShadows() const; + + //! Returns true if shadows are turned on + bool ShadowsDisabled() const; + //! Returns characters for a suffix for the light type including a space. " lm" for lumens for example. const char* GetIntensitySuffix() const; @@ -65,6 +112,15 @@ namespace AZ //! Returns the maximum intensity value for UI depending on the m_intensityMode, but users may still type in a greater value depending on GetIntensityMin(). float GetIntensitySoftMax() const; + //! Returns true if shadow filtering is disabled. + bool IsShadowFilteringDisabled() const; + + //! Returns true if pcf shadows are disabled. + bool IsShadowPcfDisabled() const; + + //! Returns true if pcf boundary search is disabled. + bool IsPcfBoundarySearchDisabled() const; + }; } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/CoreLightsConstants.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/CoreLightsConstants.h index 88ddebbbcd..7db19ec8b1 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/CoreLightsConstants.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/CoreLightsConstants.h @@ -22,10 +22,6 @@ namespace AZ { static constexpr const char* const AreaLightComponentTypeId = "{744B3961-6242-4461-983F-2817D9D29C30}"; static constexpr const char* const EditorAreaLightComponentTypeId = "{8B605C0C-9027-4E0B-BA8C-19E396F8F262}"; - static constexpr const char* const PointLightComponentTypeId = "{0A0E44AB-F583-481F-8AE8-68C4B1F9CD05}"; - static constexpr const char* const EditorPointLightComponentTypeId = "{C4D354BE-5247-41FD-9A8D-550C6772EE5B}"; - static constexpr const char* const SpotLightComponentTypeId = "{441DF0EC-6B70-451E-AEBE-6452A17BB852}"; - static constexpr const char* const EditorSpotLightComponentTypeId = "{9A32D37B-C5D2-43A7-B574-E2EA1CDC7D64}"; static constexpr const char* const DirectionalLightComponentTypeId = "{13054592-2753-46C2-B19E-59670D4CE03D}"; static constexpr const char* const EditorDirectionalLightComponentTypeId = "{45B97527-6E72-411B-BC23-00068CF01580}"; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h index c34c5dd62e..7ce844ca0b 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h @@ -182,6 +182,13 @@ namespace AZ //! This sets the sample count for filtering of the shadow boundary. //! @param count Sample Count for filtering (up to 64) virtual void SetFilteringSampleCount(uint32_t count) = 0; + + //! This gets the type of Pcf (percentage-closer filtering) to use. + virtual PcfMethod GetPcfMethod() const = 0; + + //! This sets the type of Pcf (percentage-closer filtering) to use. + //! @param method The Pcf method to use. + virtual void SetPcfMethod(PcfMethod method) = 0; }; using DirectionalLightRequestBus = EBus; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h index f1f794bed7..7de2857541 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h @@ -117,11 +117,14 @@ namespace AZ //! It is used only when the pixel is predicted as on the boundary. uint16_t m_filteringSampleCount = 32; + PcfMethod m_pcfMethod = PcfMethod::BoundarySearch; + bool IsSplitManual() const; bool IsSplitAutomatic() const; bool IsCascadeCorrectionDisabled() const; bool IsShadowFilteringDisabled() const; bool IsShadowPcfDisabled() const; + bool IsPcfBoundarySearchDisabled() const; }; } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/PointLightBus.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/PointLightBus.h deleted file mode 100644 index cdd8bb275d..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/PointLightBus.h +++ /dev/null @@ -1,130 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include -#include - -#include - -namespace AZ -{ - namespace Render - { - class PointLightRequests - : public ComponentBus - { - public: - AZ_RTTI(PointLightRequests, "{359BE514-DBEB-4D6A-B283-F8C5E83CD477}"); - - /// Overrides the default AZ::EBusTraits handler policy to allow one listener only. - static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single; - - virtual ~PointLightRequests() {} - - /// Gets a point light's color. This value is indepedent from its intensity. - virtual const Color& GetColor() const = 0; - - /// Sets a point light's color. This value is indepedent from its intensity. - virtual void SetColor(const Color& color) = 0; - - /// Gets a point light's intensity. This value is indepedent from its color. - virtual float GetIntensity() const = 0; - - //! Gets a point light's photometric type. - virtual PhotometricUnit GetIntensityMode() const = 0; - - /// Sets a point light's intensity. This value is indepedent from its color. - virtual void SetIntensity(float intensity) = 0; - - //! Sets a point light's intensity and intensity mode. This value is indepedent from its color. - virtual void SetIntensity(float intensity, PhotometricUnit intensityMode) = 0; - - /// Gets the distance at which the point light will no longer affect lighting. - virtual float GetAttenuationRadius() const = 0; - - /// Set the distance and which a point light will no longer affect lighitng. Setting this forces the RadiusCalculation to Explicit mode. - virtual void SetAttenuationRadius(float radius) = 0; - - /// Gets the size in meters of the sphere representing the light bulb. - virtual float GetBulbRadius() const = 0; - - /// Sets the size in meters of the sphere representing the light bulb in meters. - virtual void SetBulbRadius(float bulbSize) = 0; - - /* - * If this is set to Automatic, the radius will immediately be recalculated based on the intensity. - * If this is set to Explicit, the radius value will be unchanged from its previous value. - */ - virtual void SetAttenuationRadiusMode(LightAttenuationRadiusMode attenuationRadiusMode) = 0; - - /// Gets the flag whether attenuation radius calculation is automatic or not. - virtual bool GetAttenuationRadiusIsAutomatic() const = 0; - - /// Sets the flag whether attenuation radius calculation is automatic or not. - virtual void SetAttenuationRadiusIsAutomatic(bool flag) - { - SetAttenuationRadiusMode(flag ? LightAttenuationRadiusMode::Automatic : LightAttenuationRadiusMode::Explicit); - } - - //! Sets the photometric unit to the one provided and converts the intensity to the photometric unit so actual light intensity remains constant. - virtual void ConvertToIntensityMode(PhotometricUnit intensityMode) = 0; - }; - - /// The EBus for requests to for setting and getting light component properties. - typedef AZ::EBus PointLightRequestBus; - - class PointLightNotifications - : public ComponentBus - { - public: - AZ_RTTI(PointLightNotifications, "{7363728D-E3EE-4AC8-AAA7-C299782763F0}"); - - virtual ~PointLightNotifications() {} - - /** - * Signals that the color of the light changed. - * @param color A reference to the new color of the light. - */ - virtual void OnColorChanged(const Color& /*color*/) { } - - /** - * Signals that the intensity of the light changed. - * @param color A reference to the new intensity of the light. - */ - virtual void OnIntensityChanged(float /*intensity*/) { } - - /** - * Signals that the color or intensity of the light changed. This is useful when both the color and intensity are need in the same call. - * @param color A reference to the new color of the light. - * @param color A reference to the new intensity of the light. - */ - virtual void OnColorOrIntensityChanged(const Color& /*color*/, float /*intensity*/) { } - - /** - * Signals that the attenuation radius of the light changed. - * @param attenuationRadius The distance at which this light no longer affects lighting. - */ - virtual void OnAttenutationRadiusChanged(float /*attenuationRadius*/) { } - - /** - * Signals that the bulb size of the light changed. - * @param bulbRadius The size in meters of the sphere representing the light bulb in meters. - */ - virtual void OnBulbRadiusChanged(float /*bulbRadius*/) { } - - }; - - /// The EBus for light notification events. - typedef AZ::EBus PointLightNotificationBus; - - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/PointLightComponentConfig.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/PointLightComponentConfig.h deleted file mode 100644 index df8454ccc2..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/PointLightComponentConfig.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include -#include -#include -#include - -namespace AZ -{ - namespace Render - { - struct PointLightComponentConfig final - : public ComponentConfig - { - AZ_RTTI(PointLightComponentConfig, "{B6FC35BA-D22F-4C20-BFFC-3FE7A48858FA}", ComponentConfig); - static void Reflect(AZ::ReflectContext* context); - - static constexpr float DefaultIntensity = 800.0f; // 800 lumes is roughly equivalent to a 60 watt incandescent bulb - static constexpr float DefaultBulbRadius = 0.05f; // 5cm - - AZ::Color m_color = AZ::Color::CreateOne(); - PhotometricUnit m_intensityMode = PhotometricUnit::Lumen; - float m_intensity = DefaultIntensity; - float m_attenuationRadius = 0.0f; - float m_bulbRadius = DefaultBulbRadius; - LightAttenuationRadiusMode m_attenuationRadiusMode = LightAttenuationRadiusMode::Automatic; - - // Not serialized, but used to keep scaled and unscaled properties in sync. - float m_scale = 1.0f; - - // These values are used to deal adjusting the brightness and bulb radius based on the transform component's scale - // so that point lights scale concistently with meshes. Not serialized. - float m_unscaledIntensity = DefaultIntensity; - float m_unscaledBulbRadius = DefaultBulbRadius; - - //! Updates scale and adjusts the values of intensity and bulb radius based on the new scale and the unscaled values. - void UpdateScale(float newScale) - { - m_scale = newScale; - - m_intensity = m_unscaledIntensity; - - // Lumens & Candela aren't based on surface area, so scale them. - if (!IsAreaBasedIntensityMode()) - { - // Light surface area and brightness increases at scale^2 because of equation of sphere surface area. - m_intensity *= m_scale * m_scale; - } - - m_bulbRadius = m_unscaledBulbRadius * m_scale; - } - - //! Updates the unscaled intensity based on the current scaled value. - void UpdateUnscaledIntensity() - { - m_unscaledIntensity = m_intensity; - - // Lumens & Candela aren't based on surface area, so scale them. - if (!IsAreaBasedIntensityMode()) - { - // Light surface area and brightness increases at scale^2 because of equation of sphere surface area. - m_unscaledIntensity /= m_scale * m_scale; - } - } - - //! Updates the unscaled bulb radius based on the current scaled value. - void UpdateUnscaledBulbRadius() - { - m_unscaledBulbRadius = m_bulbRadius / m_scale; - } - - // Returns true if the intensity mode is an area based light unit (not lumens or candela) - bool IsAreaBasedIntensityMode() - { - return m_intensityMode != PhotometricUnit::Lumen && m_intensityMode != PhotometricUnit::Candela; - } - - // Returns the surface area of the light bulb. 4.0 * pi * m_bulbRadius^2 - float GetArea() - { - return 4.0f * Constants::Pi * m_bulbRadius * m_bulbRadius; - } - - // The following functions provide information to an EditContext... - - //! Returns true if m_attenuationRadiusMode is set to LightAttenuationRadiusMode::Automatic - bool IsAttenuationRadiusModeAutomatic() const - { - return m_attenuationRadiusMode == LightAttenuationRadiusMode::Automatic; - } - - //! Returns characters for a suffix for the light type including a space. " lm" for lumens for example. - const char* GetIntensitySuffix() const - { - return PhotometricValue::GetTypeSuffix(m_intensityMode); - } - - }; - } -} diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/SpotLightBus.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/SpotLightBus.h deleted file mode 100644 index 934059d76b..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/SpotLightBus.h +++ /dev/null @@ -1,172 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once -#include -#include -#include -#include - -namespace AZ -{ - namespace Render - { - class SpotLightRequests - : public ComponentBus - { - public: - //! Overrides the default AZ::EBusTraits handler policy to allow one listener only. - static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single; - - virtual ~SpotLightRequests() = default; - - //! Gets a spot light's color. This value is independent from its intensity. - virtual const Color& GetColor() const = 0; - - //! Sets a spot light's color. This value is independent from its intensity. - virtual void SetColor(const Color& color) = 0; - - //! Gets a spot light's intensity. This value is independent from its color. - virtual float GetIntensity() const = 0; - - //! Sets a spot light's intensity. This value is independent from its color. - virtual void SetIntensity(float intensity) = 0; - - //! Gets a spot light's bulb radius in meters. - virtual float GetBulbRadius() const = 0; - - //! Sets a spot light's bulb radius in meters. - virtual void SetBulbRadius(float bulbRadius) = 0; - - //! @return Returns inner cone angle of the spot light in degrees. - virtual float GetInnerConeAngleInDegrees() const = 0; - //! @brief Sets inner cone angle of the spot light in degrees. - virtual void SetInnerConeAngleInDegrees(float degrees) = 0; - - //! @return Returns outer cone angle of the spot light in degrees. - virtual float GetOuterConeAngleInDegrees() const = 0; - //! @brief Sets outer cone angle of the spot light in degrees. - virtual void SetOuterConeAngleInDegrees(float degrees) = 0; - - //! @return Returns penumbra bias for the falloff curve of the spot light. - virtual float GetPenumbraBias() const = 0; - //! @brief Sets penumbra bias for the falloff curve of the spot light. - virtual void SetPenumbraBias(float penumbraBias) = 0; - - //! @return Returns radius attenuation of the spot light. - virtual float GetAttenuationRadius() const = 0; - //! @return Sets radius attenuation of the spot light. - virtual void SetAttenuationRadius(float radius) = 0; - - //! @return Returns radius attenuation mode (Auto or Explicit). - virtual LightAttenuationRadiusMode GetAttenuationRadiusMode() const = 0; - //! If this is set to Automatic, the radius will immediately be recalculated based on the intensity. - //! If this is set to Explicit, the radius value will be unchanged from its previous value. - virtual void SetAttenuationRadiusMode(LightAttenuationRadiusMode attenuationRadiusMode) = 0; - - //! @return the flag whether attenuation radius calculation is automatic or not. - virtual bool GetAttenuationRadiusIsAutomatic() const - { - return (GetAttenuationRadiusMode() == LightAttenuationRadiusMode::Automatic); - } - //! This sets flag whether attenuation radius calculation is automatic or not. - //! @param flag flag whether attenuation radius calculation is automatic or not. - virtual void SetAttenuationRadiusIsAutomatic(bool flag) - { - SetAttenuationRadiusMode(flag ? LightAttenuationRadiusMode::Automatic : LightAttenuationRadiusMode::Explicit); - } - - //! @return the flag indicates this light have shadow or not. - virtual bool GetEnableShadow() const = 0; - //! This specify this spot light uses shadow or not. - //! @param enabled true if shadow is used, false otherwise. - virtual void SetEnableShadow(bool enabled) = 0; - - //! @return the size of shadowmap (width and height). - virtual ShadowmapSize GetShadowmapSize() const = 0; - - //! This specifies the size of shadowmap to size x size. - virtual void SetShadowmapSize(ShadowmapSize size) = 0; - - //! This gets the filter method of shadows. - //! @return filter method - virtual ShadowFilterMethod GetShadowFilterMethod() const = 0; - - //! This specifies filter method of shadows. - //! @param method Filter method. - virtual void SetShadowFilterMethod(ShadowFilterMethod method) = 0; - - //! This gets the width of boundary between shadowed area and lit area. - //! The width is given by the angle, and the units are in degrees. - //! @return Boundary width. The degree of the shadowed region is gradually changed on the boundary. - virtual float GetSofteningBoundaryWidthAngle() const = 0; - - //! This specifies the width of boundary between shadowed area and lit area. - //! @param width Boundary width. The degree of shadowed is gradually changed on the boundary. - //! If width == 0, softening edge is disabled. Units are in degrees. - virtual void SetSofteningBoundaryWidthAngle(float degrees) = 0; - - //! This gets the sample count to predict boundary of shadow. - //! @return Sample Count for prediction of whether the pixel is on the boundary (up to 16) - virtual uint32_t GetPredictionSampleCount() const = 0; - - //! This sets the sample count to predict boundary of shadow. - //! @param count Sample count for prediction of whether the pixel is on the boundary (up to 16) - //! This value should be less than or equal to m_filteringSampleCount. - virtual void SetPredictionSampleCount(uint32_t count) = 0; - - //! This gets the sample count for filtering of the shadow boundary. - //! @return Sample Count for filtering (up to 64) - virtual uint32_t GetFilteringSampleCount() const = 0; - - //! This sets the sample count for filtering of the shadow boundary. - //! @param count Sample Count for filtering (up to 64) - virtual void SetFilteringSampleCount(uint32_t count) = 0; - - //! This gets the type of Pcf (percentage-closer filtering) to use. - virtual PcfMethod GetPcfMethod() const = 0; - - //! This sets the type of Pcf (percentage-closer filtering) to use. - //! @param method The Pcf method to use. - virtual void SetPcfMethod(PcfMethod method) = 0; - }; - - /// The EBus for requests to for setting and getting spot light component properties. - typedef AZ::EBus SpotLightRequestBus; - - class SpotLightNotifications - : public ComponentBus - { - public: - virtual ~SpotLightNotifications() = default; - - //! @brief Signals that the intensity of the light changed. - virtual void OnIntensityChanged(float intensity) { AZ_UNUSED(intensity); } - - //! @brief Signals that the color of the light changed. - virtual void OnColorChanged(const Color& color) { AZ_UNUSED(color); } - - //! @brief Signals that the cone angles of the spot light have changed. - virtual void OnConeAnglesChanged(float innerConeAngleDegrees, float outerConeAngleDegrees) { AZ_UNUSED(innerConeAngleDegrees); AZ_UNUSED(outerConeAngleDegrees); } - - //! @brief Signals that the attenuation radius has changed. - virtual void OnAttenuationRadiusChanged(float attenuationRadius) { AZ_UNUSED(attenuationRadius); } - - //! @brief Signals that the penumbra bias has changed. - virtual void OnPenumbraBiasChanged(float penumbraBias) { AZ_UNUSED(penumbraBias); } - }; - - //! The EBus for spot light notification events. - typedef AZ::EBus SpotLightNotificationBus; - - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/SpotLightComponentConfig.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/SpotLightComponentConfig.h deleted file mode 100644 index 3cde1f23a0..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/SpotLightComponentConfig.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include -#include -#include -#include - -namespace AZ -{ - namespace Render - { - struct SpotLightComponentConfig final - : ComponentConfig - { - AZ_RTTI(SpotLightComponentConfig, "{20C882C8-615E-4272-93A8-BE9102E6EFED}", ComponentConfig); - static void Reflect(AZ::ReflectContext* context); - - AZ::Color m_color = AZ::Color::CreateOne(); - float m_intensity = 100.0f; - PhotometricUnit m_intensityMode = PhotometricUnit::Lumen; - float m_bulbRadius = 0.075; - float m_innerConeDegrees = 45.0f; - float m_outerConeDegrees = 55.0f; - float m_attenuationRadius = 20.0f; - float m_penumbraBias = 0.0f; - LightAttenuationRadiusMode m_attenuationRadiusMode = LightAttenuationRadiusMode::Automatic; - bool m_enabledShadow = false; - ShadowmapSize m_shadowmapSize = MaxShadowmapImageSize; - ShadowFilterMethod m_shadowFilterMethod = ShadowFilterMethod::None; - PcfMethod m_pcfMethod = PcfMethod::BoundarySearch; - float m_boundaryWidthInDegrees = 0.25f; - uint16_t m_predictionSampleCount = 4; - uint16_t m_filteringSampleCount = 32; - - // The following functions provide information to an EditContext... - - //! Returns true if m_attenuationRadiusMode is set to LightAttenuationRadiusMode::Automatic - bool IsAttenuationRadiusModeAutomatic() const; - - //! Returns characters for a suffix for the light type including a space. " lm" for lumens for example. - const char* GetIntensitySuffix() const; - - float GetConeDegrees() const; - bool IsShadowFilteringDisabled() const; - bool IsShadowPcfDisabled() const; - bool IsPcfBoundarySearchDisabled() const; - }; - } -} diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentConfig.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentConfig.cpp index 4312418f19..2afa6514cd 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentConfig.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentConfig.cpp @@ -21,7 +21,8 @@ namespace AZ if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(3) + ->Version(5) // ATOM-14637 + ->Field("LightType", &AreaLightComponentConfig::m_lightType) ->Field("Color", &AreaLightComponentConfig::m_color) ->Field("IntensityMode", &AreaLightComponentConfig::m_intensityMode) ->Field("Intensity", &AreaLightComponentConfig::m_intensity) @@ -29,25 +30,89 @@ namespace AZ ->Field("AttenuationRadius", &AreaLightComponentConfig::m_attenuationRadius) ->Field("LightEmitsBothDirections", &AreaLightComponentConfig::m_lightEmitsBothDirections) ->Field("UseFastApproximation", &AreaLightComponentConfig::m_useFastApproximation) + // Shutters + ->Field("EnableShutters", &AreaLightComponentConfig::m_enableShutters) + ->Field("InnerShutterAngleDegrees", &AreaLightComponentConfig::m_innerShutterAngleDegrees) + ->Field("OuterShutterAngleDegrees", &AreaLightComponentConfig::m_outerShutterAngleDegrees) + // Shadows + ->Field("Enable Shadow", &AreaLightComponentConfig::m_enableShadow) + ->Field("Shadowmap Max Size", &AreaLightComponentConfig::m_shadowmapMaxSize) + ->Field("Shadow Filter Method", &AreaLightComponentConfig::m_shadowFilterMethod) + ->Field("Softening Boundary Width", &AreaLightComponentConfig::m_boundaryWidthInDegrees) + ->Field("Prediction Sample Count", &AreaLightComponentConfig::m_predictionSampleCount) + ->Field("Filtering Sample Count", &AreaLightComponentConfig::m_filteringSampleCount) + ->Field("Pcf Method", &AreaLightComponentConfig::m_pcfMethod); ; } } + + AZStd::vector> AreaLightComponentConfig::GetValidPhotometricUnits() const + { + AZStd::vector> enumValues = + { + // Candela & lumen always supported. + Edit::EnumConstant(PhotometricUnit::Candela, "Candela"), + Edit::EnumConstant(PhotometricUnit::Lumen, "Lumen"), + }; + + if (RequiresShapeComponent()) + { + // Lights with surface area also support nits and ev100. + enumValues.push_back(Edit::EnumConstant(PhotometricUnit::Nit, "Nit")); + enumValues.push_back(Edit::EnumConstant(PhotometricUnit::Ev100Luminance, "Ev100")); + } + return enumValues; + } + + bool AreaLightComponentConfig::RequiresShapeComponent() const + { + return m_lightType == LightType::Sphere + || m_lightType == LightType::SpotDisk + || m_lightType == LightType::Capsule + || m_lightType == LightType::Quad + || m_lightType == LightType::Polygon; + } bool AreaLightComponentConfig::IsAttenuationRadiusModeAutomatic() const { return m_attenuationRadiusMode == LightAttenuationRadiusMode::Automatic; } - bool AreaLightComponentConfig::Is2DSurface() const + bool AreaLightComponentConfig::SupportsBothDirections() const { - return m_shapeType == AZ_CRC_CE("DiskShape") - || m_shapeType == AZ_CRC_CE("QuadShape") - || m_shapeType == AZ_CRC_CE("PolygonPrism"); + return m_lightType == LightType::Quad + || m_lightType == LightType::Polygon; } bool AreaLightComponentConfig::SupportsFastApproximation() const { - return m_shapeType == AZ_CRC_CE("QuadShape"); + return m_lightType == LightType::Quad; + } + + bool AreaLightComponentConfig::SupportsShutters() const + { + return m_lightType == LightType::SimpleSpot + || m_lightType == LightType::SpotDisk; + } + + bool AreaLightComponentConfig::ShuttersMustBeEnabled() const + { + return m_lightType == LightType::SpotDisk; + } + + bool AreaLightComponentConfig::ShuttersDisabled() const + { + return m_lightType == LightType::SpotDisk && !m_enableShutters; + } + + bool AreaLightComponentConfig::SupportsShadows() const + { + return m_shapeType == AZ_CRC_CE("DiskShape"); + } + + bool AreaLightComponentConfig::ShadowsDisabled() const + { + return !m_enableShadow; } const char* AreaLightComponentConfig::GetIntensitySuffix() const @@ -109,6 +174,26 @@ namespace AZ } return 0.0f; } + + bool AreaLightComponentConfig::IsShadowFilteringDisabled() const + { + return (m_shadowFilterMethod == ShadowFilterMethod::None); + } + bool AreaLightComponentConfig::IsShadowPcfDisabled() const + { + return !(m_shadowFilterMethod == ShadowFilterMethod::Pcf || + m_shadowFilterMethod == ShadowFilterMethod::EsmPcf); + } + + bool AreaLightComponentConfig::IsPcfBoundarySearchDisabled() const + { + if (IsShadowPcfDisabled()) + { + return true; + } + + return m_pcfMethod != PcfMethod::BoundarySearch; + } } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp index 51bfdd514e..1bbc2a411e 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include @@ -31,297 +33,593 @@ #include #include -namespace AZ +namespace AZ::Render { - namespace Render + void AreaLightComponentController::Reflect(ReflectContext* context) { - void AreaLightComponentController::Reflect(ReflectContext* context) - { - AreaLightComponentConfig::Reflect(context); + AreaLightComponentConfig::Reflect(context); - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(0) - ->Field("Configuration", &AreaLightComponentController::m_configuration); - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) - { - behaviorContext->EBus("AreaLightRequestBus") - ->Event("GetAttenuationRadius", &AreaLightRequestBus::Events::GetAttenuationRadius) - ->Event("SetAttenuationRadius", &AreaLightRequestBus::Events::SetAttenuationRadius) - ->Event("SetAttenuationRadiusMode", &AreaLightRequestBus::Events::SetAttenuationRadiusMode) - ->Event("GetColor", &AreaLightRequestBus::Events::GetColor) - ->Event("SetColor", &AreaLightRequestBus::Events::SetColor) - ->Event("GetEmitsLightBothDirections", &AreaLightRequestBus::Events::GetLightEmitsBothDirections) - ->Event("SetEmitsLightBothDirections", &AreaLightRequestBus::Events::SetLightEmitsBothDirections) - ->Event("GetUseFastApproximation", &AreaLightRequestBus::Events::GetUseFastApproximation) - ->Event("SetUseFastApproximation", &AreaLightRequestBus::Events::SetUseFastApproximation) - ->Event("GetIntensity", &AreaLightRequestBus::Events::GetIntensity) - ->Event("SetIntensity", static_cast(&AreaLightRequestBus::Events::SetIntensity)) - ->Event("GetIntensityMode", &AreaLightRequestBus::Events::GetIntensityMode) - ->Event("ConvertToIntensityMode", &AreaLightRequestBus::Events::ConvertToIntensityMode) - ->VirtualProperty("AttenuationRadius", "GetAttenuationRadius", "SetAttenuationRadius") - ->VirtualProperty("Color", "GetColor", "SetColor") - ->VirtualProperty("EmitsLightBothDirections", "GetEmitsLightBothDirections", "SetEmitsLightBothDirections") - ->VirtualProperty("UseFastApproximation", "GetUseFastApproximation", "SetUseFastApproximation") - ->VirtualProperty("Intensity", "GetIntensity", "SetIntensity") - ; - } - } - - void AreaLightComponentController::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) + if (auto* serializeContext = azrtti_cast(context)) { - provided.push_back(AZ_CRC_CE("AreaLightService")); + serializeContext->Class() + ->Version(1) + ->Field("Configuration", &AreaLightComponentController::m_configuration); } - void AreaLightComponentController::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) + if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) { - incompatible.push_back(AZ_CRC_CE("AreaLightService")); + behaviorContext->EBus("AreaLightRequestBus") + ->Event("GetAttenuationRadius", &AreaLightRequestBus::Events::GetAttenuationRadius) + ->Event("SetAttenuationRadius", &AreaLightRequestBus::Events::SetAttenuationRadius) + ->Event("SetAttenuationRadiusMode", &AreaLightRequestBus::Events::SetAttenuationRadiusMode) + ->Event("GetColor", &AreaLightRequestBus::Events::GetColor) + ->Event("SetColor", &AreaLightRequestBus::Events::SetColor) + ->Event("GetEmitsLightBothDirections", &AreaLightRequestBus::Events::GetLightEmitsBothDirections) + ->Event("SetEmitsLightBothDirections", &AreaLightRequestBus::Events::SetLightEmitsBothDirections) + ->Event("GetUseFastApproximation", &AreaLightRequestBus::Events::GetUseFastApproximation) + ->Event("SetUseFastApproximation", &AreaLightRequestBus::Events::SetUseFastApproximation) + ->Event("GetIntensity", &AreaLightRequestBus::Events::GetIntensity) + ->Event("SetIntensity", static_cast(&AreaLightRequestBus::Events::SetIntensity)) + ->Event("GetIntensityMode", &AreaLightRequestBus::Events::GetIntensityMode) + ->Event("ConvertToIntensityMode", &AreaLightRequestBus::Events::ConvertToIntensityMode) + + ->Event("GetEnableShutters", &AreaLightRequestBus::Events::GetEnableShutters) + ->Event("SetEnableShutters", &AreaLightRequestBus::Events::SetEnableShutters) + ->Event("GetInnerShutterAngle", &AreaLightRequestBus::Events::GetInnerShutterAngle) + ->Event("SetInnerShutterAngle", &AreaLightRequestBus::Events::SetInnerShutterAngle) + ->Event("GetOuterShutterAngle", &AreaLightRequestBus::Events::GetOuterShutterAngle) + ->Event("SetOuterShutterAngle", &AreaLightRequestBus::Events::SetOuterShutterAngle) + + ->Event("GetEnableShadow", &AreaLightRequestBus::Events::GetEnableShadow) + ->Event("SetEnableShadow", &AreaLightRequestBus::Events::SetEnableShadow) + ->Event("GetShadowmapMaxSize", &AreaLightRequestBus::Events::GetShadowmapMaxSize) + ->Event("SetShadowmapMaxSize", &AreaLightRequestBus::Events::SetShadowmapMaxSize) + ->Event("GetShadowFilterMethod", &AreaLightRequestBus::Events::GetShadowFilterMethod) + ->Event("SetShadowFilterMethod", &AreaLightRequestBus::Events::SetShadowFilterMethod) + ->Event("GetSofteningBoundaryWidthAngle", &AreaLightRequestBus::Events::GetSofteningBoundaryWidthAngle) + ->Event("SetSofteningBoundaryWidthAngle", &AreaLightRequestBus::Events::SetSofteningBoundaryWidthAngle) + ->Event("GetPredictionSampleCount", &AreaLightRequestBus::Events::GetPredictionSampleCount) + ->Event("SetPredictionSampleCount", &AreaLightRequestBus::Events::SetPredictionSampleCount) + ->Event("GetFilteringSampleCount", &AreaLightRequestBus::Events::GetFilteringSampleCount) + ->Event("SetFilteringSampleCount", &AreaLightRequestBus::Events::SetFilteringSampleCount) + ->Event("GetPcfMethod", &AreaLightRequestBus::Events::GetPcfMethod) + ->Event("SetPcfMethod", &AreaLightRequestBus::Events::SetPcfMethod) + + ->VirtualProperty("AttenuationRadius", "GetAttenuationRadius", "SetAttenuationRadius") + ->VirtualProperty("Color", "GetColor", "SetColor") + ->VirtualProperty("EmitsLightBothDirections", "GetEmitsLightBothDirections", "SetEmitsLightBothDirections") + ->VirtualProperty("UseFastApproximation", "GetUseFastApproximation", "SetUseFastApproximation") + ->VirtualProperty("Intensity", "GetIntensity", "SetIntensity") + + ->VirtualProperty("ShuttersEnabled", "GetEnableShutters", "SetEnableShutters") + ->VirtualProperty("InnerShutterAngle", "GetInnerShutterAngle", "SetInnerShutterAngle") + ->VirtualProperty("OuterShutterAngle", "GetOuterShutterAngle", "SetOuterShutterAngle") + + ->VirtualProperty("ShadowsEnabled", "GetEnableShadow", "SetEnableShadow") + ->VirtualProperty("ShadowmapMaxSize", "GetShadowmapMaxSize", "SetShadowmapMaxSize") + ->VirtualProperty("ShadowFilterMethod", "GetShadowFilterMethod", "SetShadowFilterMethod") + ->VirtualProperty("SofteningBoundaryWidthAngle", "GetSofteningBoundaryWidthAngle", "SetSofteningBoundaryWidthAngle") + ->VirtualProperty("PredictionSampleCount", "GetPredictionSampleCount", "SetPredictionSampleCount") + ->VirtualProperty("FilteringSampleCount", "GetFilteringSampleCount", "SetFilteringSampleCount") + ->VirtualProperty("PcfMethod", "GetPcfMethod", "SetPcfMethod"); + ; } + } - void AreaLightComponentController::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) - { - required.push_back(AZ_CRC_CE("AreaLightShapeService")); - } + void AreaLightComponentController::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) + { + provided.push_back(AZ_CRC_CE("AreaLightService")); + } + + void AreaLightComponentController::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) + { + incompatible.push_back(AZ_CRC_CE("AreaLightService")); + } + + void AreaLightComponentController::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent) + { + dependent.push_back(AZ_CRC_CE("ShapeService")); + } + + AreaLightComponentController::AreaLightComponentController(const AreaLightComponentConfig& config) + : m_configuration(config) + { + } + + void AreaLightComponentController::Activate(EntityId entityId) + { + m_entityId = entityId; + + // Used to determine which features are supported. + m_configuration.m_shapeType = 0; + LmbrCentral::ShapeComponentRequestsBus::EventResult(m_configuration.m_shapeType, m_entityId, &LmbrCentral::ShapeComponentRequestsBus::Events::GetShapeType); - AreaLightComponentController::AreaLightComponentController(const AreaLightComponentConfig& config) - : m_configuration(config) + VerifyLightTypeAndShapeComponent(); + CreateLightShapeDelegate(); + + if (m_configuration.RequiresShapeComponent() && m_lightShapeDelegate == nullptr) { + AZ_Error("AreaLightComponentController", false, "AreaLightComponentController activated without having required shape component."); } - void AreaLightComponentController::Activate(EntityId entityId) - { - m_entityId = entityId; + AreaLightRequestBus::Handler::BusConnect(m_entityId); - CreateLightShapeDelegate(); - AZ_Warning("AreaLightComponentController", m_lightShapeDelegate, "AreaLightComponentController activated without having required component."); + ConfigurationChanged(); + } - // Used to determine if the shape can be double-sided. - LmbrCentral::ShapeComponentRequestsBus::EventResult(m_configuration.m_shapeType, m_entityId, &LmbrCentral::ShapeComponentRequestsBus::Events::GetShapeType); + void AreaLightComponentController::Deactivate() + { + AreaLightRequestBus::Handler::BusDisconnect(m_entityId); + m_lightShapeDelegate.reset(); + } - AreaLightRequestBus::Handler::BusConnect(m_entityId); + void AreaLightComponentController::SetConfiguration(const AreaLightComponentConfig& config) + { + m_configuration = config; + VerifyLightTypeAndShapeComponent(); + ConfigurationChanged(); + } - ConfigurationChanged(); - } + const AreaLightComponentConfig& AreaLightComponentController::GetConfiguration() const + { + return m_configuration; + } - void AreaLightComponentController::Deactivate() + void AreaLightComponentController::SetVisibiliy(bool isVisible) + { + m_isVisible = isVisible; + if (m_lightShapeDelegate) { - AreaLightRequestBus::Handler::BusDisconnect(m_entityId); - m_lightShapeDelegate.reset(); + m_lightShapeDelegate->SetVisibility(m_isVisible); + if (m_isVisible) + { + // If the light is made visible, make sure to apply the configuration so all properties as set correctly. + ConfigurationChanged(); + } } + } + + void AreaLightComponentController::VerifyLightTypeAndShapeComponent() + { + constexpr Crc32 SphereShapeTypeId = AZ_CRC_CE("Sphere"); + constexpr Crc32 DiskShapeTypeId = AZ_CRC_CE("DiskShape"); + constexpr Crc32 CapsuleShapeTypeId = AZ_CRC_CE("Capsule"); + constexpr Crc32 QuadShapeTypeId = AZ_CRC_CE("QuadShape"); + constexpr Crc32 PoylgonShapeTypeId = AZ_CRC_CE("PolygonPrism"); - void AreaLightComponentController::SetConfiguration(const AreaLightComponentConfig& config) + if (m_configuration.m_lightType == AreaLightComponentConfig::LightType::Unknown) { - m_configuration = config; - ConfigurationChanged(); + // Light type is unknown, see if it can be determined from a shape component. + switch (m_configuration.m_shapeType) + { + case SphereShapeTypeId: + m_configuration.m_lightType = AreaLightComponentConfig::LightType::Sphere; + break; + case DiskShapeTypeId: + m_configuration.m_lightType = AreaLightComponentConfig::LightType::SpotDisk; + break; + case CapsuleShapeTypeId: + m_configuration.m_lightType = AreaLightComponentConfig::LightType::Capsule; + break; + case QuadShapeTypeId: + m_configuration.m_lightType = AreaLightComponentConfig::LightType::Quad; + break; + case PoylgonShapeTypeId: + m_configuration.m_lightType = AreaLightComponentConfig::LightType::Polygon; + break; + default: + break; // Light type can't be deduced. + } } - - const AreaLightComponentConfig& AreaLightComponentController::GetConfiguration() const + else if (m_configuration.m_shapeType == Crc32(0)) { - return m_configuration; + AZ_Error("AreaLightComponentController", !m_configuration.RequiresShapeComponent(), "The light type used on this area light requires a corresponding shape component"); } - - void AreaLightComponentController::SetVisibiliy(bool isVisible) + else { - m_isVisible = isVisible; - if (m_lightShapeDelegate) - { - m_lightShapeDelegate->SetVisibility(m_isVisible); - } + // Validate the the light type matches up with shape type if the light type is an area light. + AZ_Error("AreaLightComponentController", + !(m_configuration.m_lightType == AreaLightComponentConfig::LightType::Sphere && m_configuration.m_shapeType != SphereShapeTypeId), + "The light type is a sphere, but the shape component is not."); + AZ_Error("AreaLightComponentController", + !(m_configuration.m_lightType == AreaLightComponentConfig::LightType::SpotDisk && m_configuration.m_shapeType != DiskShapeTypeId), + "The light type is a disk, but the shape component is not."); + AZ_Error("AreaLightComponentController", + !(m_configuration.m_lightType == AreaLightComponentConfig::LightType::Capsule && m_configuration.m_shapeType != CapsuleShapeTypeId), + "The light type is a capsule, but the shape component is not."); + AZ_Error("AreaLightComponentController", + !(m_configuration.m_lightType == AreaLightComponentConfig::LightType::Quad && m_configuration.m_shapeType != QuadShapeTypeId), + "The light type is a quad, but the shape component is not."); + AZ_Error("AreaLightComponentController", + !(m_configuration.m_lightType == AreaLightComponentConfig::LightType::Polygon && m_configuration.m_shapeType != PoylgonShapeTypeId), + "The light type is a polygon, but the shape component is not."); } + } - void AreaLightComponentController::ConfigurationChanged() - { - ChromaChanged(); - IntensityChanged(); - AttenuationRadiusChanged(); + void AreaLightComponentController::ConfigurationChanged() + { + ChromaChanged(); + IntensityChanged(); + AttenuationRadiusChanged(); + ShuttersChanged(); + ShadowsChanged(); - if (m_lightShapeDelegate) - { - m_lightShapeDelegate->SetLightEmitsBothDirections(m_configuration.m_lightEmitsBothDirections); - m_lightShapeDelegate->SetUseFastApproximation(m_configuration.m_useFastApproximation); - } + if (m_lightShapeDelegate) + { + m_lightShapeDelegate->SetLightEmitsBothDirections(m_configuration.m_lightEmitsBothDirections); + m_lightShapeDelegate->SetUseFastApproximation(m_configuration.m_useFastApproximation); } + } - void AreaLightComponentController::IntensityChanged() - { - AreaLightNotificationBus::Event(m_entityId, &AreaLightNotifications::OnColorOrIntensityChanged, m_configuration.m_color, m_configuration.m_intensity); + void AreaLightComponentController::IntensityChanged() + { + AreaLightNotificationBus::Event(m_entityId, &AreaLightNotifications::OnColorOrIntensityChanged, m_configuration.m_color, m_configuration.m_intensity); - if (m_lightShapeDelegate) - { - m_lightShapeDelegate->SetPhotometricUnit(m_configuration.m_intensityMode); - m_lightShapeDelegate->SetIntensity(m_configuration.m_intensity); - } + if (m_lightShapeDelegate) + { + m_lightShapeDelegate->SetPhotometricUnit(m_configuration.m_intensityMode); + m_lightShapeDelegate->SetIntensity(m_configuration.m_intensity); } + } - void AreaLightComponentController::ChromaChanged() + void AreaLightComponentController::ChromaChanged() + { + if (m_lightShapeDelegate) { - if (m_lightShapeDelegate) - { - m_lightShapeDelegate->SetChroma(m_configuration.m_color); - } + m_lightShapeDelegate->SetChroma(m_configuration.m_color); } + } - void AreaLightComponentController::AttenuationRadiusChanged() + void AreaLightComponentController::AttenuationRadiusChanged() + { + if (m_configuration.m_attenuationRadiusMode == LightAttenuationRadiusMode::Automatic) { - if (m_configuration.m_attenuationRadiusMode == LightAttenuationRadiusMode::Automatic) - { - AutoCalculateAttenuationRadius(); - } - AreaLightNotificationBus::Event(m_entityId, &AreaLightNotifications::OnAttenutationRadiusChanged, m_configuration.m_attenuationRadius); + AutoCalculateAttenuationRadius(); + } + AreaLightNotificationBus::Event(m_entityId, &AreaLightNotifications::OnAttenutationRadiusChanged, m_configuration.m_attenuationRadius); - if (m_lightShapeDelegate) + if (m_lightShapeDelegate) + { + m_lightShapeDelegate->SetAttenuationRadius(m_configuration.m_attenuationRadius); + } + } + + void AreaLightComponentController::ShuttersChanged() + { + if (m_lightShapeDelegate) + { + m_lightShapeDelegate->SetEnableShutters(m_configuration.m_enableShutters); + if (m_configuration.m_enableShutters) { - m_lightShapeDelegate->SetAttenuationRadius(m_configuration.m_attenuationRadius); + m_lightShapeDelegate->SetShutterAngles(m_configuration.m_innerShutterAngleDegrees, m_configuration.m_outerShutterAngleDegrees); } } + } - void AreaLightComponentController::AutoCalculateAttenuationRadius() + void AreaLightComponentController::ShadowsChanged() + { + if (m_lightShapeDelegate) { - if (m_lightShapeDelegate) + m_lightShapeDelegate->SetEnableShadow(m_configuration.m_enableShadow); + if (m_configuration.m_enableShadow) { - m_configuration.m_attenuationRadius = m_lightShapeDelegate->CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity); + m_lightShapeDelegate->SetShadowmapMaxSize(m_configuration.m_shadowmapMaxSize); + m_lightShapeDelegate->SetShadowFilterMethod(m_configuration.m_shadowFilterMethod); + m_lightShapeDelegate->SetSofteningBoundaryWidthAngle(m_configuration.m_boundaryWidthInDegrees); + m_lightShapeDelegate->SetPredictionSampleCount(m_configuration.m_predictionSampleCount); + m_lightShapeDelegate->SetFilteringSampleCount(m_configuration.m_filteringSampleCount); + m_lightShapeDelegate->SetPcfMethod(m_configuration.m_pcfMethod); } } + } - const Color& AreaLightComponentController::GetColor() const + void AreaLightComponentController::AutoCalculateAttenuationRadius() + { + if (m_lightShapeDelegate) { - return m_configuration.m_color; + m_configuration.m_attenuationRadius = m_lightShapeDelegate->CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity); } + } - void AreaLightComponentController::SetColor(const Color& color) - { - m_configuration.m_color = color; - AreaLightNotificationBus::Event(m_entityId, &AreaLightNotifications::OnColorChanged, color); - ChromaChanged(); - } + const Color& AreaLightComponentController::GetColor() const + { + return m_configuration.m_color; + } + + void AreaLightComponentController::SetColor(const Color& color) + { + m_configuration.m_color = color; + AreaLightNotificationBus::Event(m_entityId, &AreaLightNotifications::OnColorChanged, color); + ChromaChanged(); + } + + bool AreaLightComponentController::GetLightEmitsBothDirections() const + { + return m_configuration.m_lightEmitsBothDirections; + } + + void AreaLightComponentController::SetLightEmitsBothDirections(bool value) + { + m_configuration.m_lightEmitsBothDirections = value; + } + + bool AreaLightComponentController::GetUseFastApproximation() const + { + return m_configuration.m_useFastApproximation; + } + + void AreaLightComponentController::SetUseFastApproximation(bool value) + { + m_configuration.m_useFastApproximation = value; + } - bool AreaLightComponentController::GetLightEmitsBothDirections() const + PhotometricUnit AreaLightComponentController::GetIntensityMode() const + { + return m_configuration.m_intensityMode; + } + + float AreaLightComponentController::GetIntensity() const + { + return m_configuration.m_intensity; + } + + void AreaLightComponentController::SetIntensity(float intensity, PhotometricUnit intensityMode) + { + m_configuration.m_intensityMode = intensityMode; + m_configuration.m_intensity = intensity; + + AreaLightNotificationBus::Event(m_entityId, &AreaLightNotifications::OnIntensityChanged, intensity, intensityMode); + IntensityChanged(); + } + + void AreaLightComponentController::SetIntensity(float intensity) + { + m_configuration.m_intensity = intensity; + + AreaLightNotificationBus::Event(m_entityId, &AreaLightNotifications::OnIntensityChanged, intensity, m_configuration.m_intensityMode); + IntensityChanged(); + } + + float AreaLightComponentController::GetAttenuationRadius() const + { + return m_configuration.m_attenuationRadius; + } + + void AreaLightComponentController::SetAttenuationRadius(float radius) + { + m_configuration.m_attenuationRadius = radius; + m_configuration.m_attenuationRadiusMode = LightAttenuationRadiusMode::Explicit; + AttenuationRadiusChanged(); + } + + void AreaLightComponentController::SetAttenuationRadiusMode(LightAttenuationRadiusMode attenuationRadiusMode) + { + m_configuration.m_attenuationRadiusMode = attenuationRadiusMode; + AttenuationRadiusChanged(); + } + + void AreaLightComponentController::ConvertToIntensityMode(PhotometricUnit intensityMode) + { + if (m_lightShapeDelegate && m_lightShapeDelegate->GetPhotometricValue().GetType() != intensityMode) { - return m_configuration.m_lightEmitsBothDirections; + m_configuration.m_intensityMode = intensityMode; + m_configuration.m_intensity = m_lightShapeDelegate->SetPhotometricUnit(intensityMode); } + } + + bool AreaLightComponentController::GetEnableShutters() const + { + return m_configuration.m_enableShutters; + } - void AreaLightComponentController::SetLightEmitsBothDirections(bool value) + void AreaLightComponentController::SetEnableShutters(bool enabled) + { + m_configuration.m_enableShutters = enabled && m_configuration.SupportsShutters(); + if (m_lightShapeDelegate) { - m_configuration.m_lightEmitsBothDirections = value; + m_lightShapeDelegate->SetEnableShutters(enabled); } + } - bool AreaLightComponentController::GetUseFastApproximation() const + float AreaLightComponentController::GetInnerShutterAngle() const + { + return m_configuration.m_innerShutterAngleDegrees; + } + + void AreaLightComponentController::SetInnerShutterAngle(float degrees) + { + m_configuration.m_innerShutterAngleDegrees = degrees; + if (m_lightShapeDelegate) { - return m_configuration.m_useFastApproximation; + m_lightShapeDelegate->SetShutterAngles(m_configuration.m_innerShutterAngleDegrees, m_configuration.m_outerShutterAngleDegrees); } + } - void AreaLightComponentController::SetUseFastApproximation(bool value) + float AreaLightComponentController::GetOuterShutterAngle() const + { + return m_configuration.m_outerShutterAngleDegrees; + } + + void AreaLightComponentController::SetOuterShutterAngle(float degrees) + { + m_configuration.m_outerShutterAngleDegrees = degrees; + if (m_lightShapeDelegate) { - m_configuration.m_useFastApproximation = value; + m_lightShapeDelegate->SetShutterAngles(m_configuration.m_innerShutterAngleDegrees, m_configuration.m_outerShutterAngleDegrees); } + } - PhotometricUnit AreaLightComponentController::GetIntensityMode() const + bool AreaLightComponentController::GetEnableShadow() const + { + return m_configuration.m_enableShadow; + } + + void AreaLightComponentController::SetEnableShadow(bool enabled) + { + m_configuration.m_enableShadow = enabled && m_configuration.SupportsShadows(); + if (m_lightShapeDelegate) { - return m_configuration.m_intensityMode; + m_lightShapeDelegate->SetEnableShadow(enabled); } + } + + ShadowmapSize AreaLightComponentController::GetShadowmapMaxSize() const + { + return m_configuration.m_shadowmapMaxSize; + } - float AreaLightComponentController::GetIntensity() const + void AreaLightComponentController::SetShadowmapMaxSize(ShadowmapSize size) + { + m_configuration.m_shadowmapMaxSize = size; + if (m_lightShapeDelegate) { - return m_configuration.m_intensity; + m_lightShapeDelegate->SetShadowmapMaxSize(size); } + } - void AreaLightComponentController::SetIntensity(float intensity, PhotometricUnit intensityMode) - { - m_configuration.m_intensityMode = intensityMode; - m_configuration.m_intensity = intensity; + ShadowFilterMethod AreaLightComponentController::GetShadowFilterMethod() const + { + return m_configuration.m_shadowFilterMethod; + } - AreaLightNotificationBus::Event(m_entityId, &AreaLightNotifications::OnIntensityChanged, intensity, intensityMode); - IntensityChanged(); + void AreaLightComponentController::SetShadowFilterMethod(ShadowFilterMethod method) + { + m_configuration.m_shadowFilterMethod = method; + if (m_lightShapeDelegate) + { + m_lightShapeDelegate->SetShadowFilterMethod(method); } + } - void AreaLightComponentController::SetIntensity(float intensity) - { - m_configuration.m_intensity = intensity; + float AreaLightComponentController::GetSofteningBoundaryWidthAngle() const + { + return m_configuration.m_boundaryWidthInDegrees; + } - AreaLightNotificationBus::Event(m_entityId, &AreaLightNotifications::OnIntensityChanged, intensity, m_configuration.m_intensityMode); - IntensityChanged(); + void AreaLightComponentController::SetSofteningBoundaryWidthAngle(float width) + { + m_configuration.m_boundaryWidthInDegrees = width; + if (m_lightShapeDelegate) + { + m_lightShapeDelegate->SetSofteningBoundaryWidthAngle(width); } + } + + uint32_t AreaLightComponentController::GetPredictionSampleCount() const + { + return m_configuration.m_predictionSampleCount; + } - float AreaLightComponentController::GetAttenuationRadius() const + void AreaLightComponentController::SetPredictionSampleCount(uint32_t count) + { + m_configuration.m_predictionSampleCount = count; + if (m_lightShapeDelegate) { - return m_configuration.m_attenuationRadius; + m_lightShapeDelegate->SetPredictionSampleCount(count); } + } - void AreaLightComponentController::SetAttenuationRadius(float radius) + uint32_t AreaLightComponentController::GetFilteringSampleCount() const + { + return m_configuration.m_filteringSampleCount; + } + + void AreaLightComponentController::SetFilteringSampleCount(uint32_t count) + { + m_configuration.m_filteringSampleCount = count; + if (m_lightShapeDelegate) { - m_configuration.m_attenuationRadius = radius; - m_configuration.m_attenuationRadiusMode = LightAttenuationRadiusMode::Explicit; - AttenuationRadiusChanged(); + m_lightShapeDelegate->SetFilteringSampleCount(count); } + } - void AreaLightComponentController::SetAttenuationRadiusMode(LightAttenuationRadiusMode attenuationRadiusMode) + void AreaLightComponentController::HandleDisplayEntityViewport( + [[maybe_unused]] const AzFramework::ViewportInfo& viewportInfo, + AzFramework::DebugDisplayRequests& debugDisplay, + bool isSelected) + { + Transform transform = Transform::CreateIdentity(); + TransformBus::EventResult(transform, m_entityId, &TransformBus::Events::GetWorldTM); + if (m_lightShapeDelegate) { - m_configuration.m_attenuationRadiusMode = attenuationRadiusMode; - AttenuationRadiusChanged(); + m_lightShapeDelegate->DrawDebugDisplay(transform, m_configuration.m_color, debugDisplay, isSelected); } + } + + PcfMethod AreaLightComponentController::GetPcfMethod() const + { + return m_configuration.m_pcfMethod; + } - void AreaLightComponentController::ConvertToIntensityMode(PhotometricUnit intensityMode) + void AreaLightComponentController::SetPcfMethod(PcfMethod method) + { + m_configuration.m_pcfMethod = method; + if (m_lightShapeDelegate) { - if (m_lightShapeDelegate && m_lightShapeDelegate->GetPhotometricValue().GetType() != intensityMode) - { - m_configuration.m_intensityMode = intensityMode; - m_configuration.m_intensity = m_lightShapeDelegate->SetPhotometricUnit(intensityMode); - } + m_lightShapeDelegate->SetPcfMethod(method); } + } - void AreaLightComponentController::HandleDisplayEntityViewport( - [[maybe_unused]] const AzFramework::ViewportInfo& viewportInfo, - AzFramework::DebugDisplayRequests& debugDisplay, - bool isSelected) + void AreaLightComponentController::CreateLightShapeDelegate() + { + switch (m_configuration.m_lightType) { - Transform transform = Transform::CreateIdentity(); - TransformBus::EventResult(transform, m_entityId, &TransformBus::Events::GetWorldTM); - if (m_lightShapeDelegate) - { - m_lightShapeDelegate->DrawDebugDisplay(transform, m_configuration.m_color, debugDisplay, isSelected); - } - } - void AreaLightComponentController::CreateLightShapeDelegate() + // Simple types + case AreaLightComponentConfig::LightType::SimplePoint: + m_lightShapeDelegate = AZStd::make_unique(m_entityId, m_isVisible); + break; + case AreaLightComponentConfig::LightType::SimpleSpot: + m_lightShapeDelegate = AZStd::make_unique(m_entityId, m_isVisible); + break; + + // Area light types + case AreaLightComponentConfig::LightType::Sphere: { LmbrCentral::SphereShapeComponentRequests* sphereShapeInterface = LmbrCentral::SphereShapeComponentRequestsBus::FindFirstHandler(m_entityId); if (sphereShapeInterface) { m_lightShapeDelegate = AZStd::make_unique(sphereShapeInterface, m_entityId, m_isVisible); - return; } - + break; + } + case AreaLightComponentConfig::LightType::SpotDisk: + { LmbrCentral::DiskShapeComponentRequests* diskShapeInterface = LmbrCentral::DiskShapeComponentRequestBus::FindFirstHandler(m_entityId); if (diskShapeInterface) { m_lightShapeDelegate = AZStd::make_unique(diskShapeInterface, m_entityId, m_isVisible); - return; } - + break; + } + case AreaLightComponentConfig::LightType::Capsule: + { LmbrCentral::CapsuleShapeComponentRequests* capsuleShapeInterface = LmbrCentral::CapsuleShapeComponentRequestsBus::FindFirstHandler(m_entityId); if (capsuleShapeInterface) { m_lightShapeDelegate = AZStd::make_unique(capsuleShapeInterface, m_entityId, m_isVisible); - return; } - + break; + } + case AreaLightComponentConfig::LightType::Quad: + { LmbrCentral::QuadShapeComponentRequests* quadShapeInterface = LmbrCentral::QuadShapeComponentRequestBus::FindFirstHandler(m_entityId); if (quadShapeInterface) { m_lightShapeDelegate = AZStd::make_unique(quadShapeInterface, m_entityId, m_isVisible); - return; } - + break; + } + case AreaLightComponentConfig::LightType::Polygon: + { LmbrCentral::PolygonPrismShapeComponentRequests* polyPrismShapeInterface = LmbrCentral::PolygonPrismShapeComponentRequestBus::FindFirstHandler(m_entityId); if (polyPrismShapeInterface) { m_lightShapeDelegate = AZStd::make_unique(polyPrismShapeInterface, m_entityId, m_isVisible); - return; } + break; + } } + } - } // namespace Render -} // namespace AZ +} // namespace AZ::Render diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.h index 253cd9d670..b5f342a522 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.h @@ -38,7 +38,7 @@ namespace AZ static void Reflect(AZ::ReflectContext* context); static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); - static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); + static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent); AreaLightComponentController() = default; AreaLightComponentController(const AreaLightComponentConfig& config); @@ -71,15 +71,41 @@ namespace AZ void SetAttenuationRadiusMode(LightAttenuationRadiusMode attenuationRadiusMode) override; void ConvertToIntensityMode(PhotometricUnit intensityMode) override; + bool GetEnableShutters() const override; + void SetEnableShutters(bool enabled) override; + float GetInnerShutterAngle() const override; + void SetInnerShutterAngle(float degrees) override; + float GetOuterShutterAngle() const override; + void SetOuterShutterAngle(float degrees) override; + + bool GetEnableShadow() const override; + void SetEnableShadow(bool enabled) override; + ShadowmapSize GetShadowmapMaxSize() const override; + void SetShadowmapMaxSize(ShadowmapSize size) override; + ShadowFilterMethod GetShadowFilterMethod() const override; + void SetShadowFilterMethod(ShadowFilterMethod method) override; + float GetSofteningBoundaryWidthAngle() const override; + void SetSofteningBoundaryWidthAngle(float width) override; + uint32_t GetPredictionSampleCount() const override; + void SetPredictionSampleCount(uint32_t count) override; + uint32_t GetFilteringSampleCount() const override; + void SetFilteringSampleCount(uint32_t count) override; + PcfMethod GetPcfMethod() const override; + void SetPcfMethod(PcfMethod method) override; + void HandleDisplayEntityViewport( const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected); + void VerifyLightTypeAndShapeComponent(); + void ConfigurationChanged(); void IntensityChanged(); void ChromaChanged(); void AttenuationRadiusChanged(); + void ShuttersChanged(); + void ShadowsChanged(); //! Handles calculating the attenuation radius when LightAttenuationRadiusMode is auto void AutoCalculateAttenuationRadius(); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp index 8d35e9da6c..5bce0e3e80 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentConfig.cpp @@ -24,7 +24,7 @@ namespace AZ if (auto* serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(6) + ->Version(7) ->Field("Color", &DirectionalLightComponentConfig::m_color) ->Field("IntensityMode", &DirectionalLightComponentConfig::m_intensityMode) ->Field("Intensity", &DirectionalLightComponentConfig::m_intensity) @@ -43,7 +43,8 @@ namespace AZ ->Field("SofteningBoundaryWidth", &DirectionalLightComponentConfig::m_boundaryWidth) ->Field("PcfPredictionSampleCount", &DirectionalLightComponentConfig::m_predictionSampleCount) ->Field("PcfFilteringSampleCount", &DirectionalLightComponentConfig::m_filteringSampleCount) - ; + ->Field("Pcf Method", &DirectionalLightComponentConfig::m_pcfMethod) + ; } } @@ -126,5 +127,15 @@ namespace AZ m_shadowFilterMethod == ShadowFilterMethod::EsmPcf); } + bool DirectionalLightComponentConfig::IsPcfBoundarySearchDisabled() const + { + if (IsShadowPcfDisabled()) + { + return true; + } + + return m_pcfMethod != PcfMethod::BoundarySearch; + } + } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp index 1a2f0876c3..c7d459c596 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp @@ -87,6 +87,8 @@ namespace AZ ->Event("SetPredictionSampleCount", &DirectionalLightRequestBus::Events::SetPredictionSampleCount) ->Event("GetFilteringSampleCount", &DirectionalLightRequestBus::Events::GetFilteringSampleCount) ->Event("SetFilteringSampleCount", &DirectionalLightRequestBus::Events::SetFilteringSampleCount) + ->Event("GetPcfMethod", &DirectionalLightRequestBus::Events::GetPcfMethod) + ->Event("SetPcfMethod", &DirectionalLightRequestBus::Events::SetPcfMethod) ->VirtualProperty("Color", "GetColor", "SetColor") ->VirtualProperty("Intensity", "GetIntensity", "SetIntensity") ->VirtualProperty("AngularDiameter", "GetAngularDiameter", "SetAngularDiameter") @@ -103,7 +105,8 @@ namespace AZ ->VirtualProperty("SofteningBoundaryWidth", "GetSofteningBoundaryWidth", "SetSofteningBoundaryWidth") ->VirtualProperty("PredictionSampleCount", "GetPredictionSampleCount", "SetPredictionSampleCount") ->VirtualProperty("FilteringSampleCount", "GetFilteringSampleCount", "SetFilteringSampleCount") - ; + ->VirtualProperty("PcfMethod", "GetPcfMethod", "SetPcfMethod"); + ; } } @@ -534,6 +537,7 @@ namespace AZ SetSofteningBoundaryWidth(m_configuration.m_boundaryWidth); SetPredictionSampleCount(m_configuration.m_predictionSampleCount); SetFilteringSampleCount(m_configuration.m_filteringSampleCount); + SetPcfMethod(m_configuration.m_pcfMethod); // [GFX TODO][ATOM-1726] share config for multiple light (e.g., light ID). // [GFX TODO][ATOM-2416] adapt to multiple viewports. @@ -620,6 +624,16 @@ namespace AZ } } + PcfMethod DirectionalLightComponentController::GetPcfMethod() const + { + return m_configuration.m_pcfMethod; + } + + void DirectionalLightComponentController::SetPcfMethod(PcfMethod method) + { + m_configuration.m_pcfMethod = method; + m_featureProcessor->SetPcfMethod(m_lightHandle, method); + } } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.h index df72372cb5..b8e1d00b73 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.h @@ -86,6 +86,8 @@ namespace AZ void SetPredictionSampleCount(uint32_t count) override; uint32_t GetFilteringSampleCount() const override; void SetFilteringSampleCount(uint32_t count) override; + PcfMethod GetPcfMethod() const override; + void SetPcfMethod(PcfMethod method) override; private: friend class EditorDirectionalLightComponent; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp index 2bf4dd4159..32b6a9f0b7 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp @@ -14,62 +14,121 @@ #include #include -namespace AZ +namespace AZ::Render { - namespace Render + DiskLightDelegate::DiskLightDelegate(LmbrCentral::DiskShapeComponentRequests* shapeBus, EntityId entityId, bool isVisible) + : LightDelegateBase(entityId, isVisible) + , m_shapeBus(shapeBus) { - DiskLightDelegate::DiskLightDelegate(LmbrCentral::DiskShapeComponentRequests* shapeBus, EntityId entityId, bool isVisible) - : LightDelegateBase(entityId, isVisible) - , m_shapeBus(shapeBus) + InitBase(entityId); + } + + float DiskLightDelegate::CalculateAttenuationRadius(float lightThreshold) const + { + // Calculate the radius at which the irradiance will be equal to cutoffIntensity. + float intensity = GetPhotometricValue().GetCombinedIntensity(PhotometricUnit::Lumen); + return sqrt(intensity / lightThreshold); + } + + void DiskLightDelegate::HandleShapeChanged() + { + if (GetLightHandle().IsValid()) { - InitBase(entityId); + GetFeatureProcessor()->SetPosition(GetLightHandle(), GetTransform().GetTranslation()); + GetFeatureProcessor()->SetDirection(GetLightHandle(), m_shapeBus->GetNormal()); + GetFeatureProcessor()->SetDiskRadius(GetLightHandle(), GetRadius()); } - - void DiskLightDelegate::SetLightEmitsBothDirections(bool lightEmitsBothDirections) + } + + float DiskLightDelegate::GetSurfaceArea() const + { + float radius = GetRadius(); + return Constants::Pi * radius * radius; + } + + float DiskLightDelegate::GetRadius() const + { + return m_shapeBus->GetRadius() * GetTransform().GetScale().GetMaxElement(); + } + + void DiskLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const + { + if (isSelected) { - if (GetLightHandle().IsValid()) - { - GetFeatureProcessor()->SetLightEmitsBothDirections(GetLightHandle(), lightEmitsBothDirections); - } + debugDisplay.SetColor(color); + + // Draw a disk for the attenuation radius + debugDisplay.DrawWireSphere(transform.GetTranslation(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity)); } + } + + void DiskLightDelegate::SetEnableShutters(bool enabled) + { + Base::SetEnableShutters(enabled); + GetFeatureProcessor()->SetConstrainToConeLight(GetLightHandle(), true); + } - float DiskLightDelegate::CalculateAttenuationRadius(float lightThreshold) const + void DiskLightDelegate::SetShutterAngles(float innerAngleDegrees, float outerAngleDegrees) + { + if (GetShuttersEnabled()) { - // Calculate the radius at which the irradiance will be equal to cutoffIntensity. - float intensity = GetPhotometricValue().GetCombinedIntensity(PhotometricUnit::Lumen); - return sqrt(intensity / lightThreshold); + GetFeatureProcessor()->SetConeAngles(GetLightHandle(), DegToRad(innerAngleDegrees), DegToRad(outerAngleDegrees)); } + } - void DiskLightDelegate::HandleShapeChanged() + void DiskLightDelegate::SetEnableShadow(bool enabled) + { + Base::SetEnableShadow(enabled); + GetFeatureProcessor()->SetShadowsEnabled(GetLightHandle(), enabled); + } + + void DiskLightDelegate::SetShadowmapMaxSize(ShadowmapSize size) + { + if (GetShadowsEnabled()) { - if (GetLightHandle().IsValid()) - { - GetFeatureProcessor()->SetPosition(GetLightHandle(), GetTransform().GetTranslation()); - GetFeatureProcessor()->SetDirection(GetLightHandle(), m_shapeBus->GetNormal()); - GetFeatureProcessor()->SetDiskRadius(GetLightHandle(), GetRadius()); - } + GetFeatureProcessor()->SetShadowmapMaxResolution(GetLightHandle(), size); } + } - float DiskLightDelegate::GetSurfaceArea() const + void DiskLightDelegate::SetShadowFilterMethod(ShadowFilterMethod method) + { + if (GetShadowsEnabled()) { - float radius = GetRadius(); - return Constants::Pi * radius * radius; + GetFeatureProcessor()->SetShadowFilterMethod(GetLightHandle(), method); } + } - float DiskLightDelegate::GetRadius() const + void DiskLightDelegate::SetSofteningBoundaryWidthAngle(float widthInDegrees) + { + if (GetShadowsEnabled()) { - return m_shapeBus->GetRadius() * GetTransform().GetScale().GetMaxElement(); + GetFeatureProcessor()->SetSofteningBoundaryWidthAngle(GetLightHandle(), DegToRad(widthInDegrees)); } + } - void DiskLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const + void DiskLightDelegate::SetPredictionSampleCount(uint32_t count) + { + if (GetShadowsEnabled()) { - if (isSelected) - { - debugDisplay.SetColor(color); + GetFeatureProcessor()->SetPredictionSampleCount(GetLightHandle(), count); + } + } - // Draw a disk for the attenuation radius - debugDisplay.DrawWireSphere(transform.GetTranslation(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity)); - } + void DiskLightDelegate::SetFilteringSampleCount(uint32_t count) + { + if (GetShadowsEnabled()) + { + GetFeatureProcessor()->SetFilteringSampleCount(GetLightHandle(), count); + } + } + + void DiskLightDelegate::SetPcfMethod(PcfMethod method) + { + if (GetShadowsEnabled()) + { + GetFeatureProcessor()->SetPcfMethod(GetLightHandle(), method); } - } // namespace Render -} // namespace AZ + } + + +} // namespace AZ::Render diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.h index 4dd3d2b3a6..5511b435d4 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.h @@ -30,16 +30,28 @@ namespace AZ class DiskLightDelegate final : public LightDelegateBase { + using Base = LightDelegateBase; + public: DiskLightDelegate(LmbrCentral::DiskShapeComponentRequests* shapeBus, EntityId entityId, bool isVisible); // LightDelegateBase overrides... - void SetLightEmitsBothDirections(bool lightEmitsBothDirections) override; float GetSurfaceArea() const override; float GetEffectiveSolidAngle() const override { return PhotometricValue::DirectionalEffectiveSteradians; } float CalculateAttenuationRadius(float lightThreshold) const override; void DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const override; + void SetEnableShutters(bool enabled) override; + void SetShutterAngles(float innerAngleDegrees, float outerAngleDegrees) override; + + void SetEnableShadow(bool enabled) override; + void SetShadowmapMaxSize(ShadowmapSize size) override; + void SetShadowFilterMethod(ShadowFilterMethod method) override; + void SetSofteningBoundaryWidthAngle(float widthInDegrees) override; + void SetPredictionSampleCount(uint32_t count) override; + void SetFilteringSampleCount(uint32_t count) override; + void SetPcfMethod(PcfMethod method) override; + private: // LightDelegateBase overrides... diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp index 4081317890..bdff97b48e 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp @@ -13,10 +13,17 @@ #include #include +#include +#include #include #include #include +#include +#include +#include +#include +#include namespace AZ { @@ -27,65 +34,145 @@ namespace AZ { } - void EditorAreaLightComponent::Reflect(AZ::ReflectContext* context) + void EditorAreaLightComponent::Reflect(ReflectContext* context) { BaseClass::Reflect(context); - if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) + if (SerializeContext* serializeContext = azrtti_cast(context)) { serializeContext->Class() ->Version(1, ConvertToEditorRenderComponentAdapter<1>); - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + if (EditContext* editContext = serializeContext->GetEditContext()) { editContext->Class( - "Area Light", "An Area light emits light emits light from a goemetric shape.") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Category, "Atom") - ->Attribute(AZ::Edit::Attributes::Icon, "Editor/Icons/Components/Component_Placeholder.svg") - ->Attribute(AZ::Edit::Attributes::ViewportIcon, "editor/icons/components/viewport/component_placeholder.png") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game", 0x232b318c)) - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://docs.aws.amazon.com/lumberyard/latest/userguide/component-area-light.html") + "Light", "A light which emits from a point or goemetric shape.") + ->ClassElement(Edit::ClassElements::EditorData, "") + ->Attribute(Edit::Attributes::Category, "Atom") + ->Attribute(Edit::Attributes::Icon, "Editor/Icons/Components/Component_Placeholder.svg") + ->Attribute(Edit::Attributes::ViewportIcon, "editor/icons/components/viewport/component_placeholder.png") + ->Attribute(Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game", 0x232b318c)) + ->Attribute(Edit::Attributes::AutoExpand, true) + ->Attribute(Edit::Attributes::HelpPageURL, "https://docs.aws.amazon.com/lumberyard/latest/userguide/component-light.html") ; editContext->Class( "AreaLightComponentController", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::Default, &AreaLightComponentController::m_configuration, "Configuration", "") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->ClassElement(Edit::ClassElements::EditorData, "") + ->Attribute(Edit::Attributes::AutoExpand, true) + ->DataElement(Edit::UIHandlers::Default, &AreaLightComponentController::m_configuration, "Configuration", "") + ->Attribute(Edit::Attributes::Visibility, Edit::PropertyVisibility::ShowChildrenOnly) ; editContext->Class( "AreaLightComponentConfig", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->DataElement(AZ::Edit::UIHandlers::Color, &AreaLightComponentConfig::m_color, "Color", "Color of the light") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetLinearRgbEditorConfig()) - ->DataElement(AZ::Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_intensityMode, "Intensity Mode", "Allows specifying which photometric unit to work in.") - ->EnumAttribute(PhotometricUnit::Candela, "Candela") - ->EnumAttribute(PhotometricUnit::Lumen, "Lumen") - ->EnumAttribute(PhotometricUnit::Nit, "Nit") - ->EnumAttribute(PhotometricUnit::Ev100Luminance, "Ev100") + ->ClassElement(Edit::ClassElements::EditorData, "") + ->DataElement(Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_lightType, "Light Type", "Which type of light this component represents.") + ->EnumAttribute(AreaLightComponentConfig::LightType::Unknown, "Choose a Light Type") + ->EnumAttribute(AreaLightComponentConfig::LightType::Sphere, "Point (Sphere)") + ->EnumAttribute(AreaLightComponentConfig::LightType::SimplePoint, "Point (Simple)") + ->EnumAttribute(AreaLightComponentConfig::LightType::SpotDisk, "Spot (Disk)") + ->EnumAttribute(AreaLightComponentConfig::LightType::SimpleSpot, "Spot (Simple)") + ->EnumAttribute(AreaLightComponentConfig::LightType::Capsule, "Capsule") + ->EnumAttribute(AreaLightComponentConfig::LightType::Quad, "Quad") + ->EnumAttribute(AreaLightComponentConfig::LightType::Polygon, "Polygon") + ->DataElement(Edit::UIHandlers::Color, &AreaLightComponentConfig::m_color, "Color", "Color of the light") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->Attribute("ColorEditorConfiguration", RPI::ColorUtils::GetLinearRgbEditorConfig()) + ->DataElement(Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_intensityMode, "Intensity Mode", "Allows specifying which photometric unit to work in.") + ->Attribute(AZ::Edit::Attributes::EnumValues, &AreaLightComponentConfig::GetValidPhotometricUnits) ->DataElement(Edit::UIHandlers::Slider, &AreaLightComponentConfig::m_intensity, "Intensity", "Intensity of the light in the set photometric unit.") ->Attribute(Edit::Attributes::Min, &AreaLightComponentConfig::GetIntensityMin) ->Attribute(Edit::Attributes::Max, &AreaLightComponentConfig::GetIntensityMax) ->Attribute(Edit::Attributes::SoftMin, &AreaLightComponentConfig::GetIntensitySoftMin) ->Attribute(Edit::Attributes::SoftMax, &AreaLightComponentConfig::GetIntensitySoftMax) ->Attribute(Edit::Attributes::Suffix, &AreaLightComponentConfig::GetIntensitySuffix) - ->DataElement(AZ::Edit::UIHandlers::CheckBox, &AreaLightComponentConfig::m_lightEmitsBothDirections, "Both Directions", "Whether light should emit from both sides of the surface or just the front") - ->Attribute(AZ::Edit::Attributes::Visibility, &AreaLightComponentConfig::Is2DSurface) - ->DataElement(AZ::Edit::UIHandlers::CheckBox, &AreaLightComponentConfig::m_useFastApproximation, "Fast Approximation", "Whether the light should use the default high quality linear transformed cosine technique or a faster approximation.") - ->Attribute(AZ::Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsFastApproximation) - ->ClassElement(AZ::Edit::ClassElements::Group, "Attenuation Radius") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_attenuationRadiusMode, "Mode", "Controls whether the attenation radius is calculated automatically or set explicitly.") + ->DataElement(Edit::UIHandlers::CheckBox, &AreaLightComponentConfig::m_lightEmitsBothDirections, "Both Directions", "Whether light should emit from both sides of the surface or just the front") + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsBothDirections) + ->DataElement(Edit::UIHandlers::CheckBox, &AreaLightComponentConfig::m_useFastApproximation, "Fast Approximation", "Whether the light should use the default high quality linear transformed cosine technique or a faster approximation.") + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsFastApproximation) + ->ClassElement(Edit::ClassElements::Group, "Attenuation Radius") + ->Attribute(Edit::Attributes::AutoExpand, true) + ->DataElement(Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_attenuationRadiusMode, "Mode", "Controls whether the attenation radius is calculated automatically or set explicitly.") ->EnumAttribute(LightAttenuationRadiusMode::Automatic, "Automatic") ->EnumAttribute(LightAttenuationRadiusMode::Explicit, "Explicit") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues) - ->DataElement(AZ::Edit::UIHandlers::Default, &AreaLightComponentConfig::m_attenuationRadius, "Radius", "The distance at which this light no longer has an affect.") - ->Attribute(AZ::Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsAttenuationRadiusModeAutomatic) + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues) + ->DataElement(Edit::UIHandlers::Default, &AreaLightComponentConfig::m_attenuationRadius, "Radius", "The distance at which this light no longer has an affect.") + ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsAttenuationRadiusModeAutomatic) + + ->ClassElement(Edit::ClassElements::Group, "Shutters") + ->Attribute(Edit::Attributes::AutoExpand, true) + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShutters) + ->DataElement(Edit::UIHandlers::Default, &AreaLightComponentConfig::m_enableShutters, "Enable Shutters", "Restrict the light to a specific beam angle depending on shape.") + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::ShuttersMustBeEnabled) + ->DataElement(Edit::UIHandlers::Slider, &AreaLightComponentConfig::m_innerShutterAngleDegrees, "Inner Angle", "The inner angle of the shutters where the light beam begins to be occluded.") + ->Attribute(Edit::Attributes::Min, 0.0f) + ->Attribute(Edit::Attributes::Max, 180.0f) + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShutters) + ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::ShuttersDisabled) + ->DataElement(Edit::UIHandlers::Slider, &AreaLightComponentConfig::m_outerShutterAngleDegrees, "Outer Angle", "The outer angle of the shutters where the light beam is completely occluded.") + ->Attribute(Edit::Attributes::Min, 0.0f) + ->Attribute(Edit::Attributes::Max, 180.0f) + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShutters) + ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::ShuttersDisabled) + + ->ClassElement(Edit::ClassElements::Group, "Shadows") + ->Attribute(Edit::Attributes::AutoExpand, true) + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows) + ->DataElement(Edit::UIHandlers::Default, &AreaLightComponentConfig::m_enableShadow, "Enable Shadow", "Enable shadow for the light") + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows) + ->DataElement(Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_shadowmapMaxSize, "Shadowmap Size", "Width/Height of shadowmap") + ->EnumAttribute(ShadowmapSize::Size256, " 256") + ->EnumAttribute(ShadowmapSize::Size512, " 512") + ->EnumAttribute(ShadowmapSize::Size1024, "1024") + ->EnumAttribute(ShadowmapSize::Size2048, "2048") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows) + ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::ShadowsDisabled) + ->DataElement(Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_shadowFilterMethod, "Shadow Filter Method", + "Filtering method of edge-softening of shadows.\n" + " None: no filtering\n" + " PCF: Percentage-Closer Filtering\n" + " ESM: Exponential Shadow Maps\n" + " ESM+PCF: ESM with a PCF fallback\n" + "For BehaviorContext (or TrackView), None=0, PCF=1, ESM=2, ESM+PCF=3") + ->EnumAttribute(ShadowFilterMethod::None, "None") + ->EnumAttribute(ShadowFilterMethod::Pcf, "PCF") + ->EnumAttribute(ShadowFilterMethod::Esm, "ESM") + ->EnumAttribute(ShadowFilterMethod::EsmPcf, "ESM+PCF") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues) + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows) + ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::ShadowsDisabled) + ->DataElement(Edit::UIHandlers::Slider, &AreaLightComponentConfig::m_boundaryWidthInDegrees, "Softening Boundary Width", + "Width of the boundary between shadowed area and lit one. " + "Units are in degrees. " + "If this is 0, softening edge is disabled.") + ->Attribute(Edit::Attributes::Min, 0.f) + ->Attribute(Edit::Attributes::Max, 1.f) + ->Attribute(Edit::Attributes::Suffix, " deg") + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows) + ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsPcfBoundarySearchDisabled) + ->DataElement(Edit::UIHandlers::Slider, &AreaLightComponentConfig::m_predictionSampleCount, "Prediction Sample Count", + "Sample Count for prediction of whether the pixel is on the boundary. Specific to PCF and ESM+PCF.") + ->Attribute(Edit::Attributes::Min, 4) + ->Attribute(Edit::Attributes::Max, 16) + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows) + ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsPcfBoundarySearchDisabled) + ->DataElement(Edit::UIHandlers::Slider, &AreaLightComponentConfig::m_filteringSampleCount, "Filtering Sample Count", + "It is used only when the pixel is predicted to be on the boundary. Specific to PCF and ESM+PCF.") + ->Attribute(Edit::Attributes::Min, 4) + ->Attribute(Edit::Attributes::Max, 64) + ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows) + ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsShadowPcfDisabled) + ->DataElement( + Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_pcfMethod, "Pcf Method", + "Type of Pcf to use.\n" + " Boundary search: do several taps to first determine if we are on a shadow boundary\n" + " Bicubic: a smooth, fixed-size kernel \n") + ->EnumAttribute(PcfMethod::BoundarySearch, "Boundary Search") + ->EnumAttribute(PcfMethod::Bicubic, "Bicubic") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsShadowPcfDisabled); ; } } @@ -95,8 +182,8 @@ namespace AZ behaviorContext->Class()->RequestBus("AreaLightRequestBus"); behaviorContext->ConstantProperty("EditorAreaLightComponentTypeId", BehaviorConstant(Uuid(EditorAreaLightComponentTypeId))) - ->Attribute(AZ::Script::Attributes::Module, "render") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); + ->Attribute(Script::Attributes::Module, "render") + ->Attribute(Script::Attributes::Scope, Script::Attributes::ScopeFlags::Automation); } } @@ -119,14 +206,139 @@ namespace AZ BaseClass::Deactivate(); } - AZ::u32 EditorAreaLightComponent::OnConfigurationChanged() + bool EditorAreaLightComponent::HandleLightTypeChange() { + if (m_lightType == AreaLightComponentConfig::LightType::Unknown) + { + // Light type is unknown, see if it can be determined from a shape component. + Crc32 shapeType = Crc32(0); + LmbrCentral::ShapeComponentRequestsBus::EventResult(shapeType, GetEntityId(), &LmbrCentral::ShapeComponentRequestsBus::Events::GetShapeType); + + constexpr Crc32 SphereShapeTypeId = AZ_CRC_CE("Sphere"); + constexpr Crc32 DiskShapeTypeId = AZ_CRC_CE("DiskShape"); + constexpr Crc32 CapsuleShapeTypeId = AZ_CRC_CE("Capsule"); + constexpr Crc32 QuadShapeTypeId = AZ_CRC_CE("QuadShape"); + constexpr Crc32 PoylgonShapeTypeId = AZ_CRC_CE("PolygonPrism"); + + switch (shapeType) + { + case SphereShapeTypeId: + m_lightType = AreaLightComponentConfig::LightType::Sphere; + break; + case DiskShapeTypeId: + m_lightType = AreaLightComponentConfig::LightType::SpotDisk; + break; + case CapsuleShapeTypeId: + m_lightType = AreaLightComponentConfig::LightType::Capsule; + break; + case QuadShapeTypeId: + m_lightType = AreaLightComponentConfig::LightType::Quad; + break; + case PoylgonShapeTypeId: + m_lightType = AreaLightComponentConfig::LightType::Polygon; + break; + default: + break; // Light type can't be deduced. + } + } + + if (m_lightType == m_controller.m_configuration.m_lightType) + { + // No change, nothing to do + return false; + } + + // Update the cached light type. + m_lightType = m_controller.m_configuration.m_lightType; + + // componets may be removed or added here, so deactivate now and reactivate the entity when everything is done shifting around. + GetEntity()->Deactivate(); + + // Check if there is already a shape components and remove it. + for (Component* component : GetEntity()->GetComponents()) + { + ComponentDescriptor::DependencyArrayType provided; + ComponentDescriptor* componentDescriptor = nullptr; + EBUS_EVENT_ID_RESULT(componentDescriptor, component->RTTI_GetType(), ComponentDescriptorBus, GetDescriptor); + AZ_Assert(componentDescriptor, "Component class %s descriptor is not created! It must be before you can use it!", component->RTTI_GetTypeName()); + componentDescriptor->GetProvidedServices(provided, component); + auto providedItr = AZStd::find(provided.begin(), provided.end(), AZ_CRC_CE("ShapeService")); + if (providedItr != provided.end()) + { + AZStd::vector componentsToRemove = { component }; + AzToolsFramework::EntityCompositionRequests::RemoveComponentsOutcome outcome = + AZ::Failure(AZStd::string("Failed to remove old shape component.")); + AzToolsFramework::EntityCompositionRequestBus::BroadcastResult(outcome, &AzToolsFramework::EntityCompositionRequests::RemoveComponents, componentsToRemove); + break; + } + } + + // Add a new shape component for light types that require it. + + auto addComponentOfType = [&](AZ::Uuid type) + { + AzToolsFramework::EntityCompositionRequests::AddComponentsOutcome outcome = + AZ::Failure(AZStd::string("Failed to add shape component for light type")); + + const AZStd::vector entityList = { GetEntityId() }; + + AzToolsFramework::EntityCompositionRequestBus::BroadcastResult(outcome, &AzToolsFramework::EntityCompositionRequests::AddComponentsToEntities, + entityList, ComponentTypeList({ type })); + }; + + switch (m_lightType) + { + case AreaLightComponentConfig::LightType::Sphere: + addComponentOfType(LmbrCentral::EditorSphereShapeComponentTypeId); + break; + case AreaLightComponentConfig::LightType::SpotDisk: + addComponentOfType(LmbrCentral::EditorDiskShapeComponentTypeId); + break; + case AreaLightComponentConfig::LightType::Capsule: + addComponentOfType(LmbrCentral::EditorCapsuleShapeComponentTypeId); + break; + case AreaLightComponentConfig::LightType::Quad: + addComponentOfType(LmbrCentral::EditorQuadShapeComponentTypeId); + break; + case AreaLightComponentConfig::LightType::Polygon: + addComponentOfType(LmbrCentral::EditorPolygonPrismShapeComponentTypeId); + break; + default: + // Some light types don't require a shape, this is ok. + break; + } + + GetEntity()->Activate(); + + // Set more reasonable default values for certain shapes. + switch (m_lightType) + { + case AreaLightComponentConfig::LightType::Sphere: + LmbrCentral::SphereShapeComponentRequestsBus::Event(GetEntityId(), &LmbrCentral::SphereShapeComponentRequests::SetRadius, 0.05f); + break; + case AreaLightComponentConfig::LightType::SpotDisk: + LmbrCentral::DiskShapeComponentRequestBus::Event(GetEntityId(), &LmbrCentral::DiskShapeComponentRequests::SetRadius, 0.05f); + break; + } + + return true; + } + + u32 EditorAreaLightComponent::OnConfigurationChanged() + { + bool needsFullRefresh = HandleLightTypeChange(); + LmbrCentral::EditorShapeComponentRequestsBus::Event(GetEntityId(), &LmbrCentral::EditorShapeComponentRequests::SetShapeColor, m_controller.m_configuration.m_color); // If photometric unit changes, convert the intensities so the actual intensity doesn't change. m_controller.ConvertToIntensityMode(m_controller.m_configuration.m_intensityMode); BaseClass::OnConfigurationChanged(); + + if (needsFullRefresh) + { + return Edit::PropertyRefreshLevels::EntireTree; + } return Edit::PropertyRefreshLevels::AttributesAndValues; } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.h index f7d8157ecb..cb520b55db 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.h @@ -52,7 +52,11 @@ namespace AZ // EditorRenderComponentAdapter overrides... bool ShouldActivateController() const override; - AZ::u32 OnConfigurationChanged() override; + bool HandleLightTypeChange(); + + u32 OnConfigurationChanged() override; + + AreaLightComponentConfig::LightType m_lightType; // Used to detect when the configuration's light type changes. }; } // namespace Render diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp index d2ca747e83..c484db5e1e 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp @@ -145,14 +145,14 @@ namespace AZ ->Attribute(Edit::Attributes::Max, 0.1f) ->Attribute(Edit::Attributes::Suffix, " m") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsShadowFilteringDisabled) + ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsPcfBoundarySearchDisabled) ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_predictionSampleCount, "Prediction Sample Count", "Sample Count for prediction of whether the pixel is on the boundary. " "Specific to PCF and ESM+PCF.") ->Attribute(Edit::Attributes::Min, 4) ->Attribute(Edit::Attributes::Max, 16) ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsShadowPcfDisabled) + ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsPcfBoundarySearchDisabled) ->DataElement(Edit::UIHandlers::Slider, &DirectionalLightComponentConfig::m_filteringSampleCount, "Filtering Sample Count", "It is used only when the pixel is predicted as on the boundary. " "Specific to PCF and ESM+PCF.") @@ -160,7 +160,17 @@ namespace AZ ->Attribute(Edit::Attributes::Max, 64) ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsShadowPcfDisabled) - ; + ->DataElement( + Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_pcfMethod, "Pcf Method", + "Type of Pcf to use.\n" + " Boundary search: do several taps to first determine if we are on a shadow boundary\n" + " Bicubic: a smooth, fixed-size kernel \n") + ->EnumAttribute(PcfMethod::BoundarySearch, "Boundary Search") + ->EnumAttribute(PcfMethod::Bicubic, "Bicubic") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsShadowPcfDisabled); + ; + } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorPointLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorPointLightComponent.cpp deleted file mode 100644 index f9be9a8a7a..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorPointLightComponent.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include - -#include -#include -#include - -namespace AZ -{ - namespace Render - { - EditorPointLightComponent::EditorPointLightComponent(const PointLightComponentConfig& config) - : BaseClass(config) - { - } - - void EditorPointLightComponent::Reflect(AZ::ReflectContext* context) - { - BaseClass::Reflect(context); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(1, ConvertToEditorRenderComponentAdapter<1>); - - if (AZ::EditContext* editContext = serializeContext->GetEditContext()) - { - editContext->Class( - "Point Light", "A point light emits light in all directions from a single point in space.") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Category, "Atom") - ->Attribute(AZ::Edit::Attributes::Icon, "Editor/Icons/Components/Component_Placeholder.svg") - ->Attribute(AZ::Edit::Attributes::ViewportIcon, "editor/icons/components/viewport/component_placeholder.png") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game", 0x232b318c)) - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://docs.aws.amazon.com/lumberyard/latest/userguide/component-point-light.html") - ; - - editContext->Class( - "PointLightComponentController", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::Default, &PointLightComponentController::m_configuration, "Configuration", "") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) - ; - - editContext->Class( - "PointLightComponentConfig", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->DataElement(AZ::Edit::UIHandlers::Color, &PointLightComponentConfig::m_color, "Color", "Color of the light") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetLinearRgbEditorConfig()) - ->DataElement(Edit::UIHandlers::ComboBox, &PointLightComponentConfig::m_intensityMode, "Intensity Mode", "Allows specifying light values in candelas or lumens") - ->EnumAttribute(PhotometricUnit::Candela, "Candela") - ->EnumAttribute(PhotometricUnit::Lumen, "Lumen") - ->EnumAttribute(PhotometricUnit::Nit, "Nit") - ->EnumAttribute(PhotometricUnit::Ev100Luminance, "Ev100") - ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues) - ->DataElement(AZ::Edit::UIHandlers::Default, &PointLightComponentConfig::m_intensity, "Intensity", "Intensity of the light") - ->Attribute(AZ::Edit::Attributes::Min, 0.f) - ->Attribute(AZ::Edit::Attributes::Suffix, &PointLightComponentConfig::GetIntensitySuffix) - ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->DataElement(AZ::Edit::UIHandlers::Slider, &PointLightComponentConfig::m_bulbRadius, "Bulb Radius", "The size of the bulb in meters") - ->Attribute(AZ::Edit::Attributes::Min, 0.0f) - ->Attribute(AZ::Edit::Attributes::Max, 100000.0f) - ->Attribute(AZ::Edit::Attributes::SoftMin, 0.01f) - ->Attribute(AZ::Edit::Attributes::SoftMax, 1.0f) - ->Attribute(AZ::Edit::Attributes::Suffix, " m") - ->ClassElement(AZ::Edit::ClassElements::Group, "Attenuation Radius") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::ComboBox, &PointLightComponentConfig::m_attenuationRadiusMode, "Mode", "Controls whether the attenation radius is calculated automatically or set explicitly.") - ->EnumAttribute(LightAttenuationRadiusMode::Automatic, "Automatic") - ->EnumAttribute(LightAttenuationRadiusMode::Explicit, "Explicit") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues) - ->DataElement(AZ::Edit::UIHandlers::Default, &PointLightComponentConfig::m_attenuationRadius, "Radius", "The distance at which this light no longer has an affect.") - ->Attribute(AZ::Edit::Attributes::ReadOnly, &PointLightComponentConfig::IsAttenuationRadiusModeAutomatic) - ; - } - } - - if (auto behaviorContext = azrtti_cast(context)) - { - behaviorContext->Class()->RequestBus("PointLightRequestBus"); - - behaviorContext->ConstantProperty("EditorPointLightComponentTypeId", BehaviorConstant(Uuid(EditorPointLightComponentTypeId))) - ->Attribute(AZ::Script::Attributes::Module, "render") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); - } - } - - void EditorPointLightComponent::Activate() - { - BaseClass::Activate(); - AzFramework::EntityDebugDisplayEventBus::Handler::BusConnect(GetEntityId()); - AzToolsFramework::EditorComponentSelectionRequestsBus::Handler::BusConnect(GetEntityId()); - TransformNotificationBus::Handler::BusConnect(GetEntityId()); - AzFramework::BoundsRequestBus::Handler::BusConnect(GetEntityId()); - } - - void EditorPointLightComponent::Deactivate() - { - AzToolsFramework::EditorComponentSelectionRequestsBus::Handler::BusDisconnect(); - AzFramework::EntityDebugDisplayEventBus::Handler::BusDisconnect(); - BaseClass::Deactivate(); - } - - AZStd::tuple EditorPointLightComponent::GetRadiusAndPosition() const - { - Vector3 position = Vector3::CreateZero(); - AZ::TransformBus::EventResult(position, GetEntityId(), &AZ::TransformBus::Events::GetWorldTranslation); - return AZStd::tuple(m_controller.GetBulbRadius(), position); - } - - AZStd::tuple EditorPointLightComponent::GetViewportRadiusAndPosition(const AzFramework::ViewportInfo& viewportInfo) const - { - const auto [radius, position] = GetRadiusAndPosition(); - - constexpr float PixelRadius = 10.0f; - const AzFramework::CameraState cameraState = AzToolsFramework::GetCameraState(viewportInfo.m_viewportId); - const float distance = cameraState.m_position.GetDistance(position); - const float screenScale = (distance * cameraState.m_fovOrZoom) / cameraState.m_viewportSize.GetX(); - - return AZStd::tuple(AZ::GetMax(radius, screenScale * PixelRadius), position); - } - - void EditorPointLightComponent::DisplayEntityViewport( - const AzFramework::ViewportInfo& viewportInfo, - AzFramework::DebugDisplayRequests& debugDisplay) - { - debugDisplay.SetColor(m_controller.GetColor()); - - // Draw a sphere for the light itself. - auto [sphereSize, position] = GetViewportRadiusAndPosition(viewportInfo); - debugDisplay.DrawWireSphere(position, sphereSize); - - // Don't draw extra visualization unless selected. - if (!IsSelected()) - { - return; - } - - // Draw a sphere for the attenuation radius - debugDisplay.DrawWireSphere(position, m_controller.GetAttenuationRadius()); - } - - AZ::Aabb EditorPointLightComponent::GetEditorSelectionBoundsViewport(const AzFramework::ViewportInfo& viewportInfo) - { - auto [radius, position] = GetViewportRadiusAndPosition(viewportInfo); - return Aabb::CreateCenterRadius(position, radius); - } - - bool EditorPointLightComponent::EditorSelectionIntersectRayViewport( - const AzFramework::ViewportInfo& viewportInfo, const AZ::Vector3& src, const AZ::Vector3& dir, float& distance) - { - auto [radius, position] = GetViewportRadiusAndPosition(viewportInfo); - return AZ::Intersect::IntersectRaySphere(src, dir, position, radius, distance) > 0; - } - - void EditorPointLightComponent::OnTransformChanged([[maybe_unused]] const AZ::Transform& local, [[maybe_unused]] const AZ::Transform& world) - { - // Transform scale impacts the bulb radius and intensity of the light, so refresh the values. - AzToolsFramework::ToolsApplicationEvents::Bus::Broadcast( - &AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, - AzToolsFramework::Refresh_Values); - } - - AZ::Aabb EditorPointLightComponent::GetWorldBounds() - { - auto [radius, position] = GetRadiusAndPosition(); - return Aabb::CreateCenterRadius(position, radius); - } - - AZ::Aabb EditorPointLightComponent::GetLocalBounds() - { - return Aabb::CreateCenterRadius(AZ::Vector3::CreateZero(), m_controller.GetBulbRadius()); - } - - u32 EditorPointLightComponent::OnConfigurationChanged() - { - // Set the intenstiy of the photometric unit in case the controller is disabled. This is needed to correctly convert between photometric units. - m_controller.m_photometricValue.SetIntensity(m_controller.m_configuration.m_intensity); - - // If the intensity mode changes in the editor, convert the photometric value and update the intensity - if (m_controller.m_configuration.m_intensityMode != m_controller.m_photometricValue.GetType()) - { - m_controller.m_photometricValue.SetArea(m_controller.m_configuration.GetArea()); - m_controller.m_photometricValue.ConvertToPhotometricUnit(m_controller.m_configuration.m_intensityMode); - m_controller.m_configuration.m_intensity = m_controller.m_photometricValue.GetIntensity(); - } - - BaseClass::OnConfigurationChanged(); - return Edit::PropertyRefreshLevels::AttributesAndValues; - } - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorPointLightComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorPointLightComponent.h deleted file mode 100644 index 37855c9e04..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorPointLightComponent.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include -#include -#include -#include - -namespace AZ -{ - namespace Render - { - class EditorPointLightComponent final - : public EditorRenderComponentAdapter - , private AzToolsFramework::EditorComponentSelectionRequestsBus::Handler - , private AzFramework::EntityDebugDisplayEventBus::Handler - , private TransformNotificationBus::Handler - , public AzFramework::BoundsRequestBus::Handler - { - public: - using BaseClass = EditorRenderComponentAdapter; - AZ_EDITOR_COMPONENT(AZ::Render::EditorPointLightComponent, EditorPointLightComponentTypeId, BaseClass); - - static void Reflect(AZ::ReflectContext* context); - - EditorPointLightComponent() = default; - EditorPointLightComponent(const PointLightComponentConfig& config); - - void Activate() override; - void Deactivate() override; - - // EntityDebugDisplayEventBus overrides ... - void DisplayEntityViewport( - const AzFramework::ViewportInfo& viewportInfo, - AzFramework::DebugDisplayRequests& debugDisplay) override; - - // EditorComponentSelectionRequestsBus overrides ... - bool SupportsEditorRayIntersect() override { return true; } - bool EditorSelectionIntersectRayViewport( - const AzFramework::ViewportInfo& viewportInfo, const AZ::Vector3& src, const AZ::Vector3& dir, float& distance) override; - AZ::Aabb GetEditorSelectionBoundsViewport(const AzFramework::ViewportInfo& viewportInfo) override; - - // BoundsRequestBus overrides ... - AZ::Aabb GetWorldBounds() override; - AZ::Aabb GetLocalBounds() override; - - private: - AZStd::tuple GetRadiusAndPosition() const; - - // TransformNotificationBus::Handler overrides ... - void OnTransformChanged(const AZ::Transform& local, const AZ::Transform& world) override; - - //! Returns a radius for the light relative to the viewport, ensuring the the light will always take up at least a certain amount of - //! screen space for selection and debug drawing - AZStd::tuple GetViewportRadiusAndPosition(const AzFramework::ViewportInfo& viewportInfo) const; - - //! EditorRenderComponentAdapter overrides ... - u32 OnConfigurationChanged() override; - }; - - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorSpotLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorSpotLightComponent.cpp deleted file mode 100644 index 61a5d726c3..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorSpotLightComponent.cpp +++ /dev/null @@ -1,261 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include -#include -#include -#include - -namespace AZ -{ - namespace Render - { - EditorSpotLightComponent::EditorSpotLightComponent(const SpotLightComponentConfig& config) - : BaseClass(config) - { - } - - void EditorSpotLightComponent::Reflect(AZ::ReflectContext* context) - { - BaseClass::Reflect(context); - - if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(3, ConvertToEditorRenderComponentAdapter<2>); - - if (AZ::EditContext * editContext = serializeContext->GetEditContext()) - { - editContext->Class( - "Spot Light", "A spot light emits light in a cone from a single point in space.") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::Category, "Atom") - ->Attribute(AZ::Edit::Attributes::Icon, "Editor/Icons/Components/Component_Placeholder.svg") - ->Attribute(AZ::Edit::Attributes::ViewportIcon, "editor/icons/components/viewport/component_placeholder.png") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game", 0x232b318c)) - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->Attribute(AZ::Edit::Attributes::HelpPageURL, "https://docs.aws.amazon.com/lumberyard/latest/userguide/component-spot-light.html") - ; - - editContext->Class( - "SpotLightComponentController", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::Default, &SpotLightComponentController::m_configuration, "Configuration", "") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) - ; - - editContext->Class( - "SpotLightComponentConfig", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->DataElement(AZ::Edit::UIHandlers::Color, &SpotLightComponentConfig::m_color, "Color", "Color of the light") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute("ColorEditorConfiguration", AZ::RPI::ColorUtils::GetLinearRgbEditorConfig()) - ->DataElement(Edit::UIHandlers::ComboBox, &SpotLightComponentConfig::m_intensityMode, "Intensity Mode", - "Allows specifying light values in candelas or lumens") - ->EnumAttribute(PhotometricUnit::Candela, "Candela") - ->EnumAttribute(PhotometricUnit::Lumen, "Lumen") - ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues) - ->DataElement(AZ::Edit::UIHandlers::Default, &SpotLightComponentConfig::m_intensity, "Intensity", "Intensity of the light") - ->Attribute(AZ::Edit::Attributes::Min, 0.f) - ->Attribute(AZ::Edit::Attributes::Suffix, &SpotLightComponentConfig::GetIntensitySuffix) - ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->DataElement(AZ::Edit::UIHandlers::Slider, &SpotLightComponentConfig::m_bulbRadius, "Bulb Radius", - "Radius of the disk that represents the spot light bulb.") - ->Attribute(AZ::Edit::Attributes::Min, 0.f) - ->Attribute(AZ::Edit::Attributes::SoftMax, 0.25f) - ->Attribute(AZ::Edit::Attributes::Suffix, " m") - ->ClassElement(AZ::Edit::ClassElements::Group, "Cone Configuration") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::Slider, &SpotLightComponentConfig::m_innerConeDegrees, "Inner Cone Angle", - "Angle from the direction axis at which this light starts to fall off.") - ->Attribute(AZ::Edit::Attributes::Min, 0.f) - ->Attribute(AZ::Edit::Attributes::Max, &SpotLightComponentConfig::GetConeDegrees) - ->Attribute(AZ::Edit::Attributes::Suffix, " degrees") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->DataElement(AZ::Edit::UIHandlers::Slider, &SpotLightComponentConfig::m_outerConeDegrees, "Outer Cone Angle", - "Angle from the direction axis at which this light no longer has an effect.") - ->Attribute(AZ::Edit::Attributes::Min, 0.f) - ->Attribute(AZ::Edit::Attributes::Max, &SpotLightComponentConfig::GetConeDegrees) - ->Attribute(AZ::Edit::Attributes::Suffix, " degrees") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->DataElement(AZ::Edit::UIHandlers::Slider, &SpotLightComponentConfig::m_penumbraBias, "Penumbra Bias", - "Controls biasing the fall off curve of the penumbra towards the inner or outer cone angles.") - ->Attribute(AZ::Edit::Attributes::Min, -1.0f) - ->Attribute(AZ::Edit::Attributes::Max, 1.0f) - ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->ClassElement(AZ::Edit::ClassElements::Group, "Attenuation Radius") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::ComboBox, &SpotLightComponentConfig::m_attenuationRadiusMode, "Mode", - "Controls whether the attenuation radius is calculated automatically or set explicitly.") - ->EnumAttribute(LightAttenuationRadiusMode::Automatic, "Automatic") - ->EnumAttribute(LightAttenuationRadiusMode::Explicit, "Explicit") - ->Attribute(AZ::Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::AttributesAndValues) - ->DataElement(AZ::Edit::UIHandlers::Default, &SpotLightComponentConfig::m_attenuationRadius, "Radius", - "The distance at which this light no longer has an affect.") - ->Attribute(AZ::Edit::Attributes::ReadOnly, &SpotLightComponentConfig::IsAttenuationRadiusModeAutomatic) - ->ClassElement(AZ::Edit::ClassElements::Group, "Shadow") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(Edit::UIHandlers::Default, &SpotLightComponentConfig::m_enabledShadow, "Enable Shadow", "Enable shadow for the light") - ->DataElement(Edit::UIHandlers::ComboBox, &SpotLightComponentConfig::m_shadowmapSize, "Shadowmap Size", "Width/Height of shadowmap") - ->EnumAttribute(ShadowmapSize::Size256, " 256") - ->EnumAttribute(ShadowmapSize::Size512, " 512") - ->EnumAttribute(ShadowmapSize::Size1024, "1024") - ->EnumAttribute(ShadowmapSize::Size2048, "2048") - ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->DataElement(Edit::UIHandlers::ComboBox, &SpotLightComponentConfig::m_shadowFilterMethod, "Shadow Filter Method", - "Filtering method of edge-softening of shadows.\n" - " None: no filtering\n" - " PCF: Percentage-Closer Filtering\n" - " ESM: Exponential Shadow Maps\n" - " ESM+PCF: ESM with a PCF fallback\n" - "For BehaviorContext (or TrackView), None=0, PCF=1, ESM=2, ESM+PCF=3") - ->EnumAttribute(ShadowFilterMethod::None, "None") - ->EnumAttribute(ShadowFilterMethod::Pcf, "PCF") - ->EnumAttribute(ShadowFilterMethod::Esm, "ESM") - ->EnumAttribute(ShadowFilterMethod::EsmPcf, "ESM+PCF") - ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->DataElement(Edit::UIHandlers::Slider, &SpotLightComponentConfig::m_boundaryWidthInDegrees, "Softening Boundary Width", - "Width of the boundary between shadowed area and lit one. " - "Units are in degrees. " - "If this is 0, softening edge is disabled.") - ->Attribute(Edit::Attributes::Min, 0.f) - ->Attribute(Edit::Attributes::Max, 1.f) - ->Attribute(Edit::Attributes::Suffix, " deg") - ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute(Edit::Attributes::ReadOnly, &SpotLightComponentConfig::IsPcfBoundarySearchDisabled) - ->DataElement(Edit::UIHandlers::Slider, &SpotLightComponentConfig::m_predictionSampleCount, "Prediction Sample Count", - "Sample Count for prediction of whether the pixel is on the boundary. Specific to PCF and ESM+PCF.") - ->Attribute(Edit::Attributes::Min, 4) - ->Attribute(Edit::Attributes::Max, 16) - ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute(Edit::Attributes::ReadOnly, &SpotLightComponentConfig::IsPcfBoundarySearchDisabled) - ->DataElement(Edit::UIHandlers::Slider, &SpotLightComponentConfig::m_filteringSampleCount, "Filtering Sample Count", - "It is used only when the pixel is predicted to be on the boundary. Specific to PCF and ESM+PCF.") - ->Attribute(Edit::Attributes::Min, 4) - ->Attribute(Edit::Attributes::Max, 64) - ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute(Edit::Attributes::ReadOnly, &SpotLightComponentConfig::IsShadowPcfDisabled) - ->DataElement( - Edit::UIHandlers::ComboBox, &SpotLightComponentConfig::m_pcfMethod, "Pcf Method", - "Type of Pcf to use.\n" - " Boundary search: do several taps to first determine if we are on a shadow boundary\n" - " Bicubic: a smooth, fixed-size kernel \n") - ->EnumAttribute(PcfMethod::BoundarySearch, "Boundary Search") - ->EnumAttribute(PcfMethod::Bicubic, "Bicubic") - ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) - ->Attribute(Edit::Attributes::ReadOnly, &SpotLightComponentConfig::IsShadowPcfDisabled); - } - } - - if (auto behaviorContext = azrtti_cast(context)) - { - behaviorContext->Class()->RequestBus("SpotLightRequestBus"); - - behaviorContext->ConstantProperty("EditorSpotLightComponentTypeId", BehaviorConstant(Uuid(EditorSpotLightComponentTypeId))) - ->Attribute(AZ::Script::Attributes::Module, "render") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); - } - } - - void EditorSpotLightComponent::Activate() - { - BaseClass::Activate(); - AzFramework::EntityDebugDisplayEventBus::Handler::BusConnect(GetEntityId()); - } - - void EditorSpotLightComponent::Deactivate() - { - AzFramework::EntityDebugDisplayEventBus::Handler::BusDisconnect(); - BaseClass::Deactivate(); - } - - void EditorSpotLightComponent::DisplayEntityViewport( - const AzFramework::ViewportInfo& viewportInfo, - AzFramework::DebugDisplayRequests& debugDisplay) - { - AZ::Transform worldTM; - AZ::TransformBus::EventResult(worldTM, GetEntityId(), &AZ::TransformBus::Events::GetWorldTM); - const AZ::Vector3 position = worldTM.GetTranslation(); - - debugDisplay.SetColor(m_controller.GetColor()); - - // Draw a sphere for the light itself. - const float pixelRadius = 10.0f; - const AzFramework::CameraState cameraState = AzToolsFramework::GetCameraState(viewportInfo.m_viewportId); - const float distance = cameraState.m_position.GetDistance(position); - const float screenScale = (distance * cameraState.m_fovOrZoom) / cameraState.m_viewportSize.GetX(); - debugDisplay.DrawWireSphere(position, screenScale * pixelRadius); - - // Don't draw extra visualization unless selected. - if (!IsSelected()) - { - return; - } - - /* - * Draw rays to show the affected volume of the spot light. - * As well as two circle showing inner and outer cone angles. - * Note: the circles will not be drawn if cone are angles go beyond 90 degrees. - */ - worldTM.ExtractScale(); - debugDisplay.PushMatrix(worldTM); - debugDisplay.SetColor(m_controller.GetColor()); - - float outerConeHalfAngle = m_controller.GetOuterConeAngleInDegrees() * 0.5f; - float innerConeHalfAngle = m_controller.GetInnerConeAngleInDegrees() * 0.5f; - const float debugConeHeight = m_controller.GetAttenuationRadius(); - - const float debugOuterConeRadius = tanf(AZ::DegToRad(outerConeHalfAngle)) * debugConeHeight; - debugDisplay.DrawArrow(Vector3::CreateZero(), Vector3::CreateAxisY() * debugConeHeight * 0.5f, debugConeHeight * 0.2f); - - constexpr float rightAngleInDegrees = 90.0f; - if (outerConeHalfAngle < rightAngleInDegrees) - { - // outer cone - debugDisplay.DrawCircle(Vector3::CreateAxisY() * debugConeHeight, debugOuterConeRadius, 1); - } - if (innerConeHalfAngle < rightAngleInDegrees) - { - // inner cone - const float debugInnerConeRadius = tanf(AZ::DegToRad(innerConeHalfAngle)) * debugConeHeight; - debugDisplay.DrawCircle(Vector3::CreateAxisY() * debugConeHeight, debugInnerConeRadius, 1); - } - - constexpr int debugRays = 6; - for (int rayIndex = 0; rayIndex < debugRays; ++rayIndex) - { - const float angle = (AZ::Constants::TwoPi / debugRays) * rayIndex; - const Vector3 spotRay = Vector3::CreateAxisY() * debugConeHeight + debugOuterConeRadius * Vector3(sinf(angle), 0.f, cosf(angle)); - debugDisplay.DrawLine(Vector3::CreateZero(), spotRay * (outerConeHalfAngle > rightAngleInDegrees ? -1.f : 1.f)); - } - - debugDisplay.PopMatrix(); - } - - u32 EditorSpotLightComponent::OnConfigurationChanged() - { - // Set the intenstiy of the photometric unit in case the controller is disabled. This is needed to correctly convert between photometric units. - m_controller.m_photometricValue.SetIntensity(m_controller.m_configuration.m_intensity); - - // If the intensity mode changes in the editor, convert the photometric value and update the intensity - if (m_controller.m_configuration.m_intensityMode != m_controller.m_photometricValue.GetType()) - { - m_controller.m_photometricValue.ConvertToPhotometricUnit(m_controller.m_configuration.m_intensityMode); - m_controller.m_configuration.m_intensity = m_controller.m_photometricValue.GetIntensity(); - } - - BaseClass::OnConfigurationChanged(); - return Edit::PropertyRefreshLevels::AttributesAndValues; - } - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorSpotLightComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorSpotLightComponent.h deleted file mode 100644 index 1070854112..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorSpotLightComponent.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include -#include - -namespace AZ -{ - namespace Render - { - class EditorSpotLightComponent final - : public EditorRenderComponentAdapter - , private AzFramework::EntityDebugDisplayEventBus::Handler - { - public: - - using BaseClass = EditorRenderComponentAdapter; - AZ_EDITOR_COMPONENT(AZ::Render::EditorSpotLightComponent, EditorSpotLightComponentTypeId, BaseClass); - - static void Reflect(AZ::ReflectContext* context); - - EditorSpotLightComponent() = default; - EditorSpotLightComponent(const SpotLightComponentConfig& config); - - void Activate() override; - void Deactivate() override; - - // AzFramework::EntityDebugDisplayEventBus::Handler overrides... - void DisplayEntityViewport( - const AzFramework::ViewportInfo& viewportInfo, - AzFramework::DebugDisplayRequests& debugDisplay) override; - - // EditorComponentAdapter overrides... - AZ::u32 OnConfigurationChanged() override; - }; - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateBase.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateBase.h index 07c9c5160e..4cf94c1a58 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateBase.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateBase.h @@ -34,20 +34,32 @@ namespace AZ class LightDelegateBase : public LightDelegateInterface , private LmbrCentral::ShapeComponentNotificationsBus::Handler + , private TransformNotificationBus::Handler { public: LightDelegateBase(EntityId entityId, bool isVisible); virtual ~LightDelegateBase(); // LightDelegateInterface overrides... - virtual void SetChroma(const AZ::Color& chroma) override; - virtual void SetIntensity(float intensity) override; - virtual float SetPhotometricUnit(PhotometricUnit unit) override; - virtual void SetAttenuationRadius(float radius) override; - virtual const PhotometricValue& GetPhotometricValue() const override { return m_photometricValue; }; - virtual void SetLightEmitsBothDirections([[maybe_unused]] bool lightEmitsBothDirections) override {}; - virtual void SetUseFastApproximation([[maybe_unused]] bool useFastApproximation) override {}; - virtual void SetVisibility(bool visibility) override; + void SetChroma(const AZ::Color& chroma) override; + void SetIntensity(float intensity) override; + float SetPhotometricUnit(PhotometricUnit unit) override; + void SetAttenuationRadius(float radius) override; + const PhotometricValue& GetPhotometricValue() const override { return m_photometricValue; }; + void SetLightEmitsBothDirections([[maybe_unused]] bool lightEmitsBothDirections) override {}; + void SetUseFastApproximation([[maybe_unused]] bool useFastApproximation) override {}; + void SetVisibility(bool visibility) override; + + void SetEnableShutters(bool enabled) override { m_shuttersEnabled = enabled; }; + void SetShutterAngles([[maybe_unused]]float innerAngleDegrees, [[maybe_unused]]float outerAngleDegrees) override {}; + + void SetEnableShadow(bool enabled) override { m_shadowsEnabled = enabled; }; + void SetShadowmapMaxSize([[maybe_unused]] ShadowmapSize size) override {}; + void SetShadowFilterMethod([[maybe_unused]] ShadowFilterMethod method) override {}; + void SetSofteningBoundaryWidthAngle([[maybe_unused]] float widthInDegrees) override {}; + void SetPredictionSampleCount([[maybe_unused]] uint32_t count) override {}; + void SetFilteringSampleCount([[maybe_unused]] uint32_t count) override {}; + void SetPcfMethod([[maybe_unused]] PcfMethod method) override {}; protected: void InitBase(EntityId entityId); @@ -56,11 +68,15 @@ namespace AZ FeatureProcessorType* GetFeatureProcessor() const { return m_featureProcessor; }; typename FeatureProcessorType::LightHandle GetLightHandle() const { return m_lightHandle; }; const AZ::Transform& GetTransform() const { return m_transform; }; - + bool GetShuttersEnabled() { return m_shuttersEnabled; }; + bool GetShadowsEnabled() { return m_shadowsEnabled; }; virtual void HandleShapeChanged() = 0; // ShapeComponentNotificationsBus::Handler overrides... void OnShapeChanged(ShapeChangeReasons changeReason) override; + + // TransformNotificationBus::Handler overrides ... + void OnTransformChanged(const AZ::Transform& local, const AZ::Transform& world) override; private: FeatureProcessorType* m_featureProcessor = nullptr; @@ -69,6 +85,8 @@ namespace AZ LmbrCentral::ShapeComponentRequests* m_shapeBus; AZ::Transform m_transform; PhotometricValue m_photometricValue; + bool m_shuttersEnabled = false; + bool m_shadowsEnabled = false; }; } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateBase.inl b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateBase.inl index 4f2e02505c..ee4a29f1b0 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateBase.inl +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateBase.inl @@ -31,6 +31,7 @@ namespace AZ template LightDelegateBase::~LightDelegateBase() { + TransformNotificationBus::Handler::BusDisconnect(); LmbrCentral::ShapeComponentNotificationsBus::Handler::BusDisconnect(); if (m_lightHandle.IsValid()) { @@ -42,10 +43,21 @@ namespace AZ void LightDelegateBase::InitBase(EntityId entityId) { m_photometricValue.SetEffectiveSolidAngle(GetEffectiveSolidAngle()); - LmbrCentral::ShapeComponentNotificationsBus::Handler::BusConnect(entityId); m_shapeBus = LmbrCentral::ShapeComponentRequestsBus::FindFirstHandler(entityId); TransformBus::EventResult(m_transform, entityId, &TransformBus::Events::GetWorldTM); - OnShapeChanged(ShapeChangeReasons::TransformChanged); + + if (m_shapeBus != nullptr) + { + LmbrCentral::ShapeComponentNotificationsBus::Handler::BusConnect(entityId); + OnShapeChanged(ShapeChangeReasons::TransformChanged); + } + else if (m_lightHandle.IsValid()) + { + // Only connect to the transform bus if there's no shape bus, otherwise the shape bus handles transforms. + TransformNotificationBus::Handler::BusConnect(entityId); + HandleShapeChanged(); + m_featureProcessor->SetRgbIntensity(m_lightHandle, m_photometricValue.GetCombinedRgb()); + } } template @@ -95,6 +107,13 @@ namespace AZ } HandleShapeChanged(); } + + template + void LightDelegateBase::OnTransformChanged(const AZ::Transform& /*local*/, const AZ::Transform& world) + { + m_transform = world; + HandleShapeChanged(); + } template void LightDelegateBase::SetVisibility(bool isVisible) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateInterface.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateInterface.h index 2a5ae70bd8..110a7d73ad 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateInterface.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/LightDelegateInterface.h @@ -14,6 +14,7 @@ #include #include +#include namespace AzFramework { @@ -56,6 +57,31 @@ namespace AZ virtual void DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const = 0; //! Turns the visibility of this light on/off. virtual void SetVisibility(bool visibility) = 0; + + // Shutters + + // Sets if the light should be restricted to shutter angles. + virtual void SetEnableShutters(bool enabled) = 0; + // Sets the inner and outer angles of the shutters in degrees for where the light + // beam starts to attenuate (inner) to where it is completely occluded (outer). + virtual void SetShutterAngles(float innerAngleDegrees, float outerAngleDegrees) = 0; + + // Shadows + + //! Sets if shadows should be enabled + virtual void SetEnableShadow(bool enabled) = 0; + //! Sets the maximum resolution of the shadow map + virtual void SetShadowmapMaxSize(ShadowmapSize size) = 0; + //! Sets the filter method for the shadow + virtual void SetShadowFilterMethod(ShadowFilterMethod method) = 0; + //! Sets the width of boundary between shadowed area and lit area in degrees. + virtual void SetSofteningBoundaryWidthAngle(float widthInDegrees) = 0; + //! Sets the sample count to predict the boundary of the shadow. Max 16, should be less than filtering sample count. + virtual void SetPredictionSampleCount(uint32_t count) = 0; + //! Sets the sample count for filtering of the shadow boundary, max 64. + virtual void SetFilteringSampleCount(uint32_t count) = 0; + //! Sets the Pcf (Percentage closer filtering) method to use. + virtual void SetPcfMethod(PcfMethod method) = 0; }; } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponent.cpp deleted file mode 100644 index 98fdf47dfd..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponent.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include - -namespace AZ -{ - namespace Render - { - - PointLightComponent::PointLightComponent(const PointLightComponentConfig& config) - : BaseClass(config) - { - } - - void PointLightComponent::Reflect(AZ::ReflectContext* context) - { - BaseClass::Reflect(context); - - if (auto serializeContext = azrtti_cast(context)) - { - serializeContext->Class(); - } - - if (auto behaviorContext = azrtti_cast(context)) - { - behaviorContext->Class()->RequestBus("PointLightRequestBus"); - - behaviorContext->ConstantProperty("PointLightComponentTypeId", BehaviorConstant(Uuid(PointLightComponentTypeId))) - ->Attribute(AZ::Script::Attributes::Module, "render") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common); - } - } - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponent.h deleted file mode 100644 index b987a0aaf9..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponent.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include -#include - -namespace AZ -{ - namespace Render - { - class PointLightComponent final - : public AzFramework::Components::ComponentAdapter - { - public: - - using BaseClass = AzFramework::Components::ComponentAdapter; - AZ_COMPONENT(AZ::Render::PointLightComponent, PointLightComponentTypeId, BaseClass); - - PointLightComponent() = default; - PointLightComponent(const PointLightComponentConfig& config); - - static void Reflect(AZ::ReflectContext* context); - }; - - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponentController.cpp deleted file mode 100644 index 419ce2d5d2..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponentController.cpp +++ /dev/null @@ -1,286 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include - -#include -#include -#include - -#include - -namespace AZ -{ - namespace Render - { - void PointLightComponentConfig::Reflect(ReflectContext* context) - { - if (auto serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(2) - ->Field("Color", &PointLightComponentConfig::m_color) - ->Field("ColorIntensityMode", &PointLightComponentConfig::m_intensityMode) - ->Field("Intensity", &PointLightComponentConfig::m_intensity) - ->Field("AttenuationRadiusMode", &PointLightComponentConfig::m_attenuationRadiusMode) - ->Field("AttenuationRadius", &PointLightComponentConfig::m_attenuationRadius) - ->Field("BulbRadius", &PointLightComponentConfig::m_bulbRadius) - ; - } - } - - void PointLightComponentController::Reflect(ReflectContext* context) - { - PointLightComponentConfig::Reflect(context); - - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(1) - ->Field("Configuration", &PointLightComponentController::m_configuration); - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) - { - behaviorContext->EBus("PointLightRequestBus") - ->Attribute(AZ::Script::Attributes::Module, "render") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common) - ->Event("GetAttenuationRadius", &PointLightRequestBus::Events::GetAttenuationRadius) - ->Event("SetAttenuationRadius", &PointLightRequestBus::Events::SetAttenuationRadius) - ->Event("GetAttenuationRadiusIsAutomatic", &PointLightRequestBus::Events::GetAttenuationRadiusIsAutomatic) - ->Event("SetAttenuationRadiusIsAutomatic", &PointLightRequestBus::Events::SetAttenuationRadiusIsAutomatic) - ->Event("GetBulbRadius", &PointLightRequestBus::Events::GetBulbRadius) - ->Event("SetBulbRadius", &PointLightRequestBus::Events::SetBulbRadius) - ->Event("GetColor", &PointLightRequestBus::Events::GetColor) - ->Event("SetColor", &PointLightRequestBus::Events::SetColor) - ->Event("GetIntensity", &PointLightRequestBus::Events::GetIntensity) - ->Event("SetIntensity", static_cast(&PointLightRequestBus::Events::SetIntensity)) - ->Event("GetIntensityMode", &PointLightRequestBus::Events::GetIntensityMode) - ->Event("ConvertToIntensityMode", &PointLightRequestBus::Events::ConvertToIntensityMode) - ->VirtualProperty("AttenuationRadius", "GetAttenuationRadius", "SetAttenuationRadius") - ->VirtualProperty("AttenuationRadiusIsAutomatic", "GetAttenuationRadiusIsAutomatic", "SetAttenuationRadiusIsAutomatic") - ->VirtualProperty("BulbRadius", "GetBulbRadius", "SetBulbRadius") - ->VirtualProperty("Color", "GetColor", "SetColor") - ->VirtualProperty("Intensity", "GetIntensity", "SetIntensity") - ; - } - } - - void PointLightComponentController::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) - { - provided.push_back(AZ_CRC("PointLightService", 0x951d2403)); - } - - void PointLightComponentController::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) - { - incompatible.push_back(AZ_CRC("PointLightService", 0x951d2403)); - } - - PointLightComponentController::PointLightComponentController(const PointLightComponentConfig& config) - : m_configuration(config) - { - } - - void PointLightComponentController::Activate(EntityId entityId) - { - m_entityId = entityId; - m_featureProcessor = RPI::Scene::GetFeatureProcessorForEntity(entityId); - AZ_Error("PointLightComponentController", m_featureProcessor, "Could not find a PointLightFeatureProcessorInterface on the scene."); - - if (m_featureProcessor) - { - m_lightHandle = m_featureProcessor->AcquireLight(); - - AZ::Vector3 position = Vector3::CreateZero(); - AZ::TransformBus::EventResult(position, entityId, &AZ::TransformBus::Events::GetWorldTranslation); - m_featureProcessor->SetPosition(m_lightHandle, position); - - AZ::Vector3 scale = AZ::Vector3::CreateOne(); - AZ::TransformBus::EventResult(scale, entityId, &AZ::TransformBus::Events::GetWorldScale); - m_configuration.m_scale = scale.GetMaxElement(); - - TransformNotificationBus::Handler::BusConnect(m_entityId); - PointLightRequestBus::Handler::BusConnect(m_entityId); - ConfigurationChanged(); - } - } - - void PointLightComponentController::Deactivate() - { - PointLightRequestBus::Handler::BusDisconnect(m_entityId); - TransformNotificationBus::Handler::BusDisconnect(m_entityId); - - if (m_featureProcessor) - { - m_featureProcessor->ReleaseLight(m_lightHandle); - } - m_entityId.SetInvalid(); - } - - void PointLightComponentController::SetConfiguration(const PointLightComponentConfig& config) - { - m_configuration = config; - ConfigurationChanged(); - } - - const PointLightComponentConfig& PointLightComponentController::GetConfiguration() const - { - return m_configuration; - } - - void PointLightComponentController::OnTransformChanged(const AZ::Transform& /*local*/, const AZ::Transform& world) - { - m_featureProcessor->SetPosition(m_lightHandle, world.GetTranslation()); - if (m_configuration.m_scale != world.GetScale().GetMaxElement()) - { - m_configuration.UpdateScale(world.GetScale().GetMaxElement()); - BulbRadiusChanged(); - ColorIntensityChanged(); - } - } - - void PointLightComponentController::ConfigurationChanged() - { - m_configuration.UpdateUnscaledIntensity(); - m_configuration.UpdateUnscaledBulbRadius(); - - m_photometricValue = PhotometricValue(m_configuration.m_intensity, m_configuration.m_color, m_configuration.m_intensityMode); - m_photometricValue.SetArea(m_configuration.GetArea()); - - ColorIntensityChanged(); - AttenuationRadiusChanged(); - BulbRadiusChanged(); - } - - void PointLightComponentController::ColorIntensityChanged() - { - PointLightNotificationBus::Event(m_entityId, &PointLightNotifications::OnColorOrIntensityChanged, m_configuration.m_color, m_configuration.m_intensity); - - m_photometricValue.SetChroma(m_configuration.m_color); - m_photometricValue.SetIntensity(m_configuration.m_intensity); - m_featureProcessor->SetRgbIntensity(m_lightHandle, m_photometricValue.GetCombinedRgb()); - } - - void PointLightComponentController::AttenuationRadiusChanged() - { - if (m_configuration.m_attenuationRadiusMode == LightAttenuationRadiusMode::Automatic) - { - AutoCalculateAttenuationRadius(); - } - PointLightNotificationBus::Event(m_entityId, &PointLightNotifications::OnAttenutationRadiusChanged, m_configuration.m_attenuationRadius); - m_featureProcessor->SetAttenuationRadius(m_lightHandle, m_configuration.m_attenuationRadius); - } - - void PointLightComponentController::BulbRadiusChanged() - { - m_photometricValue.SetArea(m_configuration.GetArea()); - PointLightNotificationBus::Event(m_entityId, &PointLightNotifications::OnBulbRadiusChanged, m_configuration.m_bulbRadius); - m_featureProcessor->SetBulbRadius(m_lightHandle, m_configuration.m_bulbRadius); - } - - void PointLightComponentController::AutoCalculateAttenuationRadius() - { - // Get combined intensity luma from m_photometricValue, then calculate the radius at which the irradiance will be equal to cutoffIntensity. - static const float CutoffIntensity = 0.1f; // Make this configurable later. - - float intensity = m_photometricValue.GetCombinedIntensity(PhotometricUnit::Lumen); - m_configuration.m_attenuationRadius = sqrt(intensity / CutoffIntensity); - } - - const Color& PointLightComponentController::GetColor() const - { - return m_configuration.m_color; - } - - void PointLightComponentController::SetColor(const Color& color) - { - m_configuration.m_color = color; - - PointLightNotificationBus::Event(m_entityId, &PointLightNotifications::OnColorChanged, color); - ColorIntensityChanged(); - } - - float PointLightComponentController::GetIntensity() const - { - return m_configuration.m_intensity; - } - - void PointLightComponentController::SetIntensity(float intensity) - { - m_configuration.m_intensity = intensity; - m_configuration.UpdateUnscaledIntensity(); - - PointLightNotificationBus::Event(m_entityId, &PointLightNotifications::OnIntensityChanged, intensity); - ColorIntensityChanged(); - } - - void PointLightComponentController::SetIntensity(float intensity, PhotometricUnit intensityMode) - { - m_configuration.m_intensityMode = intensityMode; - SetIntensity(intensity); - } - - PhotometricUnit PointLightComponentController::GetIntensityMode() const - { - return m_configuration.m_intensityMode; - } - - void PointLightComponentController::ConvertToIntensityMode(PhotometricUnit intensityMode) - { - if (m_configuration.m_intensityMode != intensityMode) - { - m_configuration.m_intensityMode = intensityMode; - m_photometricValue.ConvertToPhotometricUnit(intensityMode); - m_configuration.m_intensity = m_photometricValue.GetIntensity(); - m_configuration.UpdateUnscaledIntensity(); - } - } - - float PointLightComponentController::GetAttenuationRadius() const - { - return m_configuration.m_attenuationRadius; - } - - void PointLightComponentController::SetAttenuationRadius(float radius) - { - m_configuration.m_attenuationRadius = radius; - AttenuationRadiusChanged(); - } - - float PointLightComponentController::GetBulbRadius() const - { - return m_configuration.m_bulbRadius; - } - - void PointLightComponentController::SetBulbRadius(float bulbRadius) - { - m_configuration.m_bulbRadius = bulbRadius; - m_configuration.UpdateUnscaledBulbRadius(); - BulbRadiusChanged(); - } - - bool PointLightComponentController::GetAttenuationRadiusIsAutomatic() const - { - return (m_configuration.m_attenuationRadiusMode == LightAttenuationRadiusMode::Automatic); - } - - void PointLightComponentController::SetAttenuationRadiusMode(LightAttenuationRadiusMode attenuationRadiusMode) - { - m_configuration.m_attenuationRadiusMode = attenuationRadiusMode; - if (attenuationRadiusMode == LightAttenuationRadiusMode::Automatic) - { - AutoCalculateAttenuationRadius(); - } - } - - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponentController.h deleted file mode 100644 index f249fd4595..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PointLightComponentController.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include -#include - -#include -#include - -#include -#include - -namespace AZ -{ - namespace Render - { - class PointLightComponentController final - : private TransformNotificationBus::Handler - , public PointLightRequestBus::Handler - { - public: - friend class EditorPointLightComponent; - - AZ_TYPE_INFO(AZ::Render::PointLightComponentController, "{23F82E30-2E1F-45FE-A9A7-B15632ED9EBD}"); - static void Reflect(AZ::ReflectContext* context); - static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); - static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); - - PointLightComponentController() = default; - PointLightComponentController(const PointLightComponentConfig& config); - - void Activate(EntityId entityId); - void Deactivate(); - void SetConfiguration(const PointLightComponentConfig& config); - const PointLightComponentConfig& GetConfiguration() const; - - private: - - AZ_DISABLE_COPY(PointLightComponentController); - - // TransformNotificationBus::Handler overrides ... - void OnTransformChanged(const AZ::Transform& local, const AZ::Transform& world) override; - - // PointLightRequestBus::Handler overrides ... - const Color& GetColor() const override; - void SetColor(const Color& color) override; - float GetIntensity() const override; - PhotometricUnit GetIntensityMode() const override; - void SetIntensity(float intensity) override; - void SetIntensity(float intensity, PhotometricUnit intensityMode) override; - - float GetAttenuationRadius() const override; - void SetAttenuationRadius(float radius) override; - bool GetAttenuationRadiusIsAutomatic() const override; - void SetAttenuationRadiusMode(LightAttenuationRadiusMode attenuationRadiusMode) override; - float GetBulbRadius() const override; - void SetBulbRadius(float bulbRadius) override; - void ConvertToIntensityMode(PhotometricUnit intensityMode) override; - - void ConfigurationChanged(); - void ColorIntensityChanged(); - void AttenuationRadiusChanged(); - void BulbRadiusChanged(); - - void AutoCalculateAttenuationRadius(); - - PointLightComponentConfig m_configuration; - PhotometricValue m_photometricValue; - PointLightFeatureProcessorInterface* m_featureProcessor = nullptr; - PointLightFeatureProcessorInterface::LightHandle m_lightHandle; - EntityId m_entityId; - }; - - } // namespace Render -} // AZ namespace diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.cpp new file mode 100644 index 0000000000..a2a24c3055 --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.cpp @@ -0,0 +1,56 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + SimplePointLightDelegate::SimplePointLightDelegate(EntityId entityId, bool isVisible) + : LightDelegateBase(entityId, isVisible) + { + InitBase(entityId); + GetFeatureProcessor()->SetPosition(GetLightHandle(), GetTransform().GetTranslation()); + } + float SimplePointLightDelegate::CalculateAttenuationRadius(float lightThreshold) const + { + // Calculate the radius at which the irradiance will be equal to cutoffIntensity. + float intensity = GetPhotometricValue().GetCombinedIntensity(PhotometricUnit::Lumen); + return sqrt(intensity / lightThreshold); + } + + float SimplePointLightDelegate::GetSurfaceArea() const + { + return 0.0f; + } + + void SimplePointLightDelegate::HandleShapeChanged() + { + GetFeatureProcessor()->SetPosition(GetLightHandle(), GetTransform().GetTranslation()); + } + + void SimplePointLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const + { + if (isSelected) + { + debugDisplay.SetColor(color); + + // Draw a sphere for the attenuation radius + debugDisplay.DrawWireSphere(transform.GetTranslation(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity)); + } + } + } // namespace Render +} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.h new file mode 100644 index 0000000000..57f8539d84 --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimplePointLightDelegate.h @@ -0,0 +1,44 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include + +#include +#include + +namespace AZ +{ + namespace Render + { + class SimplePointLightDelegate final + : public LightDelegateBase + { + public: + SimplePointLightDelegate(EntityId entityId, bool isVisible); + + // LightDelegateBase overrides... + float CalculateAttenuationRadius(float lightThreshold) const override; + void DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const override; + float GetSurfaceArea() const override; + float GetEffectiveSolidAngle() const override { return PhotometricValue::OmnidirectionalSteradians; } + + private: + virtual void HandleShapeChanged(); + + }; + + } // namespace Render +} // namespace AZ + diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimpleSpotLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimpleSpotLightDelegate.cpp new file mode 100644 index 0000000000..255f527557 --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimpleSpotLightDelegate.cpp @@ -0,0 +1,58 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include + +namespace AZ::Render +{ + SimpleSpotLightDelegate::SimpleSpotLightDelegate(EntityId entityId, bool isVisible) + : LightDelegateBase(entityId, isVisible) + { + InitBase(entityId); + } + + void SimpleSpotLightDelegate::HandleShapeChanged() + { + GetFeatureProcessor()->SetPosition(GetLightHandle(), GetTransform().GetTranslation()); + GetFeatureProcessor()->SetDirection(GetLightHandle(), GetTransform().GetBasisZ()); + } + + float SimpleSpotLightDelegate::CalculateAttenuationRadius(float lightThreshold) const + { + // Calculate the radius at which the irradiance will be equal to cutoffIntensity. + float intensity = GetPhotometricValue().GetCombinedIntensity(PhotometricUnit::Lumen); + return sqrt(intensity / lightThreshold); + } + + float SimpleSpotLightDelegate::GetSurfaceArea() const + { + return 0.0f; + } + + void SimpleSpotLightDelegate::SetShutterAngles(float innerAngleDegrees, float outerAngleDegrees) + { + GetFeatureProcessor()->SetConeAngles(GetLightHandle(), DegToRad(innerAngleDegrees), DegToRad(outerAngleDegrees)); + } + + void SimpleSpotLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const + { + if (isSelected) + { + debugDisplay.SetColor(color); + + // Draw a cone for the cone angle and attenuation radius + debugDisplay.DrawCone(transform.GetTranslation(), transform.GetBasisX(), CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity), false); + } + } +} // namespace AZ::Render diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimpleSpotLightDelegate.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimpleSpotLightDelegate.h new file mode 100644 index 0000000000..66569fc27c --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SimpleSpotLightDelegate.h @@ -0,0 +1,44 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include + +#include +#include + +namespace AZ +{ + namespace Render + { + class SimpleSpotLightDelegate final + : public LightDelegateBase + { + public: + SimpleSpotLightDelegate(EntityId entityId, bool isVisible); + + // LightDelegateBase overrides... + float CalculateAttenuationRadius(float lightThreshold) const override; + void DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const override; + float GetSurfaceArea() const override; + float GetEffectiveSolidAngle() const override { return PhotometricValue::DirectionalEffectiveSteradians; } + void SetShutterAngles(float innerAngleDegrees, float outerAngleDegrees) override; + private: + virtual void HandleShapeChanged(); + + }; + + } // namespace Render +} // namespace AZ + diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponent.cpp deleted file mode 100644 index 812ba53f3f..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponent.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include - -namespace AZ -{ - namespace Render - { - - SpotLightComponent::SpotLightComponent(const SpotLightComponentConfig& config) - : BaseClass(config) - { - } - - void SpotLightComponent::Reflect(AZ::ReflectContext* context) - { - BaseClass::Reflect(context); - - if (auto serializeContext = azrtti_cast(context)) - { - serializeContext->Class(); - } - - if (auto behaviorContext = azrtti_cast(context)) - { - behaviorContext->Class()->RequestBus("SpotLightRequestBus"); - - behaviorContext->ConstantProperty("SpotLightComponentTypeId", BehaviorConstant(Uuid(SpotLightComponentTypeId))) - ->Attribute(AZ::Script::Attributes::Module, "render") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common); - } - } - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponent.h deleted file mode 100644 index cf4f93ba02..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponent.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include - -namespace AZ -{ - namespace Render - { - class SpotLightComponent final - : public AzFramework::Components::ComponentAdapter - { - public: - - using BaseClass = AzFramework::Components::ComponentAdapter; - AZ_COMPONENT(AZ::Render::SpotLightComponent, SpotLightComponentTypeId, BaseClass); - - SpotLightComponent() = default; - SpotLightComponent(const SpotLightComponentConfig& config); - - static void Reflect(AZ::ReflectContext* context); - }; - - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponentConfig.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponentConfig.cpp deleted file mode 100644 index c68b505c57..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponentConfig.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include -#include -#include - -namespace AZ -{ - namespace Render - { - void SpotLightComponentConfig::Reflect(ReflectContext* context) - { - if (auto serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(4) - ->Field("Color", &SpotLightComponentConfig::m_color) - ->Field("Intensity", &SpotLightComponentConfig::m_intensity) - ->Field("IntensityMode", &SpotLightComponentConfig::m_intensityMode) - ->Field("Bulb Radius", &SpotLightComponentConfig::m_bulbRadius) - ->Field("Inner Cone Angle", &SpotLightComponentConfig::m_innerConeDegrees) - ->Field("Outer Cone Angle", &SpotLightComponentConfig::m_outerConeDegrees) - ->Field("Attenuation Radius", &SpotLightComponentConfig::m_attenuationRadius) - ->Field("Attenuation Radius Mode", &SpotLightComponentConfig::m_attenuationRadiusMode) - ->Field("Penumbra Bias", &SpotLightComponentConfig::m_penumbraBias) - ->Field("Enabled Shadow", &SpotLightComponentConfig::m_enabledShadow) - ->Field("Shadowmap Size", &SpotLightComponentConfig::m_shadowmapSize) - ->Field("Shadow Filter Method", &SpotLightComponentConfig::m_shadowFilterMethod) - ->Field("Softening Boundary Width", &SpotLightComponentConfig::m_boundaryWidthInDegrees) - ->Field("Prediction Sample Count", &SpotLightComponentConfig::m_predictionSampleCount) - ->Field("Filtering Sample Count", &SpotLightComponentConfig::m_filteringSampleCount) - ->Field("Pcf Method", &SpotLightComponentConfig::m_pcfMethod); - } - } - - bool SpotLightComponentConfig::IsAttenuationRadiusModeAutomatic() const - { - return m_attenuationRadiusMode == LightAttenuationRadiusMode::Automatic; - } - - const char* SpotLightComponentConfig::GetIntensitySuffix() const - { - return PhotometricValue::GetTypeSuffix(m_intensityMode); - } - - float SpotLightComponentConfig::GetConeDegrees() const - { - return (m_enabledShadow && m_shadowmapSize != ShadowmapSize::None) ? MaxSpotLightConeAngleDegreeWithShadow : MaxSpotLightConeAngleDegree; - } - - bool SpotLightComponentConfig::IsShadowFilteringDisabled() const - { - return (m_shadowFilterMethod == ShadowFilterMethod::None); - } - - bool SpotLightComponentConfig::IsShadowPcfDisabled() const - { - return !(m_shadowFilterMethod == ShadowFilterMethod::Pcf || - m_shadowFilterMethod == ShadowFilterMethod::EsmPcf); - } - - bool SpotLightComponentConfig::IsPcfBoundarySearchDisabled() const - { - if (IsShadowPcfDisabled()) - { - return true; - } - - return m_pcfMethod != PcfMethod::BoundarySearch; - } - - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponentController.cpp deleted file mode 100644 index 42230bbf3e..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponentController.cpp +++ /dev/null @@ -1,434 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include - -#include -#include - -#include - -namespace AZ -{ - namespace Render - { - void SpotLightComponentController::Reflect(ReflectContext* context) - { - SpotLightComponentConfig::Reflect(context); - - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(3) - ->Field("Configuration", &SpotLightComponentController::m_configuration); - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) - { - behaviorContext - ->Enum(ShadowFilterMethod::None)>("ShadowFilterMethod_None") - ->Enum(ShadowFilterMethod::Pcf)>("ShadowFilterMethod_PCF") - ->Enum(ShadowFilterMethod::Esm)>("ShadowFilterMethod_ESM") - ->Enum(ShadowFilterMethod::EsmPcf)>("ShadowFilterMethod_ESM_PCF") - ->Enum(ShadowmapSize::None)>("ShadowmapSize_None") - ->Enum(ShadowmapSize::Size256)>("ShadowmapSize_256") - ->Enum(ShadowmapSize::Size512)>("ShadowmapSize_512") - ->Enum(ShadowmapSize::Size1024)>("ShadowmapSize_1024") - ->Enum(ShadowmapSize::Size2048)>("ShadowmapSize_2045") - ; - - behaviorContext->EBus("SpotLightRequestBus") - ->Attribute(AZ::Script::Attributes::Module, "render") - ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common) - ->Event("GetAttenuationRadius", &SpotLightRequestBus::Events::GetAttenuationRadius) - ->Event("SetAttenuationRadius", &SpotLightRequestBus::Events::SetAttenuationRadius) - ->Event("GetAttenuationRadiusIsAutomatic", &SpotLightRequestBus::Events::GetAttenuationRadiusIsAutomatic) - ->Event("SetAttenuationRadiusIsAutomatic", &SpotLightRequestBus::Events::SetAttenuationRadiusIsAutomatic) - ->Event("GetColor", &SpotLightRequestBus::Events::GetColor) - ->Event("SetColor", &SpotLightRequestBus::Events::SetColor) - ->Event("GetIntensity", &SpotLightRequestBus::Events::GetIntensity) - ->Event("SetIntensity", &SpotLightRequestBus::Events::SetIntensity) - ->Event("GetBulbRadius", &SpotLightRequestBus::Events::GetBulbRadius) - ->Event("SetBulbRadius", &SpotLightRequestBus::Events::SetBulbRadius) - ->Event("GetInnerConeAngleInDegrees", &SpotLightRequestBus::Events::GetInnerConeAngleInDegrees) - ->Event("SetInnerConeAngleInDegrees", &SpotLightRequestBus::Events::SetInnerConeAngleInDegrees) - ->Event("GetOuterConeAngleInDegrees", &SpotLightRequestBus::Events::GetOuterConeAngleInDegrees) - ->Event("SetOuterConeAngleInDegrees", &SpotLightRequestBus::Events::SetOuterConeAngleInDegrees) - ->Event("GetPenumbraBias", &SpotLightRequestBus::Events::GetPenumbraBias) - ->Event("SetPenumbraBias", &SpotLightRequestBus::Events::SetPenumbraBias) - ->Event("GetEnableShadow", &SpotLightRequestBus::Events::GetEnableShadow) - ->Event("SetEnableShadow", &SpotLightRequestBus::Events::SetEnableShadow) - ->Event("GetShadowmapSize", &SpotLightRequestBus::Events::GetShadowmapSize) - ->Event("SetShadowmapSize", &SpotLightRequestBus::Events::SetShadowmapSize) - ->Event("GetShadowFilterMethod", &SpotLightRequestBus::Events::GetShadowFilterMethod) - ->Event("SetShadowFilterMethod", &SpotLightRequestBus::Events::SetShadowFilterMethod) - ->Event("GetSofteningBoundaryWidthAngle", &SpotLightRequestBus::Events::GetSofteningBoundaryWidthAngle) - ->Event("SetSofteningBoundaryWidthAngle", &SpotLightRequestBus::Events::SetSofteningBoundaryWidthAngle) - ->Event("GetPredictionSampleCount", &SpotLightRequestBus::Events::GetPredictionSampleCount) - ->Event("SetPredictionSampleCount", &SpotLightRequestBus::Events::SetPredictionSampleCount) - ->Event("GetFilteringSampleCount", &SpotLightRequestBus::Events::GetFilteringSampleCount) - ->Event("SetFilteringSampleCount", &SpotLightRequestBus::Events::SetFilteringSampleCount) - ->Event("GetPcfMethod", &SpotLightRequestBus::Events::GetPcfMethod) - ->Event("SetPcfMethod", &SpotLightRequestBus::Events::SetPcfMethod) - ->VirtualProperty("AttenuationRadius", "GetAttenuationRadius", "SetAttenuationRadius") - ->VirtualProperty("AttenuationRadiusIsAutomatic", "GetAttenuationRadiusIsAutomatic", "SetAttenuationRadiusIsAutomatic") - ->VirtualProperty("Color", "GetColor", "SetColor") - ->VirtualProperty("Intensity", "GetIntensity", "SetIntensity") - ->VirtualProperty("InnerConeAngleInDegrees", "GetInnerConeAngleInDegrees", "SetInnerConeAngleInDegrees") - ->VirtualProperty("OuterConeAngleInDegrees", "GetOuterConeAngleInDegrees", "SetOuterConeAngleInDegrees") - ->VirtualProperty("PenumbraBias", "GetPenumbraBias", "SetPenumbraBias") - ->VirtualProperty("EnableShadow", "GetEnableShadow", "SetEnableShadow") - ->VirtualProperty("ShadowmapSize", "GetShadowmapSize", "SetShadowmapSize") - ->VirtualProperty("ShadowFilterMethod", "GetShadowFilterMethod", "SetShadowFilterMethod") - ->VirtualProperty("SofteningBoundaryWidthAngle", "GetSofteningBoundaryWidthAngle", "SetSofteningBoundaryWidthAngle") - ->VirtualProperty("PredictionSampleCount", "GetPredictionSampleCount", "SetPredictionSampleCount") - ->VirtualProperty("FilteringSampleCount", "GetFilteringSampleCount", "SetFilteringSampleCount") - ->VirtualProperty("PcfMethod", "GetPcfMethod", "SetPcfMethod"); - } - } - - void SpotLightComponentController::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) - { - provided.push_back(AZ_CRC("SpotLightService", 0x3ae7d498)); - } - - void SpotLightComponentController::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) - { - incompatible.push_back(AZ_CRC("SpotLightService", 0x3ae7d498)); - } - - SpotLightComponentController::SpotLightComponentController(const SpotLightComponentConfig& config) - : m_configuration(config) - { - } - - void SpotLightComponentController::Activate(EntityId entityId) - { - m_entityId = entityId; - m_featureProcessor = RPI::Scene::GetFeatureProcessorForEntity(entityId); - AZ_Error("SpotLightComponentController", m_featureProcessor, "Could not find a SpotLightFeatureProcessorInterface on the scene."); - - if (m_featureProcessor) - { - m_lightHandle = m_featureProcessor->AcquireLight(); - - TransformNotificationBus::Handler::BusConnect(m_entityId); - SpotLightRequestBus::Handler::BusConnect(m_entityId); - ConfigurationChanged(); - } - } - - void SpotLightComponentController::Deactivate() - { - SpotLightRequestBus::Handler::BusDisconnect(m_entityId); - TransformNotificationBus::Handler::BusDisconnect(m_entityId); - - if (m_featureProcessor) - { - m_featureProcessor->ReleaseLight(m_lightHandle); - } - m_entityId.SetInvalid(); - } - - void SpotLightComponentController::SetConfiguration(const SpotLightComponentConfig& config) - { - m_configuration = config; - ConfigurationChanged(); - } - - const SpotLightComponentConfig& SpotLightComponentController::GetConfiguration() const - { - return m_configuration; - } - - void SpotLightComponentController::OnTransformChanged(const AZ::Transform& /*local*/, const AZ::Transform& world) - { - m_featureProcessor->SetPosition(m_lightHandle, world.GetTranslation()); - - const Vector3 forward = Vector3::CreateAxisY(); - const Vector3 lightDirection = world.TransformVector(forward); - m_featureProcessor->SetDirection(m_lightHandle, lightDirection); - } - - void SpotLightComponentController::ConfigurationChanged() - { - m_photometricValue = PhotometricValue(m_configuration.m_intensity, m_configuration.m_color, m_configuration.m_intensityMode); - m_photometricValue.SetEffectiveSolidAngle(PhotometricValue::DirectionalEffectiveSteradians); - - AZ::Transform worldTM; - AZ::TransformBus::EventResult(worldTM, m_entityId, &AZ::TransformBus::Events::GetWorldTM); - OnTransformChanged({}, worldTM); - - ColorIntensityChanged(); - AttenuationRadiusChanged(); - ConeAnglesChanged(); - PenumbraBiasChanged(); - SetBulbRadius(m_configuration.m_bulbRadius); - SetEnableShadow(m_configuration.m_enabledShadow); - SetShadowmapSize(m_configuration.m_shadowmapSize); - SetShadowFilterMethod(m_configuration.m_shadowFilterMethod); - SetSofteningBoundaryWidthAngle(m_configuration.m_boundaryWidthInDegrees); - SetPredictionSampleCount(m_configuration.m_predictionSampleCount); - SetFilteringSampleCount(m_configuration.m_filteringSampleCount); - SetPcfMethod(m_configuration.m_pcfMethod); - } - - void SpotLightComponentController::ColorIntensityChanged() - { - SpotLightNotificationBus::Event(m_entityId, &SpotLightNotifications::OnIntensityChanged, m_configuration.m_intensity); - SpotLightNotificationBus::Event(m_entityId, &SpotLightNotifications::OnColorChanged, m_configuration.m_color); - - m_photometricValue.SetChroma(m_configuration.m_color); - m_photometricValue.SetIntensity(m_configuration.m_intensity); - m_featureProcessor->SetRgbIntensity(m_lightHandle, m_photometricValue.GetCombinedRgb()); - } - - void SpotLightComponentController::ConeAnglesChanged() - { - if (m_configuration.m_innerConeDegrees > m_configuration.m_outerConeDegrees) - { - m_configuration.m_innerConeDegrees = m_configuration.m_outerConeDegrees; - } - - SpotLightNotificationBus::Event(m_entityId, &SpotLightNotifications::OnConeAnglesChanged, m_configuration.m_innerConeDegrees, m_configuration.m_outerConeDegrees); - m_featureProcessor->SetConeAngles(m_lightHandle, m_configuration.m_innerConeDegrees, m_configuration.m_outerConeDegrees); - } - - void SpotLightComponentController::AttenuationRadiusChanged() - { - if (m_configuration.m_attenuationRadiusMode == LightAttenuationRadiusMode::Automatic) - { - AutoCalculateAttenuationRadius(); - } - - SpotLightNotificationBus::Event(m_entityId, &SpotLightNotifications::OnAttenuationRadiusChanged, m_configuration.m_attenuationRadius); - m_featureProcessor->SetAttenuationRadius(m_lightHandle, m_configuration.m_attenuationRadius); - } - - void SpotLightComponentController::PenumbraBiasChanged() - { - SpotLightNotificationBus::Event(m_entityId, &SpotLightNotifications::OnPenumbraBiasChanged, m_configuration.m_penumbraBias); - m_featureProcessor->SetPenumbraBias(m_lightHandle, m_configuration.m_penumbraBias); - } - - void SpotLightComponentController::AutoCalculateAttenuationRadius() - { - // Get combined intensity luma from m_photometricValue, then calculate the radius at which the irradiance will be equal to cutoffIntensity. - static const float CutoffIntensity = 0.1f; // Make this configurable later. - - float intensity = m_photometricValue.GetCombinedIntensity(PhotometricUnit::Lumen); - m_configuration.m_attenuationRadius = sqrt(intensity / CutoffIntensity); - } - - const Color& SpotLightComponentController::GetColor() const - { - return m_configuration.m_color; - } - - void SpotLightComponentController::SetColor(const Color& color) - { - m_configuration.m_color = color; - ColorIntensityChanged(); - } - - float SpotLightComponentController::GetIntensity() const - { - return m_configuration.m_intensity; - } - - void SpotLightComponentController::SetIntensity(float intensity) - { - m_configuration.m_intensity = intensity; - ColorIntensityChanged(); - } - - float SpotLightComponentController::GetBulbRadius() const - { - return m_configuration.m_bulbRadius; - } - - void SpotLightComponentController::SetBulbRadius(float bulbRadius) - { - m_configuration.m_bulbRadius = bulbRadius; - m_featureProcessor->SetBulbRadius(m_lightHandle, bulbRadius); - } - - float SpotLightComponentController::GetInnerConeAngleInDegrees() const - { - return m_configuration.m_innerConeDegrees; - } - - void SpotLightComponentController::SetInnerConeAngleInDegrees(float degrees) - { - m_configuration.m_innerConeDegrees = degrees; - ConeAnglesChanged(); - } - - float SpotLightComponentController::GetOuterConeAngleInDegrees() const - { - return m_configuration.m_outerConeDegrees; - } - - void SpotLightComponentController::SetOuterConeAngleInDegrees(float degrees) - { - m_configuration.m_outerConeDegrees = degrees; - ConeAnglesChanged(); - } - - float SpotLightComponentController::GetPenumbraBias() const - { - return m_configuration.m_penumbraBias; - } - - void SpotLightComponentController::SetPenumbraBias(float penumbraBias) - { - m_configuration.m_penumbraBias = penumbraBias; - PenumbraBiasChanged(); - } - - float SpotLightComponentController::GetAttenuationRadius() const - { - return m_configuration.m_attenuationRadius; - } - - void SpotLightComponentController::SetAttenuationRadius(float radius) - { - m_configuration.m_attenuationRadius = radius; - AttenuationRadiusChanged(); - } - - LightAttenuationRadiusMode SpotLightComponentController::GetAttenuationRadiusMode() const - { - return m_configuration.m_attenuationRadiusMode; - } - - void SpotLightComponentController::SetAttenuationRadiusMode(LightAttenuationRadiusMode attenuationRadiusMode) - { - m_configuration.m_attenuationRadiusMode = attenuationRadiusMode; - if (attenuationRadiusMode == LightAttenuationRadiusMode::Automatic) - { - AutoCalculateAttenuationRadius(); - } - } - - bool SpotLightComponentController::GetEnableShadow() const - { - return m_configuration.m_enabledShadow; - } - - void SpotLightComponentController::SetEnableShadow(bool enabled) - { - m_configuration.m_enabledShadow = enabled; - - m_featureProcessor->SetShadowmapSize( - m_lightHandle, - m_configuration.m_enabledShadow ? - m_configuration.m_shadowmapSize : - ShadowmapSize::None); - } - - ShadowmapSize SpotLightComponentController::GetShadowmapSize() const - { - return m_configuration.m_shadowmapSize; - } - - void SpotLightComponentController::SetShadowmapSize(ShadowmapSize size) - { - // The minimum valid ShadowmapSize is 256 and maximum one is 2048. - const uint32_t sizeInt = aznumeric_cast(size); - if (sizeInt < aznumeric_cast(ShadowmapSize::Size512)) - { - size = ShadowmapSize::Size256; - } - else if (sizeInt < aznumeric_cast(ShadowmapSize::Size1024)) - { - size = ShadowmapSize::Size512; - } - else if (sizeInt < aznumeric_cast(ShadowmapSize::Size2048)) - { - size = ShadowmapSize::Size1024; - } - else - { - size = ShadowmapSize::Size2048; - } - - m_configuration.m_shadowmapSize = size; - m_featureProcessor->SetShadowmapSize( - m_lightHandle, - m_configuration.m_enabledShadow ? - m_configuration.m_shadowmapSize : - ShadowmapSize::None); - } - - ShadowFilterMethod SpotLightComponentController::GetShadowFilterMethod() const - { - return m_configuration.m_shadowFilterMethod; - } - - void SpotLightComponentController::SetShadowFilterMethod(ShadowFilterMethod method) - { - m_configuration.m_shadowFilterMethod = method; - - m_featureProcessor->SetShadowFilterMethod(m_lightHandle, method); - } - - float SpotLightComponentController::GetSofteningBoundaryWidthAngle() const - { - return m_configuration.m_boundaryWidthInDegrees; - } - - void SpotLightComponentController::SetSofteningBoundaryWidthAngle(float width) - { - m_configuration.m_boundaryWidthInDegrees = width; - - m_featureProcessor->SetShadowBoundaryWidthAngle(m_lightHandle, width); - } - - uint32_t SpotLightComponentController::GetPredictionSampleCount() const - { - return m_configuration.m_predictionSampleCount; - } - - void SpotLightComponentController::SetPredictionSampleCount(uint32_t count) - { - m_configuration.m_predictionSampleCount = count; - - m_featureProcessor->SetPredictionSampleCount(m_lightHandle, count); - } - - uint32_t SpotLightComponentController::GetFilteringSampleCount() const - { - return m_configuration.m_filteringSampleCount; - } - - void SpotLightComponentController::SetFilteringSampleCount(uint32_t count) - { - m_configuration.m_filteringSampleCount = count; - - m_featureProcessor->SetFilteringSampleCount(m_lightHandle, count); - } - - PcfMethod SpotLightComponentController::GetPcfMethod() const - { - return m_configuration.m_pcfMethod; - } - - void SpotLightComponentController::SetPcfMethod(PcfMethod method) - { - m_configuration.m_pcfMethod = method; - m_featureProcessor->SetPcfMethod(m_lightHandle, method); - } - - - } // namespace Render -} // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponentController.h deleted file mode 100644 index 8cb124cddf..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SpotLightComponentController.h +++ /dev/null @@ -1,102 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include -#include - -#include -#include -#include - -namespace AZ -{ - namespace Render - { - class SpotLightComponentController final - : public TransformNotificationBus::Handler - , public SpotLightRequestBus::Handler - { - public: - friend class EditorSpotLightComponent; - - AZ_TYPE_INFO(AZ::Render::SpotLightComponentController, "{2B37DC8C-BE9E-481C-A53B-FCBFFAB425E0}"); - static void Reflect(AZ::ReflectContext* context); - static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); - static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); - - SpotLightComponentController() = default; - SpotLightComponentController(const SpotLightComponentConfig& config); - - void Activate(EntityId entityId); - void Deactivate(); - void SetConfiguration(const SpotLightComponentConfig& config); - const SpotLightComponentConfig& GetConfiguration() const; - - private: - - AZ_DISABLE_COPY(SpotLightComponentController); - - // TransformNotificationBus::Handler overrides ... - void OnTransformChanged(const AZ::Transform& local, const AZ::Transform& world) override; - - // SpotLightRequestBus::Handler overrides ... - const Color& GetColor() const override; - void SetColor(const Color& color) override; - float GetIntensity() const override; - void SetIntensity(float intensity) override; - float GetBulbRadius() const override; - void SetBulbRadius(float bulbRadius) override; - float GetInnerConeAngleInDegrees() const override; - void SetInnerConeAngleInDegrees(float degrees) override; - float GetOuterConeAngleInDegrees() const override; - void SetOuterConeAngleInDegrees(float degrees) override; - float GetPenumbraBias() const override; - void SetPenumbraBias(float penumbraBias) override; - float GetAttenuationRadius() const override; - void SetAttenuationRadius(float radius) override; - LightAttenuationRadiusMode GetAttenuationRadiusMode() const override; - void SetAttenuationRadiusMode(LightAttenuationRadiusMode attenuationRadiusMode) override; - bool GetEnableShadow() const override; - void SetEnableShadow(bool enabled) override; - ShadowmapSize GetShadowmapSize() const override; - void SetShadowmapSize(ShadowmapSize size) override; - ShadowFilterMethod GetShadowFilterMethod() const override; - void SetShadowFilterMethod(ShadowFilterMethod method) override; - float GetSofteningBoundaryWidthAngle() const override; - void SetSofteningBoundaryWidthAngle(float width) override; - uint32_t GetPredictionSampleCount() const override; - void SetPredictionSampleCount(uint32_t count) override; - uint32_t GetFilteringSampleCount() const override; - void SetFilteringSampleCount(uint32_t count) override; - PcfMethod GetPcfMethod() const override; - void SetPcfMethod(PcfMethod method) override; - - void ConfigurationChanged(); - void ColorIntensityChanged(); - void ConeAnglesChanged(); - void AttenuationRadiusChanged(); - void PenumbraBiasChanged(); - - void AutoCalculateAttenuationRadius(); - - SpotLightComponentConfig m_configuration; - PhotometricValue m_photometricValue; - SpotLightFeatureProcessorInterface* m_featureProcessor = nullptr; - SpotLightFeatureProcessorInterface::LightHandle m_lightHandle; - EntityId m_entityId; - }; - - } // namespace Render -} // AZ namespace diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentExporter.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentExporter.cpp index 65a09db94c..b8d1b1df28 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentExporter.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentExporter.cpp @@ -175,19 +175,19 @@ namespace AZ tableWidget->setCellWidget(row, OverwriteFileColumn, overwriteCheckBoxContainer); // Whenever the selection is updated, automatically apply the change to the export item - QObject::connect(materialSlotCheckBox, &QCheckBox::stateChanged, materialSlotCheckBox, [&]([[maybe_unused]] int state) { + QObject::connect(materialSlotCheckBox, &QCheckBox::stateChanged, materialSlotCheckBox, [&exportItem, materialFileWidget, materialSlotCheckBox, overwriteCheckBox]([[maybe_unused]] int state) { exportItem.m_enabled = materialSlotCheckBox->isChecked(); materialFileWidget->setEnabled(exportItem.m_enabled); overwriteCheckBox->setEnabled(exportItem.m_enabled && exportItem.m_exists); }); // Whenever the overwrite check box is updated, automatically apply the change to the export item - QObject::connect(overwriteCheckBox, &QCheckBox::stateChanged, overwriteCheckBox, [&]([[maybe_unused]] int state) { + QObject::connect(overwriteCheckBox, &QCheckBox::stateChanged, overwriteCheckBox, [&exportItem, overwriteCheckBox]([[maybe_unused]] int state) { exportItem.m_overwrite = overwriteCheckBox->isChecked(); }); // Whenever the browse button is clicked, open a save file dialog in the same location as the current export file setting - QObject::connect(materialFileWidget, &AzQtComponents::BrowseEdit::attachedButtonTriggered, materialFileWidget, [&]() { + QObject::connect(materialFileWidget, &AzQtComponents::BrowseEdit::attachedButtonTriggered, materialFileWidget, [&dialog, &exportItem, materialFileWidget, overwriteCheckBox]() { QFileInfo fileInfo = QFileDialog::getSaveFileName(&dialog, QString("Select Material Filename"), exportItem.m_exportPath.c_str(), @@ -201,7 +201,7 @@ namespace AZ exportItem.m_exportPath = fileInfo.absoluteFilePath().toUtf8().constData(); exportItem.m_exists = fileInfo.exists(); exportItem.m_overwrite = fileInfo.exists(); -\ + // Update the controls to display the new state materialFileWidget->setText(fileInfo.fileName()); overwriteCheckBox->setChecked(exportItem.m_overwrite); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Module.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Module.cpp index 4b125ca8e0..b33dd7f165 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Module.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Module.cpp @@ -17,8 +17,6 @@ #include #include #include -#include -#include #include #include #include @@ -47,8 +45,6 @@ #include #include #include -#include -#include #include #include #include @@ -106,10 +102,8 @@ namespace AZ MaterialComponent::CreateDescriptor(), MeshComponent::CreateDescriptor(), PhysicalSkyComponent::CreateDescriptor(), - PointLightComponent::CreateDescriptor(), PostFxLayerComponent::CreateDescriptor(), ReflectionProbeComponent::CreateDescriptor(), - SpotLightComponent::CreateDescriptor(), RadiusWeightModifierComponent::CreateDescriptor(), ShapeWeightModifierComponent::CreateDescriptor(), EntityReferenceComponent::CreateDescriptor(), @@ -138,10 +132,8 @@ namespace AZ EditorMeshSystemComponent::CreateDescriptor(), EditorMeshComponent::CreateDescriptor(), EditorPhysicalSkyComponent::CreateDescriptor(), - EditorPointLightComponent::CreateDescriptor(), EditorPostFxLayerComponent::CreateDescriptor(), EditorReflectionProbeComponent::CreateDescriptor(), - EditorSpotLightComponent::CreateDescriptor(), EditorRadiusWeightModifierComponent::CreateDescriptor(), EditorShapeWeightModifierComponent::CreateDescriptor(), EditorEntityReferenceComponent::CreateDescriptor(), diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_editor_files.cmake b/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_editor_files.cmake index 5db34a764b..f77b175cd7 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_editor_files.cmake +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_editor_files.cmake @@ -19,10 +19,6 @@ set(FILES Source/CoreLights/EditorAreaLightComponent.cpp Source/CoreLights/EditorDirectionalLightComponent.h Source/CoreLights/EditorDirectionalLightComponent.cpp - Source/CoreLights/EditorPointLightComponent.h - Source/CoreLights/EditorPointLightComponent.cpp - Source/CoreLights/EditorSpotLightComponent.h - Source/CoreLights/EditorSpotLightComponent.cpp Source/Decals/EditorDecalComponent.h Source/Decals/EditorDecalComponent.cpp Source/DiffuseProbeGrid/EditorDiffuseProbeGridComponent.h diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_files.cmake b/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_files.cmake index 28d56ba5e5..b26ebc60a6 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_files.cmake +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_files.cmake @@ -27,21 +27,16 @@ set(FILES Source/CoreLights/LightDelegateBase.h Source/CoreLights/LightDelegateBase.inl Source/CoreLights/LightDelegateInterface.h - Source/CoreLights/PointLightComponent.h - Source/CoreLights/PointLightComponent.cpp - Source/CoreLights/PointLightComponentController.h - Source/CoreLights/PointLightComponentController.cpp Source/CoreLights/PolygonLightDelegate.h Source/CoreLights/PolygonLightDelegate.cpp Source/CoreLights/QuadLightDelegate.h Source/CoreLights/QuadLightDelegate.cpp + Source/CoreLights/SimplePointLightDelegate.h + Source/CoreLights/SimplePointLightDelegate.cpp + Source/CoreLights/SimpleSpotLightDelegate.h + Source/CoreLights/SimpleSpotLightDelegate.cpp Source/CoreLights/SphereLightDelegate.h Source/CoreLights/SphereLightDelegate.cpp - Source/CoreLights/SpotLightComponent.h - Source/CoreLights/SpotLightComponent.cpp - Source/CoreLights/SpotLightComponentConfig.cpp - Source/CoreLights/SpotLightComponentController.h - Source/CoreLights/SpotLightComponentController.cpp Source/Decals/DecalComponent.h Source/Decals/DecalComponent.cpp Source/Decals/DecalComponentController.h diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_public_files.cmake b/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_public_files.cmake index 06724fd506..7b8d0a6e21 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_public_files.cmake +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_public_files.cmake @@ -15,10 +15,6 @@ set(FILES Include/AtomLyIntegration/CommonFeatures/CoreLights/CoreLightsConstants.h Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightBus.h Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h - Include/AtomLyIntegration/CommonFeatures/CoreLights/PointLightBus.h - Include/AtomLyIntegration/CommonFeatures/CoreLights/PointLightComponentConfig.h - Include/AtomLyIntegration/CommonFeatures/CoreLights/SpotLightBus.h - Include/AtomLyIntegration/CommonFeatures/CoreLights/SpotLightComponentConfig.h Include/AtomLyIntegration/CommonFeatures/Decals/DecalBus.h Include/AtomLyIntegration/CommonFeatures/Decals/DecalComponentConfig.h Include/AtomLyIntegration/CommonFeatures/Decals/DecalConstants.h diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/CMakeLists.txt b/Gems/AtomLyIntegration/EMotionFXAtom/Code/CMakeLists.txt index d2a1e5abf0..dc969d61d3 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/CMakeLists.txt @@ -17,8 +17,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE AZ::AzCore @@ -40,8 +38,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE AZ::AzCore @@ -58,8 +54,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE AZ::AzCore diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp index 9d1e4443dd..14a685a065 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp @@ -211,41 +211,44 @@ namespace AZ const uint32_t* sourceOriginalVertex = static_cast(mesh->FindOriginalVertexData(EMotionFX::Mesh::ATTRIB_ORGVTXNUMBERS)); const uint32_t vertexCount = subMesh->GetNumVertices(); const uint32_t vertexStart = subMesh->GetStartVertex(); - for (uint32_t vertexIndex = 0; vertexIndex < vertexCount; ++vertexIndex) + if (sourceSkinningInfo) { - const uint32_t originalVertex = sourceOriginalVertex[vertexIndex + vertexStart]; - const uint32_t influenceCount = AZStd::GetMin(MaxSupportedSkinInfluences, sourceSkinningInfo->GetNumInfluences(originalVertex)); - uint32_t influenceIndex = 0; - float weightError = 1.0f; - - AZStd::vector localIndices; - for (; influenceIndex < influenceCount; ++influenceIndex) + for (uint32_t vertexIndex = 0; vertexIndex < vertexCount; ++vertexIndex) { - EMotionFX::SkinInfluence* influence = sourceSkinningInfo->GetInfluence(originalVertex, influenceIndex); - localIndices.push_back(static_cast(influence->GetNodeNr())); - blendWeightBufferData[atomVertexBufferOffset + vertexIndex][influenceIndex] = influence->GetWeight(); - weightError -= blendWeightBufferData[atomVertexBufferOffset + vertexIndex][influenceIndex]; - } + const uint32_t originalVertex = sourceOriginalVertex[vertexIndex + vertexStart]; + const uint32_t influenceCount = AZStd::GetMin(MaxSupportedSkinInfluences, sourceSkinningInfo->GetNumInfluences(originalVertex)); + uint32_t influenceIndex = 0; + float weightError = 1.0f; - // Zero out any unused ids/weights - for (; influenceIndex < MaxSupportedSkinInfluences; ++influenceIndex) - { - localIndices.push_back(0); - blendWeightBufferData[atomVertexBufferOffset + vertexIndex][influenceIndex] = 0.0f; - } + AZStd::vector localIndices; + for (; influenceIndex < influenceCount; ++influenceIndex) + { + EMotionFX::SkinInfluence* influence = sourceSkinningInfo->GetInfluence(originalVertex, influenceIndex); + localIndices.push_back(static_cast(influence->GetNodeNr())); + blendWeightBufferData[atomVertexBufferOffset + vertexIndex][influenceIndex] = influence->GetWeight(); + weightError -= blendWeightBufferData[atomVertexBufferOffset + vertexIndex][influenceIndex]; + } - // Now that we have the 16-bit indices, pack them into 32-bit uints - for (size_t i = 0; i < localIndices.size(); ++i) - { - if (i % 2 == 0) + // Zero out any unused ids/weights + for (; influenceIndex < MaxSupportedSkinInfluences; ++influenceIndex) { - // Put the first/even ids in the most significant bits - blendIndexBufferData[atomVertexBufferOffset + vertexIndex][i/2] = localIndices[i] << 16; + localIndices.push_back(0); + blendWeightBufferData[atomVertexBufferOffset + vertexIndex][influenceIndex] = 0.0f; } - else + + // Now that we have the 16-bit indices, pack them into 32-bit uints + for (size_t i = 0; i < localIndices.size(); ++i) { - // Put the next/odd ids in the least significant bits - blendIndexBufferData[atomVertexBufferOffset + vertexIndex][i / 2] |= localIndices[i]; + if (i % 2 == 0) + { + // Put the first/even ids in the most significant bits + blendIndexBufferData[atomVertexBufferOffset + vertexIndex][i / 2] = localIndices[i] << 16; + } + else + { + // Put the next/odd ids in the least significant bits + blendIndexBufferData[atomVertexBufferOffset + vertexIndex][i / 2] |= localIndices[i]; + } } } } @@ -268,7 +271,9 @@ namespace AZ // Static triangles are the ones that all its vertices won't move during simulation and // therefore its weights won't be altered so they are controlled by GPU. // This additional simplification has been disabled in ClothComponentMesh.cpp for now. - if (hasClothData) + + // If there is no skinning info, default to 0 weights and display an error + if (hasClothData || !sourceSkinningInfo) { for (uint32_t vertexIndex = 0; vertexIndex < vertexCount; ++vertexIndex) { @@ -471,41 +476,44 @@ namespace AZ } // for all submeshes } // for all meshes - // Now that the data has been prepped, create the actual buffers + // Now that the data has been prepped, set the actual buffers + skinnedMeshLod.SetModelLodAsset(modelLodAsset); - // Create read-only buffers and views for input buffers that are shared across all instances + // Set read-only buffers and views for input buffers that are shared across all instances AZStd::string lodString = AZStd::string::format("_Lod%zu", lodIndex); skinnedMeshLod.SetSkinningInputBufferAsset(mesh0.GetSemanticBufferAssetView(Name{ "POSITION" })->GetBufferAsset(), SkinnedMeshInputVertexStreams::Position); skinnedMeshLod.SetSkinningInputBufferAsset(mesh0.GetSemanticBufferAssetView(Name{ "NORMAL" })->GetBufferAsset(), SkinnedMeshInputVertexStreams::Normal); skinnedMeshLod.SetSkinningInputBufferAsset(mesh0.GetSemanticBufferAssetView(Name{ "TANGENT" })->GetBufferAsset(), SkinnedMeshInputVertexStreams::Tangent); skinnedMeshLod.SetSkinningInputBufferAsset(mesh0.GetSemanticBufferAssetView(Name{ "BITANGENT" })->GetBufferAsset(), SkinnedMeshInputVertexStreams::BiTangent); - - Data::Asset jointIndicesBufferAsset = mesh0.GetSemanticBufferAssetView(Name{ "SKIN_JOINTINDICES" })->GetBufferAsset(); - skinnedMeshLod.SetSkinningInputBufferAsset(jointIndicesBufferAsset, SkinnedMeshInputVertexStreams::BlendIndices); - Data::Asset skinWeightsBufferAsset = mesh0.GetSemanticBufferAssetView(Name{ "SKIN_WEIGHTS" })->GetBufferAsset(); - skinnedMeshLod.SetSkinningInputBufferAsset(skinWeightsBufferAsset, SkinnedMeshInputVertexStreams::BlendWeights); - - // We're using the indices/weights buffers directly from the model. - // However, EMFX has done some re-mapping of the id's, so we need to update the GPU buffer for it to have the correct data. - size_t remappedJointIndexBufferSizeInBytes = blendIndexBufferData.size() * sizeof(blendIndexBufferData[0]); - size_t remappedSkinWeightsBufferSizeInBytes = blendWeightBufferData.size() * sizeof(blendWeightBufferData[0]); - - AZ_Assert(jointIndicesBufferAsset->GetBufferDescriptor().m_byteCount == remappedJointIndexBufferSizeInBytes, "Joint indices data from EMotionFX is not the same size as the buffer from the model in '%s', lod '%d'", fullFileName.c_str(), lodIndex); - AZ_Assert(skinWeightsBufferAsset->GetBufferDescriptor().m_byteCount == remappedSkinWeightsBufferSizeInBytes, "Skin weights data from EMotionFX is not the same size as the buffer from the model in '%s', lod '%d'", fullFileName.c_str(), lodIndex); - - Data::Instance jointIndicesBuffer = RPI::Buffer::FindOrCreate(jointIndicesBufferAsset); - jointIndicesBuffer->UpdateData(blendIndexBufferData.data(), remappedJointIndexBufferSizeInBytes); - Data::Instance skinWeightsBuffer = RPI::Buffer::FindOrCreate(skinWeightsBufferAsset); - skinWeightsBuffer->UpdateData(blendWeightBufferData.data(), remappedSkinWeightsBufferSizeInBytes); - - // Create read-only input assembly buffers that are not modified during skinning and shared across all instances - skinnedMeshLod.SetIndexBuffer(mesh0.GetIndexBufferAssetView().GetBufferAsset()); - skinnedMeshLod.CreateStaticBuffer(uvBufferData.data(), SkinnedMeshStaticVertexStreams::UV_0, fullFileName + lodString + "_SkinnedMeshStaticUVs"); + if (!mesh0.GetSemanticBufferAssetView(Name{ "SKIN_JOINTINDICES" }) || !mesh0.GetSemanticBufferAssetView(Name{ "SKIN_WEIGHTS" })) + { + AZ_Error("ProcessSkinInfluences", false, "Actor '%s' lod '%zu' has no skin influences, and will be stuck in bind pose.", fullFileName.c_str(), lodIndex); + } + else + { + Data::Asset jointIndicesBufferAsset = mesh0.GetSemanticBufferAssetView(Name{ "SKIN_JOINTINDICES" })->GetBufferAsset(); + skinnedMeshLod.SetSkinningInputBufferAsset(jointIndicesBufferAsset, SkinnedMeshInputVertexStreams::BlendIndices); + Data::Asset skinWeightsBufferAsset = mesh0.GetSemanticBufferAssetView(Name{ "SKIN_WEIGHTS" })->GetBufferAsset(); + skinnedMeshLod.SetSkinningInputBufferAsset(skinWeightsBufferAsset, SkinnedMeshInputVertexStreams::BlendWeights); + + // We're using the indices/weights buffers directly from the model. + // However, EMFX has done some re-mapping of the id's, so we need to update the GPU buffer for it to have the correct data. + size_t remappedJointIndexBufferSizeInBytes = blendIndexBufferData.size() * sizeof(blendIndexBufferData[0]); + size_t remappedSkinWeightsBufferSizeInBytes = blendWeightBufferData.size() * sizeof(blendWeightBufferData[0]); + + AZ_Assert(jointIndicesBufferAsset->GetBufferDescriptor().m_byteCount == remappedJointIndexBufferSizeInBytes, "Joint indices data from EMotionFX is not the same size as the buffer from the model in '%s', lod '%d'", fullFileName.c_str(), lodIndex); + AZ_Assert(skinWeightsBufferAsset->GetBufferDescriptor().m_byteCount == remappedSkinWeightsBufferSizeInBytes, "Skin weights data from EMotionFX is not the same size as the buffer from the model in '%s', lod '%d'", fullFileName.c_str(), lodIndex); + + Data::Instance jointIndicesBuffer = RPI::Buffer::FindOrCreate(jointIndicesBufferAsset); + jointIndicesBuffer->UpdateData(blendIndexBufferData.data(), remappedJointIndexBufferSizeInBytes); + Data::Instance skinWeightsBuffer = RPI::Buffer::FindOrCreate(skinWeightsBufferAsset); + skinWeightsBuffer->UpdateData(blendWeightBufferData.data(), remappedSkinWeightsBufferSizeInBytes); + } - // Set the data that needs to be tracked on a per-sub-mesh basis - // and create the common, shared sub-mesh buffer views - skinnedMeshLod.SetSubMeshProperties(subMeshes); + // Create read-only input assembly buffers that are not modified during skinning and shared across all instances + skinnedMeshLod.SetIndexBufferAsset(mesh0.GetIndexBufferAssetView().GetBufferAsset()); + skinnedMeshLod.SetStaticBufferAsset(mesh0.GetSemanticBufferAssetView(Name{ "UV" })->GetBufferAsset(), SkinnedMeshStaticVertexStreams::UV_0); const RPI::BufferAssetView* morphBufferAssetView = mesh0.GetSemanticBufferAssetView(Name{ "MORPHTARGET_VERTEXDELTAS" }); if (morphBufferAssetView) @@ -513,6 +521,28 @@ namespace AZ ProcessMorphsForLod(actor, morphBufferAssetView->GetBufferAsset(), lodIndex, fullFileName, skinnedMeshLod); } + // Set colors after morphs are set, so that we know whether or not they are dynamic (if they exist) + const RPI::BufferAssetView* colorView = mesh0.GetSemanticBufferAssetView(Name{ "COLOR" }); + if (colorView) + { + if (skinnedMeshLod.HasDynamicColors()) + { + // If colors are being morphed, + // add them as input to the skinning compute shader, which will apply the morph + skinnedMeshLod.SetSkinningInputBufferAsset(colorView->GetBufferAsset(), SkinnedMeshInputVertexStreams::Color); + } + else + { + // If colors exist but are not modified dynamically, + // add them to the static streams that are shared by all instances of the same skinned mesh + skinnedMeshLod.SetStaticBufferAsset(colorView->GetBufferAsset(), SkinnedMeshStaticVertexStreams::Color); + } + } + + // Set the data that needs to be tracked on a per-sub-mesh basis + // and create the common, shared sub-mesh buffer views + skinnedMeshLod.SetSubMeshProperties(subMeshes); + skinnedMeshInputBuffers->SetLod(lodIndex, skinnedMeshLod); } // for all lods diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp index 95272772d8..0a17a6444d 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp @@ -173,7 +173,12 @@ namespace AZ MaterialAssignmentMap AtomActorInstance::GetMaterialAssignments() const { - return GetMaterialAssignmentsFromModel(m_skinnedMeshInstance->m_model); + if (m_skinnedMeshInstance && m_skinnedMeshInstance->m_model) + { + return GetMaterialAssignmentsFromModel(m_skinnedMeshInstance->m_model); + } + + return MaterialAssignmentMap{}; } AZStd::unordered_set AtomActorInstance::GetModelUvNames() const diff --git a/Gems/AtomLyIntegration/ImguiAtom/Code/CMakeLists.txt b/Gems/AtomLyIntegration/ImguiAtom/Code/CMakeLists.txt index 14a64f1133..d9f9aac569 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/ImguiAtom/Code/CMakeLists.txt @@ -17,8 +17,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PUBLIC AZ::AtomCore @@ -35,8 +33,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE AZ::AzFramework diff --git a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.cpp b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.cpp index 4e137f5854..49ed813ed8 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.cpp +++ b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.cpp @@ -12,6 +12,8 @@ #include +#if defined(IMGUI_ENABLED) + #include #include #include @@ -322,8 +324,8 @@ namespace AZ // Draw the debug console in a closeable, moveable, and resizeable IMGUI window. bool continueShowing = true; - ImGui::SetNextWindowSize(ImVec2(640, 480), ImGuiCond_FirstUseEver); - if (!ImGui::Begin("Debug Console", &continueShowing)) + ImGui::SetNextWindowSize(ImVec2(640, 480), ImGuiCond_Once); + if (!ImGui::Begin("Debug Console", &continueShowing, ImGuiWindowFlags_NoCollapse)) { ImGui::End(); return false; @@ -367,6 +369,10 @@ namespace AZ } // Focus on the text input field. + if (ImGui::IsWindowAppearing()) + { + ImGui::SetKeyboardFocusHere(-1); + } ImGui::SetItemDefaultFocus(); // Show a button to clear the debug log. @@ -437,3 +443,5 @@ namespace AZ } } } + +#endif // defined(IMGUI_ENABLED) diff --git a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.h b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.h index 4a12e00259..29b2bfc4b5 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.h +++ b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.h @@ -31,14 +31,10 @@ struct ImGuiInputTextCallbackData; //////////////////////////////////////////////////////////////////////////////////////////////////// namespace AZ { - //////////////////////////////////////////////////////////////////////////////////////////////// - //! The default maximum number of entries to display in the debug log. - constexpr int DefaultMaxEntriesToDisplay = 1028; - - //////////////////////////////////////////////////////////////////////////////////////////////// - //! The default maximum number of input history items to retain. - constexpr int DefaultMaxInputHistorySize = 512; - +#if !defined(IMGUI_ENABLED) + class DebugConsole {}; +#else +#endif // defined(IMGUI_ENABLED) //////////////////////////////////////////////////////////////////////////////////////////////// //! A debug console used to enter debug console commands and display debug log messages. //! @@ -49,6 +45,14 @@ namespace AZ class DebugConsole : public AzFramework::InputChannelEventListener , public AZ::RPI::ViewportContextNotificationBus::Handler { + //////////////////////////////////////////////////////////////////////////////////////////// + //! The default maximum number of entries to display in the debug log. + static constexpr int DefaultMaxEntriesToDisplay = 1028; + + //////////////////////////////////////////////////////////////////////////////////////////// + //! The default maximum number of input history items to retain. + static constexpr int DefaultMaxInputHistorySize = 512; + public: //////////////////////////////////////////////////////////////////////////////////////////// // Allocator diff --git a/Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.h b/Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.h index 60753883b4..e4b3dd0ca6 100644 --- a/Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.h +++ b/Gems/AudioEngineWwise/Code/Source/Engine/FileIOHandler_wwise.h @@ -20,9 +20,9 @@ namespace Audio { - //! Wwise file IO device that access the Lumberyard file system through standard blocking file IO calls. Wwise will still + //! Wwise file IO device that access the Open 3D Engine file system through standard blocking file IO calls. Wwise will still //! run these in separate threads so it won't be blocking the audio playback, but it will interfere with the internal - //! file IO scheduling of Lumberyard. This class can also write, so it's intended use is for one-off file reads and + //! file IO scheduling of Open 3D Engine. This class can also write, so it's intended use is for one-off file reads and //! for tools to be able to write files. class CBlockingDevice_wwise : public AK::StreamMgr::IAkIOHookBlocking diff --git a/Gems/Blast/Code/Include/Blast/BlastMaterial.h b/Gems/Blast/Code/Include/Blast/BlastMaterial.h index f2d48cc5b5..0f713c774e 100644 --- a/Gems/Blast/Code/Include/Blast/BlastMaterial.h +++ b/Gems/Blast/Code/Include/Blast/BlastMaterial.h @@ -133,7 +133,7 @@ namespace Blast BlastMaterialId m_id; }; - //! An asset that holds a list of materials to be edited and assigned in Lumberyard Editor + //! An asset that holds a list of materials to be edited and assigned in Open 3D Engine Editor //! Use Asset Editor to create a BlastMaterialLibraryAsset and add materials to it. //! Please note, BlastMaterialLibraryAsset is used only to provide a way to edit materials in the //! Editor, if you need to create materials at runtime (for example, from custom configuration files) diff --git a/Gems/CrashReporting/Code/Include/CrashReporting/GameCrashUploader.h b/Gems/CrashReporting/Code/Include/CrashReporting/GameCrashUploader.h index 1207f1c056..aeeb9b3f6f 100644 --- a/Gems/CrashReporting/Code/Include/CrashReporting/GameCrashUploader.h +++ b/Gems/CrashReporting/Code/Include/CrashReporting/GameCrashUploader.h @@ -15,7 +15,7 @@ #include -namespace Lumberyard +namespace O3de { class GameCrashUploader : public CrashUploader { diff --git a/Gems/CrashReporting/Code/Platform/Windows/GameCrashUploader_windows.cpp b/Gems/CrashReporting/Code/Platform/Windows/GameCrashUploader_windows.cpp index ef76182914..d5d7855df2 100644 --- a/Gems/CrashReporting/Code/Platform/Windows/GameCrashUploader_windows.cpp +++ b/Gems/CrashReporting/Code/Platform/Windows/GameCrashUploader_windows.cpp @@ -21,7 +21,7 @@ #pragma warning(disable : 4996) -namespace Lumberyard +namespace O3de { bool GameCrashUploader::CheckConfirmation(const crashpad::CrashReportDatabase::Report& report) diff --git a/Gems/CrashReporting/Code/Platform/Windows/main_windows.cpp b/Gems/CrashReporting/Code/Platform/Windows/main_windows.cpp index 32ac52fb3e..a04bcafec0 100644 --- a/Gems/CrashReporting/Code/Platform/Windows/main_windows.cpp +++ b/Gems/CrashReporting/Code/Platform/Windows/main_windows.cpp @@ -22,10 +22,10 @@ namespace { int HandlerMain(int argc, char* argv[]) { - Lumberyard::InstallCrashUploader(argc, argv); + O3de::InstallCrashUploader(argc, argv); LOG(ERROR) << "Initializing windows game crash uploader logging"; - int resultCode = crashpad::HandlerMain(argc, argv, Lumberyard::CrashUploader::GetCrashUploader()->GetUserStreamSources()); + int resultCode = crashpad::HandlerMain(argc, argv, O3de::CrashUploader::GetCrashUploader()->GetUserStreamSources()); return resultCode; } diff --git a/Gems/CrashReporting/Code/Source/GameCrashUploader.cpp b/Gems/CrashReporting/Code/Source/GameCrashUploader.cpp index e846c5dd4a..41968faed6 100644 --- a/Gems/CrashReporting/Code/Source/GameCrashUploader.cpp +++ b/Gems/CrashReporting/Code/Source/GameCrashUploader.cpp @@ -14,11 +14,11 @@ #include #include -namespace Lumberyard +namespace O3de { void InstallCrashUploader(int& argc, char* argv[]) { - Lumberyard::CrashUploader::SetCrashUploader(std::make_shared(argc, argv)); + O3de::CrashUploader::SetCrashUploader(std::make_shared(argc, argv)); } std::string GameCrashUploader::GetRootFolder() diff --git a/Gems/CustomAssetExample/Code/CMakeLists.txt b/Gems/CustomAssetExample/Code/CMakeLists.txt index 7bad2611ca..661b1950ce 100644 --- a/Gems/CustomAssetExample/Code/CMakeLists.txt +++ b/Gems/CustomAssetExample/Code/CMakeLists.txt @@ -17,8 +17,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE AZ::AzCore @@ -34,8 +32,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE AZ::AzCore diff --git a/Gems/EMotionFX/Code/CMakeLists.txt b/Gems/EMotionFX/Code/CMakeLists.txt index b68db062f2..d46c67fafb 100644 --- a/Gems/EMotionFX/Code/CMakeLists.txt +++ b/Gems/EMotionFX/Code/CMakeLists.txt @@ -70,11 +70,11 @@ ly_add_target( if (PAL_TRAIT_BUILD_HOST_TOOLS) find_package(OpenGL QUIET REQUIRED) - # Imported targets (like OpenGL::GL) are scoped to a directory. Add an interface library to make a target with + # Imported targets (like OpenGL::GL) are scoped to a directory. Add a # a global scope - add_library(OpenGLInterface INTERFACE) - target_link_libraries(OpenGLInterface INTERFACE OpenGL::GL) - + add_library(3rdParty::OpenGLInterface INTERFACE IMPORTED GLOBAL) + target_link_libraries(3rdParty::OpenGLInterface INTERFACE OpenGL::GL) + ly_add_target( NAME EMotionFX.Editor.Static STATIC NAMESPACE Gem @@ -112,7 +112,7 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) AZ::SceneUI AZ::AzToolsFramework Legacy::Editor.Headers - OpenGLInterface + 3rdParty::OpenGLInterface COMPILE_DEFINITIONS PUBLIC EMFX_EMSTUDIOLYEMBEDDED diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp index 948bdf6186..2b99f823ff 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Actor.cpp @@ -3031,6 +3031,9 @@ namespace EMotionFX { MorphTargetStandard* morphTarget = static_cast(morphSetup->GetMorphTarget(mtIndex)); + // Remove all previously added deform datas for the given joint as we set a new mesh. + morphTarget->RemoveAllDeformDatasFor(meshJoint); + const AZStd::vector& metaDatas = m_morphTargetMetaAsset->GetMorphTargets(); for (const auto& metaData : metaDatas) { diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp index 017f120581..b9399fb350 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/EMotionFXManager.cpp @@ -353,7 +353,7 @@ namespace EMotionFX mAssetSourceFolder = assetSourcePath; // Add an ending slash in case there is none yet. - // TODO: Remove this and adopt EMotionFX code to work with folder paths without slash at the end like Lumberyard does. + // TODO: Remove this and adopt EMotionFX code to work with folder paths without slash at the end like Open 3D Engine does. if (mAssetSourceFolder.empty() == false) { const char lastChar = AzFramework::StringFunc::LastCharacter(mAssetSourceFolder.c_str()); @@ -378,7 +378,7 @@ namespace EMotionFX mAssetCacheFolder = assetCachePath; // Add an ending slash in case there is none yet. - // TODO: Remove this and adopt EMotionFX code to work with folder paths without slash at the end like Lumberyard does. + // TODO: Remove this and adopt EMotionFX code to work with folder paths without slash at the end like Open 3D Engine does. if (mAssetCacheFolder.empty() == false) { const char lastChar = AzFramework::StringFunc::LastCharacter(mAssetCacheFolder.c_str()); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/LayoutManager.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/LayoutManager.cpp index f9d42eef6e..dd0990271d 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/LayoutManager.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/LayoutManager.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -38,7 +39,7 @@ namespace EMStudio void LayoutManager::SaveDialogAccepted() { - const AZStd::string filename = AZStd::string::format("%sLayouts/%s.layout", MysticQt::GetDataDir().c_str(), m_inputDialog->GetText().toUtf8().data()); + const auto filename = AZ::IO::Path(MysticQt::GetDataDir()) / AZStd::string::format("Layouts/%s.layout", m_inputDialog->GetText().toUtf8().data()); // If the file already exists, ask to overwrite or not. if (QFile::exists(filename.c_str())) diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp index c57dbc2d8a..5adec5e0a4 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/MainWindow.cpp @@ -50,6 +50,7 @@ // include MCore related #include #include +#include #include #include #include @@ -1808,8 +1809,7 @@ namespace EMStudio mLayoutsMenu->clear(); // generate the layouts path - QString layoutsPath = MysticQt::GetDataDir().c_str(); - layoutsPath += "Layouts/"; + QDir layoutsPath = QDir{ QString(MysticQt::GetDataDir().c_str()) }.filePath("Layouts"); // open the dir QDir dir(layoutsPath); @@ -1911,8 +1911,7 @@ namespace EMStudio SavePreferences(); // generate the filename - AZStd::string filename; - filename = AZStd::string::format("%sLayouts/%s.layout", MysticQt::GetDataDir().c_str(), FromQtString(text).c_str()); + const auto filename = AZ::IO::Path(MysticQt::GetDataDir()) / AZStd::string::format("Layouts/%s.layout", FromQtString(text).c_str()); // try to load it if (GetLayoutManager()->LoadLayout(filename.c_str()) == false) @@ -1970,7 +1969,7 @@ namespace EMStudio { // generate the filename QAction* action = qobject_cast(sender()); - m_layoutFileBeingRemoved = QString(MysticQt::GetDataDir().c_str()) + "Layouts/" + action->text() + ".layout"; + m_layoutFileBeingRemoved = QDir(MysticQt::GetDataDir().c_str()).filePath(QString("Layouts/") + action->text() + ".layout"); m_removeLayoutNameText = action->text(); // make sure we really want to remove it @@ -1998,8 +1997,7 @@ namespace EMStudio SavePreferences(); // generate the filename - AZStd::string filename; - filename = AZStd::string::format("%sLayouts/%s.layout", MysticQt::GetDataDir().c_str(), FromQtString(action->text()).c_str()); + const auto filename = AZ::IO::Path(MysticQt::GetDataDir()) / AZStd::string::format("Layouts/%s.layout", FromQtString(action->text()).c_str()); // try to load it if (GetLayoutManager()->LoadLayout(filename.c_str())) diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderPlugin.cpp index ecb2fd632e..47b88b1fa2 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/RenderPlugin/RenderPlugin.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -695,8 +696,9 @@ namespace EMStudio bool RenderPlugin::Init() { // load the cursors - mZoomInCursor = new QCursor(QPixmap(AZStd::string(MysticQt::GetDataDir() + "Images/Rendering/ZoomInCursor.png").c_str()).scaled(32, 32)); - mZoomOutCursor = new QCursor(QPixmap(AZStd::string(MysticQt::GetDataDir() + "Images/Rendering/ZoomOutCursor.png").c_str()).scaled(32, 32)); + QDir dataDir{ QString(MysticQt::GetDataDir().c_str()) }; + mZoomInCursor = new QCursor(QPixmap(dataDir.filePath("Images/Rendering/ZoomInCursor.png")).scaled(32, 32)); + mZoomOutCursor = new QCursor(QPixmap(dataDir.filePath("Images/Rendering/ZoomOutCursor.png")).scaled(32, 32)); mCurrentSelection = &GetCommandManager()->GetCurrentSelection(); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.cpp index 35edb3873d..99f203d6e7 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/RenderPlugins/Source/OpenGLRender/OpenGLRenderPlugin.cpp @@ -22,6 +22,7 @@ #include #include +#include namespace EMStudio { @@ -59,7 +60,7 @@ namespace EMStudio } // get the absolute directory path where all the shaders will be located - const AZStd::string shaderPath = MysticQt::GetDataDir() + "Shaders/"; + const auto shaderPath = AZ::IO::Path(MysticQt::GetDataDir()) / "Shaders"; // create graphics manager and initialize it mGraphicsManager = new RenderGL::GraphicsManager(); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameControllerWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameControllerWindow.cpp index 85c07a306a..3c3b5ca65d 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameControllerWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/GameControllerWindow.cpp @@ -166,8 +166,8 @@ namespace EMStudio connect(mPresetNameLineEdit, &QLineEdit::textEdited, this, &GameControllerWindow::OnPresetNameEdited); connect(mPresetNameLineEdit, &QLineEdit::returnPressed, this, &GameControllerWindow::OnPresetNameChanged); - EMStudioManager::MakeTransparentButton(mAddPresetButton, "/Images/Icons/Plus.svg", "Add a game controller preset"); - EMStudioManager::MakeTransparentButton(mRemovePresetButton, "/Images/Icons/Remove.svg", "Remove a game controller preset"); + EMStudioManager::MakeTransparentButton(mAddPresetButton, "Images/Icons/Plus.svg", "Add a game controller preset"); + EMStudioManager::MakeTransparentButton(mRemovePresetButton, "Images/Icons/Remove.svg", "Remove a game controller preset"); QHBoxLayout* buttonsLayout = new QHBoxLayout(); buttonsLayout->addWidget(mAddPresetButton); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentNodesWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentNodesWindow.cpp index 99c8eeafac..f139a6d802 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentNodesWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentNodesWindow.cpp @@ -86,9 +86,9 @@ namespace EMStudio mAddNodesButton = new QToolButton(); mRemoveNodesButton = new QToolButton(); - EMStudioManager::MakeTransparentButton(mSelectNodesButton, "/Images/Icons/Plus.svg", "Select nodes and replace the current selection"); - EMStudioManager::MakeTransparentButton(mAddNodesButton, "/Images/Icons/Plus.svg", "Select nodes and add them to the current selection"); - EMStudioManager::MakeTransparentButton(mRemoveNodesButton, "/Images/Icons/Minus.svg", "Remove selected nodes from the list"); + EMStudioManager::MakeTransparentButton(mSelectNodesButton, "Images/Icons/Plus.svg", "Select nodes and replace the current selection"); + EMStudioManager::MakeTransparentButton(mAddNodesButton, "Images/Icons/Plus.svg", "Select nodes and add them to the current selection"); + EMStudioManager::MakeTransparentButton(mRemoveNodesButton, "Images/Icons/Minus.svg", "Remove selected nodes from the list"); // create the buttons layout QHBoxLayout* buttonLayout = new QHBoxLayout(); @@ -403,4 +403,4 @@ namespace EMStudio } } // namespace EMStudio -#include \ No newline at end of file +#include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentsWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentsWindow.cpp index 9357a18c11..6722dc5512 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentsWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/Attachments/AttachmentsWindow.cpp @@ -130,11 +130,11 @@ namespace EMStudio mClearButton = new QToolButton(); mCancelSelectionButton = new QToolButton(); - EMStudioManager::MakeTransparentButton(mOpenAttachmentButton, "/Images/Icons/Open.svg", "Open actor from file and add it as regular attachment"); - EMStudioManager::MakeTransparentButton(mOpenDeformableAttachmentButton, "/Images/Icons/Open.svg", "Open actor from file and add it as skin attachment"); - EMStudioManager::MakeTransparentButton(mRemoveButton, "/Images/Icons/Minus.svg", "Remove selected attachments"); - EMStudioManager::MakeTransparentButton(mClearButton, "/Images/Icons/Clear.svg", "Remove all attachments"); - EMStudioManager::MakeTransparentButton(mCancelSelectionButton, "/Images/Icons/Remove.svg", "Cancel attachment selection"); + EMStudioManager::MakeTransparentButton(mOpenAttachmentButton, "Images/Icons/Open.svg", "Open actor from file and add it as regular attachment"); + EMStudioManager::MakeTransparentButton(mOpenDeformableAttachmentButton, "Images/Icons/Open.svg", "Open actor from file and add it as skin attachment"); + EMStudioManager::MakeTransparentButton(mRemoveButton, "Images/Icons/Minus.svg", "Remove selected attachments"); + EMStudioManager::MakeTransparentButton(mClearButton, "Images/Icons/Clear.svg", "Remove all attachments"); + EMStudioManager::MakeTransparentButton(mCancelSelectionButton, "Images/Icons/Remove.svg", "Cancel attachment selection"); // create the buttons layout QHBoxLayout* buttonLayout = new QHBoxLayout(); @@ -939,4 +939,4 @@ namespace EMStudio } } // namespace EMStudio -#include \ No newline at end of file +#include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/CommandBar/CommandBarPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/CommandBar/CommandBarPlugin.cpp index 71f19f6817..5dc6aa8bb5 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/CommandBar/CommandBarPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/CommandBar/CommandBarPlugin.cpp @@ -17,6 +17,7 @@ #include "../MotionWindow/MotionListWindow.h" #include #include +#include #include #include #include @@ -87,8 +88,9 @@ namespace EMStudio m_toggleLockSelectionCallback = new CommandToggleLockSelectionCallback(false); GetCommandManager()->RegisterCommandCallback("ToggleLockSelection", m_toggleLockSelectionCallback); - m_lockEnabledIcon = new QIcon(AZStd::string(MysticQt::GetDataDir() + "/Images/Icons/LockEnabled.svg").c_str()); - m_lockDisabledIcon = new QIcon(AZStd::string(MysticQt::GetDataDir() + "/Images/Icons/LockDisabled.svg").c_str()); + QDir dataDir{ QString(MysticQt::GetDataDir().c_str()) }; + m_lockEnabledIcon = new QIcon(dataDir.filePath("Images/Icons/LockEnabled.svg")); + m_lockDisabledIcon = new QIcon(dataDir.filePath("Images/Icons/LockDisabled.svg")); m_commandEdit = new QLineEdit(); m_commandEdit->setPlaceholderText("Enter command"); @@ -108,7 +110,7 @@ namespace EMStudio connect(m_globalSimSpeedSlider, &AzQtComponents::SliderDouble::valueChanged, this, &CommandBarPlugin::OnGlobalSimSpeedChanged); m_globalSimSpeedSliderAction = mBar->addWidget(m_globalSimSpeedSlider); - m_globalSimSpeedResetAction = mBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Reset.svg"), + m_globalSimSpeedResetAction = mBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Reset.svg"), tr("Reset the global simulation speed factor to its normal speed"), this, &CommandBarPlugin::ResetGlobalSimSpeed); @@ -127,7 +129,7 @@ namespace EMStudio m_progressBarAction = mBar->addWidget(m_progressBar); m_progressBarAction->setVisible(false); - m_lockSelectionAction = mBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Reset.svg"), + m_lockSelectionAction = mBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Reset.svg"), tr("Lock or unlock the selection of actor instances"), this, &CommandBarPlugin::OnLockSelectionButton); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MorphTargetsWindow/PhonemeSelectionWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MorphTargetsWindow/PhonemeSelectionWindow.cpp index 5e61c282b7..50e6069774 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MorphTargetsWindow/PhonemeSelectionWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MorphTargetsWindow/PhonemeSelectionWindow.cpp @@ -175,11 +175,11 @@ namespace EMStudio mRemovePhonemesButtonArrow = new QPushButton(""); mClearPhonemesButton = new QPushButton(""); - EMStudioManager::MakeTransparentButton(mAddPhonemesButtonArrow, "/Images/Icons/PlayForward.svg", "Assign the selected phonemes to the morph target."); - EMStudioManager::MakeTransparentButton(mRemovePhonemesButtonArrow, "/Images/Icons/PlayBackward.svg", "Unassign the selected phonemes from the morph target."); - EMStudioManager::MakeTransparentButton(mAddPhonemesButton, "/Images/Icons/Plus.svg", "Assign the selected phonemes to the morph target."); - EMStudioManager::MakeTransparentButton(mRemovePhonemesButton, "/Images/Icons/Minus.svg", "Unassign the selected phonemes from the morph target."); - EMStudioManager::MakeTransparentButton(mClearPhonemesButton, "/Images/Icons/Clear.svg", "Unassign all phonemes from the morph target."); + EMStudioManager::MakeTransparentButton(mAddPhonemesButtonArrow, "Images/Icons/PlayForward.svg", "Assign the selected phonemes to the morph target."); + EMStudioManager::MakeTransparentButton(mRemovePhonemesButtonArrow, "Images/Icons/PlayBackward.svg", "Unassign the selected phonemes from the morph target."); + EMStudioManager::MakeTransparentButton(mAddPhonemesButton, "Images/Icons/Plus.svg", "Assign the selected phonemes to the morph target."); + EMStudioManager::MakeTransparentButton(mRemovePhonemesButton, "Images/Icons/Minus.svg", "Unassign the selected phonemes from the morph target."); + EMStudioManager::MakeTransparentButton(mClearPhonemesButton, "Images/Icons/Clear.svg", "Unassign all phonemes from the morph target."); // init the visime tables mPossiblePhonemeSetsTable = new DragTableWidget(0, 1); @@ -644,4 +644,4 @@ namespace EMStudio } } // namespace EMStudio -#include \ No newline at end of file +#include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionEvents/MotionEventPresetsWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionEvents/MotionEventPresetsWidget.cpp index a628233200..82887f09ef 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionEvents/MotionEventPresetsWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionEvents/MotionEventPresetsWidget.cpp @@ -68,16 +68,16 @@ namespace EMStudio QToolBar* toolBar = new QToolBar(this); - m_addAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Plus.svg"), + m_addAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Plus.svg"), tr("Add new motion event preset"), this, &MotionEventPresetsWidget::AddMotionEventPreset); - m_loadAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Open.svg"), + m_loadAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Open.svg"), tr("Load motion event preset config file"), this, [=]() { LoadPresets(); /* use lambda so that we get the default value for the showDialog parameter */ }); m_saveMenuAction = toolBar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Save.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/Save.svg"), tr("Save motion event preset config")); { QToolButton* toolButton = qobject_cast(toolBar->widgetForAction(m_saveMenuAction)); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetManagementWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetManagementWindow.cpp index fc4700b462..4ccf5d8937 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetManagementWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetManagementWindow.cpp @@ -279,17 +279,17 @@ namespace EMStudio QToolBar* toolBar = new QToolBar(this); toolBar->setObjectName("MotionSetManagementWindow.ToolBar"); - m_addAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Plus.svg"), + m_addAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Plus.svg"), tr("Add new motion set"), this, &MotionSetManagementWindow::OnCreateMotionSet); m_addAction->setObjectName("MotionSetManagementWindow.ToolBar.AddNewMotionSet"); - m_openAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Open.svg"), + m_openAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Open.svg"), tr("Load motion set from a file"), this, &MotionSetManagementWindow::OnOpen); m_saveMenuAction = toolBar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Save.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/Save.svg"), tr("Save selected root motion set")); { QToolButton* toolButton = qobject_cast(toolBar->widgetForAction(m_saveMenuAction)); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetWindow.cpp index eb3106e324..bb943e3476 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionSetsWindow/MotionSetWindow.cpp @@ -231,16 +231,16 @@ namespace EMStudio QToolBar* toolBar = new QToolBar(this); toolBar->setObjectName("MotionSetWindow.ToolBar"); - m_addAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Plus.svg"), + m_addAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Plus.svg"), tr("Add a new entry"), this, &MotionSetWindow::OnAddNewEntry); m_addAction->setObjectName("MotionSetWindow.ToolBar.AddANewEntry"); - m_loadAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Open.svg"), + m_loadAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Open.svg"), tr("Add entries by selecting motions."), this, &MotionSetWindow::OnLoadEntries); - m_editAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Edit.svg"), + m_editAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Edit.svg"), tr("Batch edit selected motion IDs"), this, &MotionSetWindow::OnEditButton); @@ -554,7 +554,7 @@ namespace EMStudio QTableWidgetItem* exclamationTableItem = new QTableWidgetItem(""); exclamationTableItem->setFlags(Qt::NoItemFlags); - exclamationTableItem->setIcon(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/ExclamationMark.svg")); + exclamationTableItem->setIcon(MysticQt::GetMysticQt()->FindIcon("Images/Icons/ExclamationMark.svg")); exclamationTableItem->setToolTip(tooltipText.c_str()); tableWidget->setItem(rowIndex, 0, exclamationTableItem); } @@ -779,7 +779,7 @@ namespace EMStudio QTableWidgetItem* exclamationTableItem = new QTableWidgetItem(""); exclamationTableItem->setFlags(Qt::NoItemFlags); - exclamationTableItem->setIcon(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/ExclamationMark.svg")); + exclamationTableItem->setIcon(MysticQt::GetMysticQt()->FindIcon("Images/Icons/ExclamationMark.svg")); exclamationTableItem->setToolTip(tooltipText.c_str()); tableWidget->setItem(row, 0, exclamationTableItem); } diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionWindowPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionWindowPlugin.cpp index d0bdb6253b..f1136843b2 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionWindowPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/MotionWindow/MotionWindowPlugin.cpp @@ -206,8 +206,8 @@ namespace EMStudio // reinitialize the motion table entries ReInit(); - mAddMotionsAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Plus.svg"), tr("Load motions"), this, &MotionWindowPlugin::OnAddMotions); - mSaveAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Menu/FileSave.svg"), tr("Save selected motions"), this, &MotionWindowPlugin::OnSave); + mAddMotionsAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Plus.svg"), tr("Load motions"), this, &MotionWindowPlugin::OnAddMotions); + mSaveAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Menu/FileSave.svg"), tr("Save selected motions"), this, &MotionWindowPlugin::OnSave); toolBar->addSeparator(); AzQtComponents::FilteredSearchWidget* searchWidget = new AzQtComponents::FilteredSearchWidget(toolBar); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupManagementWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupManagementWidget.cpp index 008fc84ed9..dbd12544f7 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupManagementWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupManagementWidget.cpp @@ -204,9 +204,9 @@ namespace EMStudio mRemoveButton = new QPushButton(); mClearButton = new QPushButton(); - EMStudioManager::MakeTransparentButton(mAddButton, "/Images/Icons/Plus.svg", "Add a new node group"); - EMStudioManager::MakeTransparentButton(mRemoveButton, "/Images/Icons/Minus.svg", "Remove selected node groups"); - EMStudioManager::MakeTransparentButton(mClearButton, "/Images/Icons/Clear.svg", "Remove all node groups"); + EMStudioManager::MakeTransparentButton(mAddButton, "Images/Icons/Plus.svg", "Add a new node group"); + EMStudioManager::MakeTransparentButton(mRemoveButton, "Images/Icons/Minus.svg", "Remove selected node groups"); + EMStudioManager::MakeTransparentButton(mClearButton, "Images/Icons/Clear.svg", "Remove all node groups"); // add the buttons to the button layout QHBoxLayout* buttonLayout = new QHBoxLayout(); @@ -696,4 +696,4 @@ namespace EMStudio } } // namespace EMStudio -#include \ No newline at end of file +#include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupWidget.cpp index 9431a2c7dc..9d6cc4f502 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/NodeGroups/NodeGroupWidget.cpp @@ -92,9 +92,9 @@ namespace EMStudio mAddNodesButton = new QPushButton(); mRemoveNodesButton = new QPushButton(); - EMStudioManager::MakeTransparentButton(mSelectNodesButton, "/Images/Icons/Plus.svg", "Select nodes and replace the current selection"); - EMStudioManager::MakeTransparentButton(mAddNodesButton, "/Images/Icons/Plus.svg", "Select nodes and add them to the current selection"); - EMStudioManager::MakeTransparentButton(mRemoveNodesButton, "/Images/Icons/Minus.svg", "Remove selected nodes from the list"); + EMStudioManager::MakeTransparentButton(mSelectNodesButton, "Images/Icons/Plus.svg", "Select nodes and replace the current selection"); + EMStudioManager::MakeTransparentButton(mAddNodesButton, "Images/Icons/Plus.svg", "Select nodes and add them to the current selection"); + EMStudioManager::MakeTransparentButton(mRemoveNodesButton, "Images/Icons/Minus.svg", "Remove selected nodes from the list"); // create the buttons layout QHBoxLayout* buttonLayout = new QHBoxLayout(); @@ -428,4 +428,4 @@ namespace EMStudio } // namespace EMStudio -#include \ No newline at end of file +#include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/SceneManager/ActorsWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/SceneManager/ActorsWindow.cpp index a02f58868e..1e78adefd1 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/SceneManager/ActorsWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/SceneManager/ActorsWindow.cpp @@ -75,7 +75,7 @@ namespace EMStudio // Open actors { QAction* menuAction = toolBar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Open.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/Open.svg"), tr("Load actor from asset")); QToolButton* toolButton = qobject_cast(toolBar->widgetForAction(menuAction)); @@ -90,11 +90,11 @@ namespace EMStudio menuAction->setMenu(contextMenu); } - m_createInstanceAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Plus.svg"), + m_createInstanceAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Plus.svg"), tr("Create a new instance of the selected actors"), this, &ActorsWindow::OnCreateInstanceButtonClicked); - m_saveAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Save.svg"), + m_saveAction = toolBar->addAction(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Save.svg"), tr("Save selected actors"), GetMainWindow(), &MainWindow::OnFileSaveSelectedActors); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/SceneManager/MirrorSetupWindow.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/SceneManager/MirrorSetupWindow.cpp index 29ed0f32a8..6b020fd85a 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/SceneManager/MirrorSetupWindow.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/SceneManager/MirrorSetupWindow.cpp @@ -13,6 +13,7 @@ #include "MirrorSetupWindow.h" #include #include +#include #include #include #include @@ -55,11 +56,11 @@ namespace EMStudio setMinimumHeight(600); // load some icons - const AZStd::string dataDir = MysticQt::GetDataDir().c_str(); - mBoneIcon = new QIcon(AZStd::string(dataDir + "Images/Icons/Bone.svg").c_str()); - mNodeIcon = new QIcon(AZStd::string(dataDir + "Images/Icons/Node.svg").c_str()); - mMeshIcon = new QIcon(AZStd::string(dataDir + "Images/Icons/Mesh.svg").c_str()); - mMappedIcon = new QIcon(AZStd::string(dataDir + "Images/Icons/Confirm.svg").c_str()); + const QDir dataDir{ QString(MysticQt::GetDataDir().c_str()) }; + mBoneIcon = new QIcon(dataDir.filePath("Images/Icons/Bone.svg")); + mNodeIcon = new QIcon(dataDir.filePath("Images/Icons/Node.svg")); + mMeshIcon = new QIcon(dataDir.filePath("Images/Icons/Mesh.svg")); + mMappedIcon = new QIcon(dataDir.filePath("Images/Icons/Confirm.svg")); // create the main layout QVBoxLayout* mainLayout = new QVBoxLayout(); @@ -76,17 +77,17 @@ namespace EMStudio toolBarLayout->setSpacing(0); mainLayout->addLayout(toolBarLayout); mButtonOpen = new QPushButton(); - EMStudioManager::MakeTransparentButton(mButtonOpen, "/Images/Icons/Open.svg", "Load and apply a mapping template."); + EMStudioManager::MakeTransparentButton(mButtonOpen, "Images/Icons/Open.svg", "Load and apply a mapping template."); connect(mButtonOpen, &QPushButton::clicked, this, &MirrorSetupWindow::OnLoadMapping); mButtonSave = new QPushButton(); - EMStudioManager::MakeTransparentButton(mButtonSave, "/Images/Menu/FileSave.svg", "Save the currently setup mapping as template."); + EMStudioManager::MakeTransparentButton(mButtonSave, "Images/Menu/FileSave.svg", "Save the currently setup mapping as template."); connect(mButtonSave, &QPushButton::clicked, this, &MirrorSetupWindow::OnSaveMapping); mButtonClear = new QPushButton(); - EMStudioManager::MakeTransparentButton(mButtonClear, "/Images/Icons/Clear.svg", "Clear the currently setup mapping entirely."); + EMStudioManager::MakeTransparentButton(mButtonClear, "Images/Icons/Clear.svg", "Clear the currently setup mapping entirely."); connect(mButtonClear, &QPushButton::clicked, this, &MirrorSetupWindow::OnClearMapping); mButtonGuess = new QPushButton(); - EMStudioManager::MakeTransparentButton(mButtonGuess, "/Images/Icons/Character.svg", "Perform name based mapping."); + EMStudioManager::MakeTransparentButton(mButtonGuess, "Images/Icons/Character.svg", "Perform name based mapping."); connect(mButtonGuess, &QPushButton::clicked, this, &MirrorSetupWindow::OnBestGuess); toolBarLayout->addWidget(mButtonOpen, 0, Qt::AlignLeft); @@ -195,7 +196,7 @@ namespace EMStudio sourceLabel->setTextFormat(Qt::RichText); sourceSearchLayout->addWidget(sourceLabel); //QPushButton* loadSourceButton = new QPushButton(); - //EMStudioManager::MakeTransparentButton( loadSourceButton, "/Images/Icons/Open.svg", "Load a source actor" ); + //EMStudioManager::MakeTransparentButton( loadSourceButton, "Images/Icons/Open.svg", "Load a source actor" ); //connect( loadSourceButton, SIGNAL(clicked()), this, SLOT(OnLoadSourceActor()) ); //sourceSearchLayout->addWidget( loadSourceButton, 0, Qt::AlignLeft ); spacerWidget = new QWidget(); @@ -248,7 +249,7 @@ namespace EMStudio lowerLayout->addLayout(mappingLayout); mappingLayout->addWidget(new QLabel("Mapping:"), 0, Qt::AlignLeft | Qt::AlignVCenter); //mButtonGuess = new QPushButton(); - //EMStudioManager::MakeTransparentButton( mButtonGuess, "/Images/Icons/Character.svg", "Best guess mapping" ); + //EMStudioManager::MakeTransparentButton( mButtonGuess, "Images/Icons/Character.svg", "Best guess mapping" ); //connect( mButtonGuess, SIGNAL(clicked()), this, SLOT(OnBestGuessGeometrical()) ); //mappingLayout->addWidget( mButtonGuess, 0, Qt::AlignLeft ); spacerWidget = new QWidget(); @@ -1253,4 +1254,4 @@ namespace EMStudio } // namespace EMStudio -#include \ No newline at end of file +#include diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/PlaybackControlsGroup.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/PlaybackControlsGroup.cpp index b29b62481d..6648039724 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/PlaybackControlsGroup.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/PlaybackControlsGroup.cpp @@ -26,23 +26,23 @@ namespace EMStudio : QObject(toolbar) { m_skipBackwardAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/SkipBackward.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/SkipBackward.svg"), "Skip backward", toolbar, &TimeViewToolBar::OnSkipBackwardButton); m_seekBackwardAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/SeekBackward.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/SeekBackward.svg"), "Seek backward", toolbar, &TimeViewToolBar::OnSeekBackwardButton); m_playForwardAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/PlayForward.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/PlayForward.svg"), "Play", toolbar, &TimeViewToolBar::OnPlayForwardButton); m_seekForwardAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/SeekForward.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/SeekForward.svg"), "Seek forward", toolbar, &TimeViewToolBar::OnSeekForwardButton); m_skipForwardAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/SkipForward.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/SkipForward.svg"), "Skip forward", toolbar, &TimeViewToolBar::OnSkipForwardButton); m_separatorRight = toolbar->addSeparator(); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/PlaybackOptionsGroup.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/PlaybackOptionsGroup.cpp index d8bb2ad580..b75fdf9a37 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/PlaybackOptionsGroup.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/PlaybackOptionsGroup.cpp @@ -22,27 +22,27 @@ namespace EMStudio : QObject(toolbar) { m_loopForeverAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Loop.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/Loop.svg"), "Loop forever", toolbar, &TimeViewToolBar::UpdateMotions); m_loopForeverAction->setCheckable(true); m_mirrorAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Mirror.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/Mirror.svg"), "Mirror", toolbar, &TimeViewToolBar::UpdateMotions); m_mirrorAction->setCheckable(true); m_backwardAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/MoveBackward.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/MoveBackward.svg"), "Move backward", toolbar, &TimeViewToolBar::UpdateMotions); m_backwardAction->setCheckable(true); m_inPlaceAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/InPlace.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/InPlace.svg"), "In place", toolbar, &TimeViewToolBar::UpdateMotions); m_inPlaceAction->setCheckable(true); m_retargetAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Retarget.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/Retarget.svg"), "Retarget", toolbar, &TimeViewToolBar::UpdateMotions); m_retargetAction->setCheckable(true); @@ -58,7 +58,7 @@ namespace EMStudio m_speedAction = toolbar->addWidget(m_speedSlider); m_speedResetAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Reset.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/Reset.svg"), tr("Reset the play speed to its normal speed."), this, &PlaybackOptionsGroup::ResetPlaySpeed); connect(m_speedResetAction, &QAction::triggered, toolbar, &TimeViewToolBar::UpdateMotions); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/RecorderGroup.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/RecorderGroup.cpp index e75b0f0f67..c9e7a8991e 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/RecorderGroup.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/RecorderGroup.cpp @@ -27,15 +27,15 @@ namespace EMStudio : QObject(toolbar) { m_clearRecordAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Clear.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/Clear.svg"), "Clear recording", toolbar, &TimeViewToolBar::OnClearRecordButton); m_recordAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/RecordButton.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/RecordButton.svg"), "Clear recording", toolbar, &TimeViewToolBar::OnRecordButton); m_recordOptionsAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Settings.svg"), ""); + MysticQt::GetMysticQt()->FindIcon("Images/Icons/Settings.svg"), ""); { QMenu* recordOptionsMenu = new QMenu(toolbar); recordOptionsMenu->addAction(tr("Recording options"))->setEnabled(false); @@ -70,7 +70,7 @@ namespace EMStudio } m_displayOptionsAction = toolbar->addAction( - MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Visualization.svg"), + MysticQt::GetMysticQt()->FindIcon("Images/Icons/Visualization.svg"), "Show display and visual options"); { QMenu* contextMenu = new QMenu(toolbar); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/TimeViewPlugin.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/TimeViewPlugin.cpp index 8eb3604c4d..3368adca34 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/TimeViewPlugin.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/TimeViewPlugin.cpp @@ -28,6 +28,7 @@ #include "../../../../EMStudioSDK/Source/MainWindow.h" #include +#include #include #include #include @@ -200,8 +201,8 @@ namespace EMStudio GetCommandManager()->RegisterCommandCallback("PlayMotion", m_commandCallbacks.back()); // load the cursors - mZoomInCursor = new QCursor(QPixmap(AZStd::string(MysticQt::GetDataDir() + "Images/Rendering/ZoomInCursor.png").c_str()).scaled(32, 32)); - mZoomOutCursor = new QCursor(QPixmap(AZStd::string(MysticQt::GetDataDir() + "Images/Rendering/ZoomOutCursor.png").c_str()).scaled(32, 32)); + mZoomInCursor = new QCursor(QPixmap(QDir{ QString(MysticQt::GetDataDir().c_str()) }.filePath("Images/Rendering/ZoomInCursor.png")).scaled(32, 32)); + mZoomOutCursor = new QCursor(QPixmap(QDir{ QString(MysticQt::GetDataDir().c_str()) }.filePath("Images/Rendering/ZoomOutCursor.png")).scaled(32, 32)); // create main widget mMainWidget = new QWidget(mDock); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/TrackDataHeaderWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/TrackDataHeaderWidget.cpp index f044129510..d7f0b8c2d4 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/TrackDataHeaderWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/TrackDataHeaderWidget.cpp @@ -16,6 +16,7 @@ #include "TimeInfoWidget.h" #include "TrackHeaderWidget.h" #include "TimeViewToolBar.h" +#include #include #include #include @@ -90,8 +91,8 @@ namespace EMStudio mDataFont.setPixelSize(13); // load the time handle top image - QString imageName = MysticQt::GetMysticQt()->GetDataDir().c_str(); - mTimeHandleTop = QPixmap(imageName + "Images/Icons/TimeHandleTop.png"); + QDir imageName{ QString(MysticQt::GetMysticQt()->GetDataDir().c_str()) }; + mTimeHandleTop = QPixmap(imageName.filePath("Images/Icons/TimeHandleTop.png")); setMouseTracking(true); setAcceptDrops(true); diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/TrackHeaderWidget.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/TrackHeaderWidget.cpp index 0f63c20ef9..ce592f2ff9 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/TrackHeaderWidget.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/Plugins/StandardPlugins/Source/TimeView/TrackHeaderWidget.cpp @@ -62,7 +62,7 @@ namespace EMStudio mainAddWidgetLayout->addWidget(label); QToolButton* addButton = new QToolButton(); - addButton->setIcon(MysticQt::GetMysticQt()->FindIcon("/Images/Icons/Plus.svg")); + addButton->setIcon(MysticQt::GetMysticQt()->FindIcon("Images/Icons/Plus.svg")); addButton->setToolTip("Add a new event track"); connect(addButton, &QToolButton::clicked, this, &TrackHeaderWidget::OnAddTrackButtonClicked); mainAddWidgetLayout->addWidget(addButton); diff --git a/Gems/EMotionFX/Code/Editor/Platform/Mac/platform_mac.cmake b/Gems/EMotionFX/Code/Editor/Platform/Mac/platform_mac.cmake index 16a97fff5f..821e7d1f25 100644 --- a/Gems/EMotionFX/Code/Editor/Platform/Mac/platform_mac.cmake +++ b/Gems/EMotionFX/Code/Editor/Platform/Mac/platform_mac.cmake @@ -15,8 +15,8 @@ # is being avoided to prevent overriding functions declared in other targets platfrom # specific cmake files -target_compile_definitions(OpenGLInterface +target_compile_definitions(3rdParty::OpenGLInterface INTERFACE # MacOS 10.14 deprecates OpenGL. This silences the warnings for now. GL_SILENCE_DEPRECATION -) +) \ No newline at end of file diff --git a/Gems/EMotionFX/Code/MysticQt/Source/MysticQtManager.cpp b/Gems/EMotionFX/Code/MysticQt/Source/MysticQtManager.cpp index 703451d767..3408560237 100644 --- a/Gems/EMotionFX/Code/MysticQt/Source/MysticQtManager.cpp +++ b/Gems/EMotionFX/Code/MysticQt/Source/MysticQtManager.cpp @@ -14,7 +14,7 @@ #include "MysticQtManager.h" #include #include - +#include namespace MysticQt { @@ -48,7 +48,7 @@ namespace MysticQt MysticQtManager::IconData::IconData(const char* filename) { mFileName = filename; - mIcon = new QIcon(AZStd::string::format("%s%s", GetMysticQt()->GetDataDir().c_str(), filename).c_str()); + mIcon = new QIcon(QDir{ QString(GetMysticQt()->GetDataDir().c_str()) }.filePath(filename)); } diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/ActorGoalNodeHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/ActorGoalNodeHandler.cpp index 175b563e25..ab6a05f448 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/ActorGoalNodeHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/ActorGoalNodeHandler.cpp @@ -36,7 +36,7 @@ namespace EMotionFX hLayout->addWidget(m_pickButton); m_resetButton = new QPushButton(this); - EMStudio::EMStudioManager::MakeTransparentButton(m_resetButton, "/Images/Icons/Clear.svg", "Reset selection"); + EMStudio::EMStudioManager::MakeTransparentButton(m_resetButton, "Images/Icons/Clear.svg", "Reset selection"); connect(m_resetButton, &QPushButton::clicked, this, &ActorGoalNodePicker::OnResetClicked); hLayout->addWidget(m_resetButton); @@ -196,4 +196,4 @@ namespace EMotionFX } } // namespace EMotionFX -#include \ No newline at end of file +#include diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/ActorJointHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/ActorJointHandler.cpp index 6baeae904b..4ab1a790dd 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/ActorJointHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/ActorJointHandler.cpp @@ -40,7 +40,7 @@ namespace EMotionFX { connect(m_pickButton, &QPushButton::clicked, this, &ActorJointPicker::OnPickClicked); - EMStudio::EMStudioManager::MakeTransparentButton(m_resetButton, "/Images/Icons/Clear.svg", "Reset selection"); + EMStudio::EMStudioManager::MakeTransparentButton(m_resetButton, "Images/Icons/Clear.svg", "Reset selection"); connect(m_resetButton, &QPushButton::clicked, this, &ActorJointPicker::OnResetClicked); QHBoxLayout* hLayout = new QHBoxLayout(); diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/ActorMorphTargetHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/ActorMorphTargetHandler.cpp index f84933e613..91e6d5ca04 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/ActorMorphTargetHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/ActorMorphTargetHandler.cpp @@ -39,7 +39,7 @@ namespace EMotionFX hLayout->addWidget(m_pickButton); m_resetButton = new QPushButton(this); - EMStudio::EMStudioManager::MakeTransparentButton(m_resetButton, "/Images/Icons/Clear.svg", "Reset selection"); + EMStudio::EMStudioManager::MakeTransparentButton(m_resetButton, "Images/Icons/Clear.svg", "Reset selection"); connect(m_resetButton, &QPushButton::clicked, this, &ActorMorphTargetPicker::OnResetClicked); hLayout->addWidget(m_resetButton); diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphParameterHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphParameterHandler.cpp index 9b54a7328d..de80f5d7aa 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphParameterHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphParameterHandler.cpp @@ -52,14 +52,14 @@ namespace EMotionFX hLayout->addWidget(m_pickButton); m_resetButton = new QPushButton(this); - EMStudio::EMStudioManager::MakeTransparentButton(m_resetButton, "/Images/Icons/Clear.svg", "Reset selection"); + EMStudio::EMStudioManager::MakeTransparentButton(m_resetButton, "Images/Icons/Clear.svg", "Reset selection"); connect(m_resetButton, &QPushButton::clicked, this, &AnimGraphParameterPicker::OnResetClicked); hLayout->addWidget(m_resetButton); if (m_parameterMaskMode) { m_shrinkButton = new QPushButton(); - EMStudio::EMStudioManager::MakeTransparentButton(m_shrinkButton, "/Images/Icons/Cut.svg", "Shrink the parameter mask to the ports that are actually connected."); + EMStudio::EMStudioManager::MakeTransparentButton(m_shrinkButton, "Images/Icons/Cut.svg", "Shrink the parameter mask to the ports that are actually connected."); connect(m_shrinkButton, &QPushButton::clicked, this, &AnimGraphParameterPicker::OnShrinkClicked); hLayout->addWidget(m_shrinkButton); } diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphTransitionHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphTransitionHandler.cpp index 9c2266b7cc..33b92c3625 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphTransitionHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphTransitionHandler.cpp @@ -209,7 +209,7 @@ namespace EMotionFX transitionLayout->addWidget(transitionLineEdit, row, 0); QPushButton* removeTransitionButton = new QPushButton(); - EMStudio::EMStudioManager::MakeTransparentButton(removeTransitionButton, "/Images/Icons/Trash.svg", "Remove transition from list"); + EMStudio::EMStudioManager::MakeTransparentButton(removeTransitionButton, "Images/Icons/Trash.svg", "Remove transition from list"); connect(removeTransitionButton, &QPushButton::clicked, this, [this, removeTransitionButton, id]() { m_transitionIds.erase(AZStd::remove(m_transitionIds.begin(), m_transitionIds.end(), id), m_transitionIds.end()); diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/BlendSpaceMotionContainerHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/BlendSpaceMotionContainerHandler.cpp index 19b9958b7c..6472caaf68 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/BlendSpaceMotionContainerHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/BlendSpaceMotionContainerHandler.cpp @@ -494,7 +494,7 @@ namespace EMotionFX // Add motions button. QPushButton* addMotionsButton = new QPushButton(); - EMStudio::EMStudioManager::MakeTransparentButton(addMotionsButton, "/Images/Icons/Plus.svg", "Add motions to blend space"); + EMStudio::EMStudioManager::MakeTransparentButton(addMotionsButton, "Images/Icons/Plus.svg", "Add motions to blend space"); connect(addMotionsButton, &QPushButton::clicked, this, &BlendSpaceMotionContainerWidget::OnAddMotion); topRowLayout->addWidget(addMotionsButton, 0, Qt::AlignRight); diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/MotionSetMotionIdHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/MotionSetMotionIdHandler.cpp index b8607fdbb3..b1f74701b8 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/MotionSetMotionIdHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/MotionSetMotionIdHandler.cpp @@ -304,7 +304,7 @@ namespace EMotionFX topRowLayout->addWidget(m_addMotionsLabel); m_pickButton = new QPushButton(this); - EMStudio::EMStudioManager::MakeTransparentButton(m_pickButton, "/Images/Icons/Plus.svg", "Add motions to blend space"); + EMStudio::EMStudioManager::MakeTransparentButton(m_pickButton, "Images/Icons/Plus.svg", "Add motions to blend space"); m_pickButton->setObjectName("EMFX.MotionSetMotionIdPicker.PickButton"); connect(m_pickButton, &QPushButton::clicked, this, &MotionSetMotionIdPicker::OnPickClicked); topRowLayout->addWidget(m_pickButton); diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/SimulatedObjectSelectionHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/SimulatedObjectSelectionHandler.cpp index c52cafa3c7..0fe01a8d92 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/SimulatedObjectSelectionHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/SimulatedObjectSelectionHandler.cpp @@ -33,7 +33,7 @@ namespace EMotionFX hLayout->addWidget(m_pickButton); m_resetButton = new QPushButton(this); - EMStudio::EMStudioManager::MakeTransparentButton(m_resetButton, "/Images/Icons/Clear.svg", "Reset selection"); + EMStudio::EMStudioManager::MakeTransparentButton(m_resetButton, "Images/Icons/Clear.svg", "Reset selection"); connect(m_resetButton, &QPushButton::clicked, this, &SimulatedObjectPicker::OnResetClicked); hLayout->addWidget(m_resetButton); diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/TransitionStateFilterLocalHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/TransitionStateFilterLocalHandler.cpp index 866b796ef8..806afda68b 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/TransitionStateFilterLocalHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/TransitionStateFilterLocalHandler.cpp @@ -38,7 +38,7 @@ namespace EMotionFX hLayout->addWidget(m_pickButton); m_resetButton = new QPushButton(this); - EMStudio::EMStudioManager::MakeTransparentButton(m_resetButton, "/Images/Icons/Clear.svg", "Reset selection"); + EMStudio::EMStudioManager::MakeTransparentButton(m_resetButton, "Images/Icons/Clear.svg", "Reset selection"); connect(m_resetButton, &QPushButton::clicked, this, &TransitionStateFilterPicker::OnResetClicked); hLayout->addWidget(m_resetButton); @@ -187,4 +187,4 @@ namespace EMotionFX } } // namespace EMotionFX -#include \ No newline at end of file +#include diff --git a/Gems/EMotionFX/Code/Source/Editor/SimulatedObjectModel.cpp b/Gems/EMotionFX/Code/Source/Editor/SimulatedObjectModel.cpp index 2bbb8ec4fd..68c1146eae 100644 --- a/Gems/EMotionFX/Code/Source/Editor/SimulatedObjectModel.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/SimulatedObjectModel.cpp @@ -152,8 +152,6 @@ namespace EMotionFX SimulatedJoint* joint = object->GetSimulatedRootJoint(row); return createIndex(row, column, joint); } - - return QModelIndex(); } } diff --git a/Gems/EMotionFX/Code/Source/Integration/Assets/ActorAsset.h b/Gems/EMotionFX/Code/Source/Integration/Assets/ActorAsset.h index b0259abd96..f96f6ca3c1 100644 --- a/Gems/EMotionFX/Code/Source/Integration/Assets/ActorAsset.h +++ b/Gems/EMotionFX/Code/Source/Integration/Assets/ActorAsset.h @@ -32,7 +32,7 @@ namespace EMotionFX /** * Represents an EMotionFX actor asset. * Each asset maintains storage of the original EMotionFX binary asset (via EMotionFXAsset base class). - * Initialization of the asset constructs Lumberyard rendering objects, such as the render mesh and material, + * Initialization of the asset constructs Open 3D Engine rendering objects, such as the render mesh and material, * directly from the instantiated EMotionFX actor. * An easy future memory optimization is to wipe the EMotionFXAsset buffer after the actor, render meshes, * and materials are created, since it's technically no longer necessary. At this stage it's worth keeping @@ -68,7 +68,7 @@ namespace EMotionFX /** * Asset handler for loading and initializing actor assets. - * The OnInitAsset stage constructs Lumberyard render meshes and materials by extracting + * The OnInitAsset stage constructs Open 3D Engine render meshes and materials by extracting * said data from the EMotionFX actor. */ class ActorAssetHandler diff --git a/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp index 5521ac31cb..0a64c7b408 100644 --- a/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -860,16 +861,13 @@ namespace EMotionFX using namespace AzToolsFramework; // Construct data folder that is used by the tool for loading assets (images etc.). - AZStd::string devRootPath; - AzFramework::ApplicationRequests::Bus::BroadcastResult(devRootPath, &AzFramework::ApplicationRequests::GetEngineRoot); - devRootPath += "Gems/EMotionFX/Assets/Editor/"; - AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePathKeepCase, devRootPath); + auto editorAssetsPath = (AZ::IO::FixedMaxPath(AZ::Utils::GetEnginePath()) / "Gems/EMotionFX/Assets/Editor").LexicallyNormal(); // Re-initialize EMStudio. int argc = 0; char** argv = nullptr; - MysticQt::Initializer::Init("", devRootPath.c_str()); + MysticQt::Initializer::Init("", editorAssetsPath.c_str()); EMStudio::Initializer::Init(qApp, argc, argv); InitializeEMStudioPlugins(); diff --git a/Gems/EMotionFX/Code/Tests/UI/CanUseLayoutMenu.cpp b/Gems/EMotionFX/Code/Tests/UI/CanUseLayoutMenu.cpp index 6651000c1c..6701340f7d 100644 --- a/Gems/EMotionFX/Code/Tests/UI/CanUseLayoutMenu.cpp +++ b/Gems/EMotionFX/Code/Tests/UI/CanUseLayoutMenu.cpp @@ -66,7 +66,7 @@ namespace EMotionFX QString GetLayoutFileDirectory() const { - return QString("%1Layouts").arg(MysticQt::GetDataDir().c_str()); + return QDir{ QString(MysticQt::GetDataDir().c_str()) }.filePath("Layouts"); } QString GetLayoutFileName() diff --git a/Gems/EditorPythonBindings/Code/Source/PythonProxyBus.h b/Gems/EditorPythonBindings/Code/Source/PythonProxyBus.h index 53dc863f58..4be0767849 100644 --- a/Gems/EditorPythonBindings/Code/Source/PythonProxyBus.h +++ b/Gems/EditorPythonBindings/Code/Source/PythonProxyBus.h @@ -18,7 +18,7 @@ namespace EditorPythonBindings { namespace PythonProxyBusManagement { - //! Creates the 'azlmbr.bus' module so that Python script can use Lumberyard buses + //! Creates the 'azlmbr.bus' module so that Python script can use Open 3D Engine buses void CreateSubmodule(pybind11::module module); } } diff --git a/Gems/GraphCanvas/Code/Source/Widgets/GraphCanvasLabel.cpp b/Gems/GraphCanvas/Code/Source/Widgets/GraphCanvasLabel.cpp index 11b230515a..21f56e2f39 100644 --- a/Gems/GraphCanvas/Code/Source/Widgets/GraphCanvasLabel.cpp +++ b/Gems/GraphCanvas/Code/Source/Widgets/GraphCanvasLabel.cpp @@ -437,7 +437,5 @@ namespace GraphCanvas default: return QGraphicsWidget::sizeHint(which, constraint); } - - return QGraphicsWidget::sizeHint(which, constraint); } } diff --git a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/Parser.cpp b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/Parser.cpp index 3f887a9121..319996949b 100644 --- a/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/Parser.cpp +++ b/Gems/GraphCanvas/Code/StaticLib/GraphCanvas/Styling/Parser.cpp @@ -331,8 +331,6 @@ namespace { return QColor(color); } - - return QColor(); } bool IsColorValid(const QString& value) diff --git a/Gems/ImGui/Code/Include/ImGuiContextScope.h b/Gems/ImGui/Code/Include/ImGuiContextScope.h index 275dd7dce2..8f441ce733 100644 --- a/Gems/ImGui/Code/Include/ImGuiContextScope.h +++ b/Gems/ImGui/Code/Include/ImGuiContextScope.h @@ -12,6 +12,8 @@ #pragma once +struct ImGuiContext; + //////////////////////////////////////////////////////////////////////////////////////////////////// namespace ImGui { @@ -22,16 +24,21 @@ namespace ImGui { public: //////////////////////////////////////////////////////////////////////////////////////////// - explicit ImGuiContextScope(ImGuiContext* newContext) - : m_previousContext(ImGui::GetCurrentContext()) + explicit ImGuiContextScope([[maybe_unused]] ImGuiContext* newContext) + : m_previousContext(nullptr) { +#if defined(IMGUI_ENABLED) + m_previousContext = ImGui::GetCurrentContext(); ImGui::SetCurrentContext(newContext); +#endif } //////////////////////////////////////////////////////////////////////////////////////////// ~ImGuiContextScope() { +#if defined(IMGUI_ENABLED) ImGui::SetCurrentContext(m_previousContext); +#endif } private: diff --git a/Gems/ImGui/Code/Source/ImGuiManager.cpp b/Gems/ImGui/Code/Source/ImGuiManager.cpp index c47e5506e1..697cc61f86 100644 --- a/Gems/ImGui/Code/Source/ImGuiManager.cpp +++ b/Gems/ImGui/Code/Source/ImGuiManager.cpp @@ -142,11 +142,6 @@ namespace void ImGuiManager::Initialize() { - if (!gEnv || !gEnv->pRenderer) - { - AZ_Warning("ImGuiManager", false, "%s %s", __func__, "gEnv Invalid -- Skipping ImGui Initialization."); - return; - } // Register for Buses ImGuiManagerListenerBus::Handler::BusConnect(); @@ -223,23 +218,9 @@ void ImGuiManager::Initialize() s_lyInputToImGuiNavIndexMap.insert(LyButtonImGuiNavIndexPair(InputDeviceGamepad::ThumbStickDirection::LL, ImGuiNavInput_LStickLeft)); s_lyInputToImGuiNavIndexMap.insert(LyButtonImGuiNavIndexPair(InputDeviceGamepad::ThumbStickDirection::LR, ImGuiNavInput_LStickRight)); - // Set the Display Size - IRenderer* renderer = gEnv->pRenderer; - io.DisplaySize.x = static_cast(renderer->GetWidth()); - io.DisplaySize.y = static_cast(renderer->GetHeight()); - - // Create Font Texture - unsigned char* pixels; - int width, height; - io.Fonts->GetTexDataAsAlpha8(&pixels, &width, &height); - ITexture* fontTexture = - renderer->Create2DTexture("ImGuiFont", width, height, 1, FT_ALPHA, pixels, eTF_A8); - - if (fontTexture) - { - m_fontTextureId = fontTexture->GetTextureID(); - io.Fonts->SetTexID(static_cast(fontTexture)); - } + // Set the initial Display Size (gets updated each frame anyway) + io.DisplaySize.x = 1920; + io.DisplaySize.y = 1080; // Broadcast ImGui Ready to Listeners ImGuiUpdateListenerBus::Broadcast(&IImGuiUpdateListener::OnImGuiInitialize); @@ -273,18 +254,6 @@ void ImGuiManager::Shutdown() InputTextEventListener::Disconnect(); AzFramework::WindowNotificationBus::Handler::BusDisconnect(); - if (!AZ::Interface::Get()) - { - // Destroy ImGui Font Texture - if (gEnv->pRenderer && m_fontTextureId > 0) - { - ImGui::ImGuiContextScope contextScope(m_imguiContext); - ImGuiIO& io = ImGui::GetIO(); - io.Fonts->SetTexID(nullptr); - gEnv->pRenderer->RemoveTexture(m_fontTextureId); - } - } - // Finally, destroy the ImGui Context. ImGui::DestroyContext(m_imguiContext); } @@ -386,7 +355,6 @@ void ImGuiManager::Render() io.DeltaTime = gEnv->pTimer->GetFrameTime(); //// END FROM PREUPDATE - IRenderer* renderer = gEnv->pRenderer; TransformationMatrices backupSceneMatrices; AZ::u32 backBufferWidth = 0; @@ -397,11 +365,6 @@ void ImGuiManager::Render() backBufferWidth = m_windowSize.m_width; backBufferHeight = m_windowSize.m_height; } - else - { - backBufferWidth = renderer->GetBackBufferWidth(); - backBufferHeight = renderer->GetBackBufferHeight(); - } // Find ImGui Render Resolution. int renderRes[2]; @@ -441,25 +404,9 @@ void ImGuiManager::Render() m_lastRenderResolution.x = static_cast(renderRes[0]); m_lastRenderResolution.y = static_cast(renderRes[1]); - if (!AZ::Interface::Get()) - { - // Configure Renderer for 2D ImGui Rendering - renderer->SetCullMode(R_CULL_DISABLE); - renderer->Set2DMode(renderRes[0], renderRes[1], backupSceneMatrices); - renderer->SetColorOp(eCO_REPLACE, eCO_MODULATE, eCA_Diffuse, DEF_TEXARG0); - renderer->SetSrgbWrite(false); - renderer->SetState(GS_BLSRC_SRCALPHA | GS_BLDST_ONEMINUSSRCALPHA | GS_NODEPTHTEST); - } - // Render! RenderImGuiBuffers(scaleRects); - if (!AZ::Interface::Get()) - { - // Cleanup Renderer Settings - renderer->Unset2DMode(backupSceneMatrices); - } - // Clear the simulated backspace key if (m_simulateBackspaceKeyPressed) { @@ -793,91 +740,6 @@ void ImGuiManager::RenderImGuiBuffers(const ImVec2& scaleRects) { OtherActiveImGuiRequestBus::Broadcast(&OtherActiveImGuiRequestBus::Events::RenderImGuiBuffers, *drawData); } - else - { - IRenderer* renderer = gEnv->pRenderer; - - // Expand vertex buffer if necessary - m_vertBuffer.reserve(drawData->TotalVtxCount); - if (m_vertBuffer.size() < drawData->TotalVtxCount) - { - m_vertBuffer.insert(m_vertBuffer.end(), - drawData->TotalVtxCount - m_vertBuffer.size(), - SVF_P3F_C4B_T2F()); - } - - // Expand index buffer if necessary - m_idxBuffer.reserve(drawData->TotalIdxCount); - if (m_idxBuffer.size() < drawData->TotalIdxCount) - { - m_idxBuffer.insert(m_idxBuffer.end(), drawData->TotalIdxCount - m_idxBuffer.size(), 0); - } - - // Process each draw command list individually - for (int n = 0; n < drawData->CmdListsCount; n++) - { - const ImDrawList* cmd_list = drawData->CmdLists[n]; - - // Cache max vert count for easy access - int numVerts = cmd_list->VtxBuffer.Size; - - // Copy command list verts into buffer - for (int i = 0; i < numVerts; ++i) - { - const ImDrawVert& imguiVert = cmd_list->VtxBuffer[i]; - SVF_P3F_C4B_T2F& vert = m_vertBuffer[i]; - - vert.xyz = Vec3(imguiVert.pos.x, imguiVert.pos.y, 0.0f); - // Convert color from RGBA to ARGB - vert.color.dcolor = (imguiVert.col & 0xFF00FF00) - | ((imguiVert.col & 0xFF0000) >> 16) - | ((imguiVert.col & 0xFF) << 16); - vert.st = Vec2(imguiVert.uv.x, imguiVert.uv.y); - } - - // Copy command list indices into buffer - for (int i = 0; i < cmd_list->IdxBuffer.Size; ++i) - { - m_idxBuffer[i] = uint16(cmd_list->IdxBuffer[i]); - } - - // Use offset pointer to step along rendering operation - uint16* idxBufferDataOffset = m_idxBuffer.data(); - - // Process each draw command individually - for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.size(); cmd_i++) - { - const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i]; - - // Defer to user rendering callback, if appropriate - if (pcmd->UserCallback) - { - pcmd->UserCallback(cmd_list, pcmd); - } - // Otherwise render our buffers - else - { - int textureId = ((ITexture*)pcmd->TextureId)->GetTextureID(); - renderer->SetTexture(textureId); - renderer->SetScissor((int)pcmd->ClipRect.x, - (int)(pcmd->ClipRect.y), - (int)(pcmd->ClipRect.z - pcmd->ClipRect.x), - (int)(pcmd->ClipRect.w - pcmd->ClipRect.y)); - renderer->DrawDynVB(m_vertBuffer.data(), - idxBufferDataOffset, - numVerts, - pcmd->ElemCount, - prtTriangleList); - } - - // Update offset pointer into command list's index buffer - idxBufferDataOffset += pcmd->ElemCount; - } - } - - // Reset scissor usage on renderer - renderer->SetScissor(); - } } } diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp index e74e58b854..c157189400 100644 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp +++ b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp @@ -23,7 +23,7 @@ namespace ImGui { - // Resolution Widths to recommend for usage for both LumberYard Rendering and/or ImGui Rendering + // Resolution Widths to recommend for usage for both O3DE Rendering and/or ImGui Rendering static int s_renderResolutionWidths[7] = { 800, 1280, 1600, 1920, 2560, 3440, 3840 }; static int s_renderAspectRatios[4][2] = { {16,9}, {16,10}, {43,18}, {4,3} }; static const char* s_toggleTelemetryConsoleCmd = "radtm_ToggleEnabled 1"; @@ -158,8 +158,8 @@ namespace ImGui // Add some space before the first menu so it won't overlap with view control buttons ImGui::SetCursorPosX(40.f); - // Main LumberYard menu - if (ImGui::BeginMenu("LumberYard")) + // Main Open 3D Engine menu + if (ImGui::BeginMenu("Open 3D Engine")) { // Asset Explorer if (ImGui::MenuItem("Asset Explorer")) diff --git a/Gems/ImageProcessing/Code/Source/BuilderSettings/BuilderSettingManager.h b/Gems/ImageProcessing/Code/Source/BuilderSettings/BuilderSettingManager.h index e65ac9c61c..c6d03eae54 100644 --- a/Gems/ImageProcessing/Code/Source/BuilderSettings/BuilderSettingManager.h +++ b/Gems/ImageProcessing/Code/Source/BuilderSettings/BuilderSettingManager.h @@ -50,7 +50,7 @@ namespace ImageProcessing const BuilderSettings* GetBuilderSetting(const PlatformName& platform); /** - * Attempts to translate a legacy preset name into Lumberyard preset name. + * Attempts to translate a legacy preset name into Open 3D Engine preset name. * @param legacy preset name string * @return A translated preset name. If no translation is available, returns the same value as input argument. */ diff --git a/Gems/ImageProcessing/Code/Source/Converters/Cubemap.h b/Gems/ImageProcessing/Code/Source/Converters/Cubemap.h index 0bf7b5db7a..cc036814e8 100644 --- a/Gems/ImageProcessing/Code/Source/Converters/Cubemap.h +++ b/Gems/ImageProcessing/Code/Source/Converters/Cubemap.h @@ -16,7 +16,7 @@ namespace ImageProcessing { - // note: lumberyard is right hand Z up coordinate + // note: O3DE is right hand Z up coordinate // please don't change the order of the enum since we are using it to match the face id defined in AMD's CubemapGen // and they are using left hand Y up coordinate enum CubemapFace diff --git a/Gems/InAppPurchases/Code/Source/InAppPurchasesSystemComponent.cpp b/Gems/InAppPurchases/Code/Source/InAppPurchasesSystemComponent.cpp index 02487e4869..99fbea129c 100644 --- a/Gems/InAppPurchases/Code/Source/InAppPurchasesSystemComponent.cpp +++ b/Gems/InAppPurchases/Code/Source/InAppPurchasesSystemComponent.cpp @@ -212,7 +212,7 @@ namespace InAppPurchases } else { - AZ_Warning("LumberyardInAppPurchases", false, "The JSON string provided does not contain an array named ProductIds!(Property *has* to be an array)"); + AZ_Warning("O3DEInAppPurchases", false, "The JSON string provided does not contain an array named ProductIds!(Property *has* to be an array)"); } } } diff --git a/Gems/InAppPurchases/Code/Source/Platform/Common/Apple/InAppPurchasesApple.mm b/Gems/InAppPurchases/Code/Source/Platform/Common/Apple/InAppPurchasesApple.mm index 99d59e183e..21aec6df4b 100644 --- a/Gems/InAppPurchases/Code/Source/Platform/Common/Apple/InAppPurchasesApple.mm +++ b/Gems/InAppPurchases/Code/Source/Platform/Common/Apple/InAppPurchasesApple.mm @@ -43,7 +43,7 @@ namespace if (!payload) { - AZ_TracePrintf("LumberyardInAppPurchases", "Payload is null!"); + AZ_TracePrintf("O3DEInAppPurchases", "Payload is null!"); return false; } @@ -174,12 +174,12 @@ namespace InAppPurchases } else { - AZ_TracePrintf("LumberyardInAppPurchases", "Unable to find any product ids in product_ids.plist"); + AZ_TracePrintf("O3DEInAppPurchases", "Unable to find any product ids in product_ids.plist"); } } else { - AZ_TracePrintf("LumberyardInAppPurchases", "product_ids.plist does not exist"); + AZ_TracePrintf("O3DEInAppPurchases", "product_ids.plist does not exist"); } } @@ -217,7 +217,7 @@ namespace InAppPurchases FILE* fp = fopen(receiptPath, "rb"); if (!fp) { - AZ_TracePrintf("LumberyardInAppPurchases", "Unable to open receipt!"); + AZ_TracePrintf("O3DEInAppPurchases", "Unable to open receipt!"); return; } @@ -225,7 +225,7 @@ namespace InAppPurchases fclose(fp); if (!p7) { - AZ_TracePrintf("LumberyardInAppPurchases", "PKCS7 container is null!"); + AZ_TracePrintf("O3DEInAppPurchases", "PKCS7 container is null!"); return; } diff --git a/Gems/InAppPurchases/Code/Source/Platform/Common/Apple/InAppPurchasesDelegate.mm b/Gems/InAppPurchases/Code/Source/Platform/Common/Apple/InAppPurchasesDelegate.mm index 9583eafd88..0eeb4a9480 100644 --- a/Gems/InAppPurchases/Code/Source/Platform/Common/Apple/InAppPurchasesDelegate.mm +++ b/Gems/InAppPurchases/Code/Source/Platform/Common/Apple/InAppPurchasesDelegate.mm @@ -75,7 +75,7 @@ if (userNameLength > UINT32_MAX) { - AZ_TracePrintf("LumberyardInAppPurchases", "Username too long to hash:%s", [userName cStringUsingEncoding:NSASCIIStringEncoding]); + AZ_TracePrintf("O3DEInAppPurchases", "Username too long to hash:%s", [userName cStringUsingEncoding:NSASCIIStringEncoding]); return nil; } @@ -137,7 +137,7 @@ { for (NSString* invalidId in response.invalidProductIdentifiers) { - AZ_TracePrintf("LumberyardInAppPurchases:", "Invalid product ID:", [invalidId cStringUsingEncoding:NSASCIIStringEncoding]); + AZ_TracePrintf("O3DEInAppPurchases:", "Invalid product ID:", [invalidId cStringUsingEncoding:NSASCIIStringEncoding]); } InAppPurchases::InAppPurchasesInterface::GetInstance()->GetCache()->ClearCachedProductDetails(); @@ -192,7 +192,7 @@ } else { - AZ_TracePrintf("LumberyardInAppPurchases", "Invalid product ID:%s", [productId cStringUsingEncoding:NSASCIIStringEncoding]); + AZ_TracePrintf("O3DEInAppPurchases", "Invalid product ID:%s", [productId cStringUsingEncoding:NSASCIIStringEncoding]); } } @@ -206,13 +206,13 @@ { case SKPaymentTransactionStatePurchasing: { - AZ_TracePrintf("LumberyardInAppPurchases", "Transaction in progress"); + AZ_TracePrintf("O3DEInAppPurchases", "Transaction in progress"); break; } case SKPaymentTransactionStateDeferred: { - AZ_TracePrintf("LumberyardInAppPurchases", "Transaction deferred"); + AZ_TracePrintf("O3DEInAppPurchases", "Transaction deferred"); break; } @@ -220,7 +220,7 @@ { if ([self.m_unfinishedTransactions containsObject:transaction] == false) { - AZ_TracePrintf("LumberyardInAppPurchases", "Transaction failed! Error: %s", [[transaction.error localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]); + AZ_TracePrintf("O3DEInAppPurchases", "Transaction failed! Error: %s", [[transaction.error localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]); InAppPurchases::PurchasedProductDetailsApple* productDetails = [self parseTransactionDetails:transaction isRestored:false]; productDetails->SetPurchaseState(InAppPurchases::PurchaseState::FAILED); [self.m_unfinishedTransactions addObject:transaction]; @@ -234,7 +234,7 @@ { if ([self.m_unfinishedTransactions containsObject:transaction] == false) { - AZ_TracePrintf("LumberyardInAppPurchases", "Transaction succeeded"); + AZ_TracePrintf("O3DEInAppPurchases", "Transaction succeeded"); InAppPurchases::PurchasedProductDetailsApple* productDetails = [self parseTransactionDetails:transaction isRestored:false]; productDetails->SetPurchaseState(InAppPurchases::PurchaseState::PURCHASED); InAppPurchases::InAppPurchasesInterface::GetInstance()->GetCache()->AddPurchasedProductDetailsToCache(productDetails); @@ -255,7 +255,7 @@ { if ([self.m_unfinishedTransactions containsObject:transaction] == false) { - AZ_TracePrintf("LumberyardInAppPurchases", "Transaction restored"); + AZ_TracePrintf("O3DEInAppPurchases", "Transaction restored"); InAppPurchases::PurchasedProductDetailsApple* productDetails = [self parseTransactionDetails:transaction isRestored:true]; productDetails->SetPurchaseState(InAppPurchases::PurchaseState::RESTORED); InAppPurchases::InAppPurchasesInterface::GetInstance()->GetCache()->AddPurchasedProductDetailsToCache(productDetails); @@ -292,7 +292,7 @@ } } - AZ_TracePrintf("LumberyardInAppPurchases", "No unfinished transaction found with ID: %s", [transactionId cStringUsingEncoding:NSASCIIStringEncoding]); + AZ_TracePrintf("O3DEInAppPurchases", "No unfinished transaction found with ID: %s", [transactionId cStringUsingEncoding:NSASCIIStringEncoding]); } -(void) downloadAppleHostedContentAndFinishTransaction:(NSString*) transactionId @@ -320,7 +320,7 @@ } else { - AZ_TracePrintf("LumberyardInAppPurchases", "No unfinished transaction found with ID: %s", [transactionId cStringUsingEncoding:NSASCIIStringEncoding]); + AZ_TracePrintf("O3DEInAppPurchases", "No unfinished transaction found with ID: %s", [transactionId cStringUsingEncoding:NSASCIIStringEncoding]); } } @@ -360,7 +360,7 @@ case SKDownloadStateFailed: { - AZ_TracePrintf("LumberyardInAppPurchases", "Download failed with error: %s", [[download.error localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]); + AZ_TracePrintf("O3DEInAppPurchases", "Download failed with error: %s", [[download.error localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]); AZStd::string transactionId = [download.transaction.transactionIdentifier cStringUsingEncoding:NSASCIIStringEncoding]; AZStd::string contentId = [download.contentIdentifier UTF8String]; EBUS_EVENT(InAppPurchases::InAppPurchasesResponseBus, HostedContentDownloadFailed, transactionId, contentId); @@ -370,7 +370,7 @@ case SKDownloadStateCancelled: { - AZ_TracePrintf("LumberyardInAppPurchases", "Download cancelled: %s", [download.contentIdentifier cStringUsingEncoding:NSASCIIStringEncoding]); + AZ_TracePrintf("O3DEInAppPurchases", "Download cancelled: %s", [download.contentIdentifier cStringUsingEncoding:NSASCIIStringEncoding]); [self.m_unfinishedDownloads removeObject:download.contentIdentifier]; } break; @@ -402,7 +402,7 @@ -(void) request:(SKRequest*) request didFailWithError:(NSError*) error { - AZ_TracePrintf("LumberyardInAppPurchases", "Request failed with error: %s", [[error localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]); + AZ_TracePrintf("O3DEInAppPurchases", "Request failed with error: %s", [[error localizedDescription] cStringUsingEncoding:NSASCIIStringEncoding]); } -(void) requestDidFinish:(SKRequest *)request diff --git a/Gems/LmbrCentral/Code/Source/Builders/CopyDependencyBuilder/XmlBuilderWorker/XmlBuilderWorker.cpp b/Gems/LmbrCentral/Code/Source/Builders/CopyDependencyBuilder/XmlBuilderWorker/XmlBuilderWorker.cpp index 1da0759275..f50526c67f 100644 --- a/Gems/LmbrCentral/Code/Source/Builders/CopyDependencyBuilder/XmlBuilderWorker/XmlBuilderWorker.cpp +++ b/Gems/LmbrCentral/Code/Source/Builders/CopyDependencyBuilder/XmlBuilderWorker/XmlBuilderWorker.cpp @@ -32,7 +32,7 @@ namespace CopyDependencyBuilder { if (!AzFramework::StringFunc::Path::HasExtension(fileName.c_str())) { - // Lumberyard makes use of some files without extensions, only replace the extension if there is an expected extension. + // Open 3D Engine makes use of some files without extensions, only replace the extension if there is an expected extension. if (!expectedExtension.empty()) { AzFramework::StringFunc::Path::ReplaceExtension(fileName, expectedExtension.c_str()); diff --git a/Gems/LmbrCentral/Code/Source/Builders/MaterialBuilder/MaterialBuilderComponent.cpp b/Gems/LmbrCentral/Code/Source/Builders/MaterialBuilder/MaterialBuilderComponent.cpp index 9407d639cb..59cd195679 100644 --- a/Gems/LmbrCentral/Code/Source/Builders/MaterialBuilder/MaterialBuilderComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Builders/MaterialBuilder/MaterialBuilderComponent.cpp @@ -285,7 +285,7 @@ namespace MaterialBuilder } else if (hasExtension) { - AZ_Warning(s_materialBuilder, false, "Failed to resolve texture path %s as the path is not to a supported texture format. Please make sure that textures in materials are formats supported by Lumberyard.", aliasedPath.c_str()); + AZ_Warning(s_materialBuilder, false, "Failed to resolve texture path %s as the path is not to a supported texture format. Please make sure that textures in materials are formats supported by Open 3D Engine.", aliasedPath.c_str()); return false; } diff --git a/Gems/LmbrCentral/Code/Source/Shape/CapsuleShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/CapsuleShapeComponent.cpp index 1c54e81b72..46eb69dbd8 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/CapsuleShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/CapsuleShapeComponent.cpp @@ -26,14 +26,12 @@ namespace LmbrCentral { provided.push_back(AZ_CRC("ShapeService", 0xe86aa5fe)); provided.push_back(AZ_CRC("CapsuleShapeService", 0x9bc1122c)); - provided.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } void CapsuleShapeComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) { incompatible.push_back(AZ_CRC("ShapeService", 0xe86aa5fe)); incompatible.push_back(AZ_CRC("CapsuleShapeService", 0x9bc1122c)); - incompatible.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } void CapsuleShapeComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) diff --git a/Gems/LmbrCentral/Code/Source/Shape/DiskShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/DiskShapeComponent.cpp index 50cececd88..2d0673f299 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/DiskShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/DiskShapeComponent.cpp @@ -22,14 +22,12 @@ namespace LmbrCentral { provided.push_back(AZ_CRC("ShapeService", 0xe86aa5fe)); provided.push_back(AZ_CRC("DiskShapeService", 0xd90c482b)); - provided.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } void DiskShapeComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) { incompatible.push_back(AZ_CRC("ShapeService", 0xe86aa5fe)); incompatible.push_back(AZ_CRC("DiskShapeService", 0xd90c482b)); - incompatible.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } void DiskShapeComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) diff --git a/Gems/LmbrCentral/Code/Source/Shape/EditorCapsuleShapeComponent.h b/Gems/LmbrCentral/Code/Source/Shape/EditorCapsuleShapeComponent.h index 897c627a7e..6bb34b1b9e 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/EditorCapsuleShapeComponent.h +++ b/Gems/LmbrCentral/Code/Source/Shape/EditorCapsuleShapeComponent.h @@ -38,7 +38,6 @@ namespace LmbrCentral { EditorBaseShapeComponent::GetProvidedServices(provided); provided.push_back(AZ_CRC("CapsuleShapeService", 0x9bc1122c)); - provided.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } // EditorComponentBase diff --git a/Gems/LmbrCentral/Code/Source/Shape/EditorDiskShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/EditorDiskShapeComponent.cpp index a6c4d35a88..606a26ec52 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/EditorDiskShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/EditorDiskShapeComponent.cpp @@ -53,7 +53,6 @@ namespace LmbrCentral { EditorBaseShapeComponent::GetProvidedServices(provided); provided.push_back(AZ_CRC("DiskShapeService", 0xd90c482b)); - provided.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } void EditorDiskShapeComponent::Init() diff --git a/Gems/LmbrCentral/Code/Source/Shape/EditorPolygonPrismShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/EditorPolygonPrismShapeComponent.cpp index 1ffeeebc31..11fc04b1db 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/EditorPolygonPrismShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/EditorPolygonPrismShapeComponent.cpp @@ -32,7 +32,6 @@ namespace LmbrCentral provided.push_back(AZ_CRC("PolygonPrismShapeService", 0x1cbc4ed4)); provided.push_back(AZ_CRC("VariableVertexContainerService", 0x70c58740)); provided.push_back(AZ_CRC("FixedVertexContainerService", 0x83f1bbf2)); - provided.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } void EditorPolygonPrismShapeComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) @@ -40,7 +39,6 @@ namespace LmbrCentral EditorBaseShapeComponent::GetIncompatibleServices(incompatible); incompatible.push_back(AZ_CRC("VariableVertexContainerService", 0x70c58740)); incompatible.push_back(AZ_CRC("FixedVertexContainerService", 0x83f1bbf2)); - incompatible.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } void EditorPolygonPrismShapeComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent) diff --git a/Gems/LmbrCentral/Code/Source/Shape/EditorQuadShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/EditorQuadShapeComponent.cpp index 52835b68c2..e4732494bd 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/EditorQuadShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/EditorQuadShapeComponent.cpp @@ -53,7 +53,6 @@ namespace LmbrCentral { EditorBaseShapeComponent::GetProvidedServices(provided); provided.push_back(AZ_CRC("QuadShapeService", 0xe449b0fc)); - provided.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } void EditorQuadShapeComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent) diff --git a/Gems/LmbrCentral/Code/Source/Shape/EditorSphereShapeComponent.h b/Gems/LmbrCentral/Code/Source/Shape/EditorSphereShapeComponent.h index 294b21487c..f4a80d91ed 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/EditorSphereShapeComponent.h +++ b/Gems/LmbrCentral/Code/Source/Shape/EditorSphereShapeComponent.h @@ -42,7 +42,6 @@ namespace LmbrCentral { EditorBaseShapeComponent::GetProvidedServices(provided); provided.push_back(AZ_CRC("SphereShapeService", 0x90c8dc80)); - provided.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } private: diff --git a/Gems/LmbrCentral/Code/Source/Shape/QuadShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/QuadShapeComponent.cpp index 05b9c3c03d..653cf967f6 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/QuadShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/QuadShapeComponent.cpp @@ -22,14 +22,12 @@ namespace LmbrCentral { provided.push_back(AZ_CRC("ShapeService", 0xe86aa5fe)); provided.push_back(AZ_CRC("QuadShapeService", 0xe449b0fc)); - provided.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } void QuadShapeComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) { incompatible.push_back(AZ_CRC("ShapeService", 0xe86aa5fe)); incompatible.push_back(AZ_CRC("QuadShapeService", 0xe449b0fc)); - incompatible.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } void QuadShapeComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) diff --git a/Gems/LmbrCentral/Code/Source/Shape/SphereShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/SphereShapeComponent.cpp index 2f4c40cfed..3bddc9b695 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/SphereShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/SphereShapeComponent.cpp @@ -23,14 +23,12 @@ namespace LmbrCentral { provided.push_back(AZ_CRC("ShapeService", 0xe86aa5fe)); provided.push_back(AZ_CRC("SphereShapeService", 0x90c8dc80)); - provided.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } void SphereShapeComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) { incompatible.push_back(AZ_CRC("ShapeService", 0xe86aa5fe)); incompatible.push_back(AZ_CRC("SphereShapeService", 0x90c8dc80)); - incompatible.push_back(AZ_CRC("AreaLightShapeService", 0x68ea78dc)); } void SphereShapeComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) diff --git a/Gems/LyShine/Code/Editor/Animation/UiAVCustomizeTrackColorsDlg.cpp b/Gems/LyShine/Code/Editor/Animation/UiAVCustomizeTrackColorsDlg.cpp index 6c9090ab3d..13f4828da7 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAVCustomizeTrackColorsDlg.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAVCustomizeTrackColorsDlg.cpp @@ -28,7 +28,7 @@ #include "UiAVCustomizeTrackColorsDlg.h" #include "UiAnimViewDialog.h" -#include +#include #include #include diff --git a/Gems/LyShine/Code/Editor/Animation/UiAVEventsDialog.cpp b/Gems/LyShine/Code/Editor/Animation/UiAVEventsDialog.cpp index 10d7bf6887..1a26dd4744 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAVEventsDialog.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAVEventsDialog.cpp @@ -13,7 +13,7 @@ #include "UiCanvasEditor_precompiled.h" #include "UiAVEventsDialog.h" -#include +#include #include "UiAnimViewUndo.h" #include "StringDlg.h" #include "UiAnimViewSequence.h" diff --git a/Gems/LyShine/Code/Editor/Animation/UiAVSequenceProps.cpp b/Gems/LyShine/Code/Editor/Animation/UiAVSequenceProps.cpp index 9b33bec009..afafd5d332 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAVSequenceProps.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAVSequenceProps.cpp @@ -22,7 +22,7 @@ #include "Objects/BaseObject.h" #include "QtUtilWin.h" -#include +#include #include diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewCurveEditor.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewCurveEditor.cpp index 29d487693e..8c5b222c16 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewCurveEditor.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewCurveEditor.cpp @@ -21,7 +21,7 @@ #include "UiAnimViewTrack.h" #include "AnimationContext.h" -#include +#include #include #if defined(Q_OS_WIN) diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp index 65010cc0dd..7204102deb 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDialog.cpp @@ -1075,8 +1075,6 @@ void CUiAnimViewDialog::OnDelSequence() AZ_Error("UiAnimViewDialog", false, "Could not find sequence"); return; } - - UpdateActions(); } } @@ -1568,7 +1566,7 @@ void CUiAnimViewDialog::ReadMiscSettings() ////////////////////////////////////////////////////////////////////////// void CUiAnimViewDialog::SaveLayouts() { - QSettings settings("Amazon", "Lumberyard"); + QSettings settings("Amazon", "O3DE"); settings.beginGroup("UiAnimView"); QByteArray stateData = this->saveState(); settings.setValue("layout", stateData); @@ -1583,7 +1581,7 @@ void CUiAnimViewDialog::SaveLayouts() ////////////////////////////////////////////////////////////////////////// void CUiAnimViewDialog::ReadLayouts() { - QSettings settings("Amazon", "Lumberyard"); + QSettings settings("Amazon", "O3DE"); settings.beginGroup("UiAnimView"); if (settings.contains("layout")) { diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewFindDlg.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewFindDlg.cpp index 68503dcfbc..51e298605a 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewFindDlg.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewFindDlg.cpp @@ -23,7 +23,7 @@ #include -#include +#include ///////////////////////////////////////////////////////////////////////////// // CUiAnimViewFindDlg dialog diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewKeyPropertiesDlg.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewKeyPropertiesDlg.cpp index 726d920557..a202a4239d 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewKeyPropertiesDlg.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewKeyPropertiesDlg.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNewSequenceDialog.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNewSequenceDialog.cpp index 3eec74372c..18061701b8 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNewSequenceDialog.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNewSequenceDialog.cpp @@ -14,7 +14,7 @@ #include "UiCanvasEditor_precompiled.h" #include "UiAnimViewNewSequenceDialog.h" #include "Animation/UiAnimViewSequenceManager.h" -#include +#include #include #include "QtUtil.h" diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp index 2faf3a9a6f..c5d8c8c740 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp @@ -301,7 +301,7 @@ enum EMenuItem // The 'MI' represents a Menu Item. -#include +#include ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/LyShine/Code/Editor/EditorCommon.h b/Gems/LyShine/Code/Editor/EditorCommon.h index 42f77e8a08..2d2f08c3a7 100644 --- a/Gems/LyShine/Code/Editor/EditorCommon.h +++ b/Gems/LyShine/Code/Editor/EditorCommon.h @@ -166,10 +166,10 @@ enum class FusibleCommand // IMPORTANT: This is NOT the permanent location for these values. #define AZ_QCOREAPPLICATION_SETTINGS_ORGANIZATION_NAME "Amazon" -#define AZ_QCOREAPPLICATION_SETTINGS_APPLICATION_NAME "Lumberyard" +#define AZ_QCOREAPPLICATION_SETTINGS_APPLICATION_NAME "Open 3D Engine" // See: http://en.wikipedia.org/wiki/Internet_media_type#Prefix_x -#define UICANVASEDITOR_MIMETYPE "application/x-amazon-lumberyard-uicanvaseditor" +#define UICANVASEDITOR_MIMETYPE "application/x-amazon-o3de-uicanvaseditor" bool ClipboardContainsOurDataType(); diff --git a/Gems/LyShine/Code/Editor/LyShineEditorSystemComponent.cpp b/Gems/LyShine/Code/Editor/LyShineEditorSystemComponent.cpp index 13a77f7e53..c0e9b7aaac 100644 --- a/Gems/LyShine/Code/Editor/LyShineEditorSystemComponent.cpp +++ b/Gems/LyShine/Code/Editor/LyShineEditorSystemComponent.cpp @@ -165,7 +165,7 @@ namespace LyShineEditor { if (AZStd::wildcard_match("*.uicanvas", fullSourceFileName)) { - openers.push_back({ "Lumberyard_UICanvas_Editor", + openers.push_back({ "O3DE_UICanvas_Editor", "Open in UI Canvas Editor...", QIcon(), [](const char* fullSourceFileNameInCallback, const AZ::Uuid& /*sourceUUID*/) diff --git a/Gems/LyShine/Code/Source/Tests/internal/test_UiTextComponent.cpp b/Gems/LyShine/Code/Source/Tests/internal/test_UiTextComponent.cpp index bd0dfea301..082545ada2 100644 --- a/Gems/LyShine/Code/Source/Tests/internal/test_UiTextComponent.cpp +++ b/Gems/LyShine/Code/Source/Tests/internal/test_UiTextComponent.cpp @@ -138,7 +138,7 @@ namespace return fontFamily; } - //! \brief Verify fonts that ship with Lumberyard load correctly. + //! \brief Verify fonts that ship with Open 3D Engine load correctly. //! //! This test depends on the LyShineExamples and UiBasics gems being //! included in the project. diff --git a/Gems/LyShine/Code/Source/UiCanvasFileObject.cpp b/Gems/LyShine/Code/Source/UiCanvasFileObject.cpp index ca238c3ce9..bb93bf3597 100644 --- a/Gems/LyShine/Code/Source/UiCanvasFileObject.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasFileObject.cpp @@ -101,16 +101,6 @@ UiCanvasFileObject* UiCanvasFileObject::LoadCanvasFromStream(AZ::IO::GenericStre stream.GetFilename()); } } - else if (fileFormat == FileFormat::ReallyOld) - { - // We never shipped anything to customers using this ancient serialization format - // Canvas files saved on 12/3/2015 used the newer serialization format. - // R1 FC was 12/14/2015 - // So this message is only for internal Lumberyard users who may have a REALLY old - // canvas file lying around. - AZ_Warning("UI", false, "UI canvas file: %s is in an obsolete format, use an earlier lumberyard version (prior to v1.7) to open and resave it.", - stream.GetFilename()); - } else { // This does not look like an old format canvas file so treat it as new format diff --git a/Gems/Maestro/Code/Source/MaestroSystemComponent.cpp b/Gems/Maestro/Code/Source/MaestroSystemComponent.cpp index 17321f06f4..e300607fd7 100644 --- a/Gems/Maestro/Code/Source/MaestroSystemComponent.cpp +++ b/Gems/Maestro/Code/Source/MaestroSystemComponent.cpp @@ -57,7 +57,7 @@ namespace Maestro if (AZ::EditContext* ec = serialize->GetEditContext()) { - ec->Class("Maestro", "Provides the Lumberyard Cinematics Service") + ec->Class("Maestro", "Provides the Open 3D Engine Cinematics Service") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") // ->Attribute(AZ::Edit::Attributes::Category, "") Set a category ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b)) diff --git a/Gems/Multiplayer/Code/CMakeLists.txt b/Gems/Multiplayer/Code/CMakeLists.txt index f5bbbce8f2..dde5e387f6 100644 --- a/Gems/Multiplayer/Code/CMakeLists.txt +++ b/Gems/Multiplayer/Code/CMakeLists.txt @@ -21,8 +21,6 @@ ly_add_target( Source AZ::AzNetworking . - PUBLIC - Include BUILD_DEPENDENCIES PUBLIC AZ::AzCore @@ -51,8 +49,6 @@ ly_add_target( PRIVATE Source . - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE Gem::Multiplayer.Static diff --git a/Gems/Multiplayer/Code/Source/ReplicationWindows/ServerToClientReplicationWindow.cpp b/Gems/Multiplayer/Code/Source/ReplicationWindows/ServerToClientReplicationWindow.cpp index cfb1286496..a74001d647 100644 --- a/Gems/Multiplayer/Code/Source/ReplicationWindows/ServerToClientReplicationWindow.cpp +++ b/Gems/Multiplayer/Code/Source/ReplicationWindows/ServerToClientReplicationWindow.cpp @@ -133,7 +133,7 @@ namespace Multiplayer AZStd::vector gatheredEntries; AZ::Sphere awarenessSphere = AZ::Sphere(controlledEntityPosition, sv_ClientAwarenessRadius); - AZ::Interface::Get()->Enumerate(awarenessSphere, [&gatheredEntries](const AzFramework::IVisibilitySystem::NodeData& nodeData) + AZ::Interface::Get()->GetDefaultVisibilityScene()->Enumerate(awarenessSphere, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) { gatheredEntries.reserve(gatheredEntries.size() + nodeData.m_entries.size()); for (AzFramework::VisibilityEntry* visEntry : nodeData.m_entries) diff --git a/Gems/MultiplayerCompression/Code/CMakeLists.txt b/Gems/MultiplayerCompression/Code/CMakeLists.txt index 96761c3b1e..58ce546543 100644 --- a/Gems/MultiplayerCompression/Code/CMakeLists.txt +++ b/Gems/MultiplayerCompression/Code/CMakeLists.txt @@ -19,8 +19,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PUBLIC 3rdParty::lz4 @@ -36,8 +34,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE Gem::MultiplayerCompression.Static diff --git a/Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake b/Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake index 6afc02a90d..e6c7c23614 100644 --- a/Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake +++ b/Gems/NvCloth/Code/Platform/Windows/PAL_windows.cmake @@ -9,6 +9,4 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -ly_associate_package(PACKAGE_NAME NvCloth-1.1.6-rev1-multiplatform TARGETS NvCloth PACKAGE_HASH 05fc62634ca28644e7659a89e97f4520d791e6ddf4b66f010ac669e4e2ed4454) - set(PAL_TRAIT_NVCLOTH_USE_STUB FALSE) diff --git a/Gems/NvCloth/Code/Source/System/SystemComponent.cpp b/Gems/NvCloth/Code/Source/System/SystemComponent.cpp index 097b3bc885..b73622b883 100644 --- a/Gems/NvCloth/Code/Source/System/SystemComponent.cpp +++ b/Gems/NvCloth/Code/Source/System/SystemComponent.cpp @@ -51,7 +51,7 @@ namespace NvCloth } }; - // Implementation of the error callback interface directing nvcloth library errors to Lumberyard error output. + // Implementation of the error callback interface directing nvcloth library errors to Open 3D Engine error output. class AzClothErrorCallback : public physx::PxErrorCallback { @@ -91,7 +91,7 @@ namespace NvCloth physx::PxErrorCode::Enum m_lastError = physx::PxErrorCode::eNO_ERROR; }; - // Implementation of the assert handler interface directing nvcloth asserts to Lumberyard assertion system. + // Implementation of the assert handler interface directing nvcloth asserts to Open 3D Engine assertion system. class AzClothAssertHandler : public nv::cloth::PxAssertHandler { diff --git a/Gems/PhysX/Code/CMakeLists.txt b/Gems/PhysX/Code/CMakeLists.txt index e9a60ab903..ac5fd902c2 100644 --- a/Gems/PhysX/Code/CMakeLists.txt +++ b/Gems/PhysX/Code/CMakeLists.txt @@ -71,9 +71,6 @@ ly_add_target( if(PAL_TRAIT_BUILD_HOST_TOOLS) - ly_associate_package(PACKAGE_NAME poly2tri-0.3.3-rev2-multiplatform TARGETS poly2tri PACKAGE_HASH 04092d06716f59b936b61906eaf3647db23b685d81d8b66131eb53e0aeaa1a38) - ly_associate_package(PACKAGE_NAME v-hacd-2.0-rev1-multiplatform TARGETS v-hacd PACKAGE_HASH 5c71aef19cc9787d018d64eec076e9f51ea5a3e0dc6b6e22e57c898f6cc4afe3) - ly_add_target( NAME PhysX.Editor.Static STATIC NAMESPACE Gem diff --git a/Gems/PhysX/Code/Source/System/PhysXAllocator.h b/Gems/PhysX/Code/Source/System/PhysXAllocator.h index 832b113acc..5a18c93069 100644 --- a/Gems/PhysX/Code/Source/System/PhysXAllocator.h +++ b/Gems/PhysX/Code/Source/System/PhysXAllocator.h @@ -31,7 +31,7 @@ namespace PhysX const char* GetDescription() const override { return "PhysX general memory allocator"; } }; - //! Implementation of the PhysX memory allocation callback interface using Lumberyard allocator. + //! Implementation of the PhysX memory allocation callback interface using Open 3D Engine allocator. class PxAzAllocatorCallback : public physx::PxAllocatorCallback { diff --git a/Gems/PhysX/Code/Source/System/PhysXCpuDispatcher.h b/Gems/PhysX/Code/Source/System/PhysXCpuDispatcher.h index 2505eaeba5..df94f094ab 100644 --- a/Gems/PhysX/Code/Source/System/PhysXCpuDispatcher.h +++ b/Gems/PhysX/Code/Source/System/PhysXCpuDispatcher.h @@ -16,7 +16,7 @@ namespace PhysX { - //! CPU dispatcher which directs tasks submitted by PhysX to the Lumberyard scheduling system. + //! CPU dispatcher which directs tasks submitted by PhysX to the Open 3D Engine scheduling system. class PhysXCpuDispatcher : public physx::PxCpuDispatcher { @@ -32,6 +32,6 @@ namespace PhysX physx::PxU32 getWorkerCount() const override; }; - //! Creates a CPU dispatcher which directs tasks submitted by PhysX to the Lumberyard scheduling system. + //! Creates a CPU dispatcher which directs tasks submitted by PhysX to the Open 3D Engine scheduling system. PhysXCpuDispatcher* PhysXCpuDispatcherCreate(); } // namespace PhysX diff --git a/Gems/PhysX/Code/Source/System/PhysXJob.h b/Gems/PhysX/Code/Source/System/PhysXJob.h index 244cb9b92a..ad388bb12d 100644 --- a/Gems/PhysX/Code/Source/System/PhysXJob.h +++ b/Gems/PhysX/Code/Source/System/PhysXJob.h @@ -17,7 +17,7 @@ namespace PhysX { - //! Handles PhysX tasks in the Lumberyard job scheduler. + //! Handles PhysX tasks in the Open 3D Engine job scheduler. class PhysXJob : public AZ::Job { diff --git a/Gems/PhysX/Code/Source/System/PhysXSdkCallbacks.h b/Gems/PhysX/Code/Source/System/PhysXSdkCallbacks.h index 8b2d47ec4a..c8993e9b52 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSdkCallbacks.h +++ b/Gems/PhysX/Code/Source/System/PhysXSdkCallbacks.h @@ -15,7 +15,7 @@ namespace PhysX { - //! Implementation of the PhysX error callback interface directing errors to Lumberyard error output. + //! Implementation of the PhysX error callback interface directing errors to Open 3D Engine error output. class PxAzErrorCallback : public physx::PxErrorCallback { diff --git a/Gems/PhysX/Code/Source/SystemComponent.h b/Gems/PhysX/Code/Source/SystemComponent.h index 668f12e0c0..c074a2032d 100644 --- a/Gems/PhysX/Code/Source/SystemComponent.h +++ b/Gems/PhysX/Code/Source/SystemComponent.h @@ -53,7 +53,7 @@ namespace PhysX /// System component for PhysX. /// The system component handles underlying tasks such as initialization and shutdown of PhysX, managing a - /// Lumberyard memory allocator for PhysX allocations, scheduling for PhysX jobs, and connections to the PhysX + /// Open 3D Engine memory allocator for PhysX allocations, scheduling for PhysX jobs, and connections to the PhysX /// Visual Debugger. It also owns fundamental PhysX objects which manage worlds, rigid bodies, shapes, materials, /// constraints etc., and perform cooking (processing assets such as meshes and heightfields ready for use in PhysX). class SystemComponent diff --git a/Gems/PhysXDebug/Code/Source/SystemComponent.h b/Gems/PhysXDebug/Code/Source/SystemComponent.h index 453a80e109..66f546c661 100644 --- a/Gems/PhysXDebug/Code/Source/SystemComponent.h +++ b/Gems/PhysXDebug/Code/Source/SystemComponent.h @@ -161,7 +161,7 @@ namespace PhysXDebug /// Initialise the PhysX debug draw colors based on defaults. void InitPhysXColorMappings(); - /// Register debug drawing PhysX commands with Lumberyard console during game mode. + /// Register debug drawing PhysX commands with Open 3D Engine console during game mode. void RegisterCommands(); /// Draw the culling box being used by the viewport. diff --git a/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp b/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp index fffe6ddfd5..2bb0d8aaf3 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp +++ b/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp @@ -185,10 +185,13 @@ namespace UnitTest // shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash // in the unit tests. AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize); + + AZ::Data::AssetManager::Instance().RegisterHandler(&m_assetHandler, azrtti_typeid()); } void PrefabBuilderTests::TearDown() { + AZ::Data::AssetManager::Instance().UnregisterHandler(&m_assetHandler); m_testComponentDescriptor = nullptr; m_app.Stop(); diff --git a/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.h b/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.h index 0873ddfd6a..4a174dad5b 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.h +++ b/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.h @@ -15,13 +15,14 @@ #include #include #include +#include #include namespace UnitTest { - struct VersionChangingData : AZ::Data::AssetData + struct VersionChangingData final : AZ::Data::AssetData { - AZ_TYPE_INFO(VersionChangingData, "{E3A37E19-AE61-4C2F-809E-03B4D83261E8}"); + AZ_RTTI(VersionChangingData, "{E3A37E19-AE61-4C2F-809E-03B4D83261E8}", AZ::Data::AssetData); static void Reflect(AZ::ReflectContext* context) { @@ -34,9 +35,9 @@ namespace UnitTest inline static int m_version = 0; }; - struct TestAsset : AZ::Data::AssetData + struct TestAsset final : AZ::Data::AssetData { - AZ_TYPE_INFO(TestAsset, "{8E736462-5424-4720-A2D9-F71DFC5905E3}"); + AZ_RTTI(TestAsset, "{8E736462-5424-4720-A2D9-F71DFC5905E3}", AZ::Data::AssetData); static void Reflect(AZ::ReflectContext* context) { @@ -47,7 +48,35 @@ namespace UnitTest } }; - struct TestComponent : AZ::Component + struct TestAssetHandler final : AZ::Data::AssetHandler + { + public: + AZ::Data::AssetPtr CreateAsset( + [[maybe_unused]] const AZ::Data::AssetId& id, [[maybe_unused]] const AZ::Data::AssetType& type) override + { + return aznew TestAsset(); + } + + void DestroyAsset(AZ::Data::AssetPtr ptr) override + { + delete ptr; + } + + void GetHandledAssetTypes(AZStd::vector& assetTypes) override + { + assetTypes.push_back(azrtti_typeid()); + } + + AZ::Data::AssetHandler::LoadResult LoadAssetData( + [[maybe_unused]] const AZ::Data::Asset& asset, + [[maybe_unused]] AZStd::shared_ptr stream, + [[maybe_unused]] const AZ::Data::AssetFilterCB& assetLoadFilterCB) override + { + return AZ::Data::AssetHandler::LoadResult::LoadComplete; + } + }; + + struct TestComponent final : AZ::Component { AZ_COMPONENT(TestComponent, "{E3982C6A-0B01-4B04-A3E2-D95729D4B9C6}"); @@ -81,7 +110,7 @@ namespace UnitTest AZStd::vector m_bufferData; }; - struct TestPrefabBuilderComponent : AZ::Prefab::PrefabBuilderComponent + struct TestPrefabBuilderComponent final : AZ::Prefab::PrefabBuilderComponent { protected: AZStd::unique_ptr GetOutputStream(const AZ::IO::Path& path) const override; @@ -95,5 +124,6 @@ namespace UnitTest AzToolsFramework::ToolsApplication m_app; AZStd::unique_ptr m_testComponentDescriptor{}; + TestAssetHandler m_assetHandler; }; } diff --git a/Gems/PythonAssetBuilder/Code/Include/PythonAssetBuilder/PythonBuilderRequestBus.h b/Gems/PythonAssetBuilder/Code/Include/PythonAssetBuilder/PythonBuilderRequestBus.h index 2eeca4ffc8..4cf55a00a4 100644 --- a/Gems/PythonAssetBuilder/Code/Include/PythonAssetBuilder/PythonBuilderRequestBus.h +++ b/Gems/PythonAssetBuilder/Code/Include/PythonAssetBuilder/PythonBuilderRequestBus.h @@ -17,7 +17,7 @@ namespace PythonAssetBuilder { - //! A request bus to help produce Lumberyard asset data + //! A request bus to help produce Open 3D Engine asset data class PythonBuilderRequests : public AZ::EBusTraits { diff --git a/Gems/QtForPython/Code/Include/QtForPython/QtForPythonBus.h b/Gems/QtForPython/Code/Include/QtForPython/QtForPythonBus.h index 23142d38c5..32c8318fa2 100644 --- a/Gems/QtForPython/Code/Include/QtForPython/QtForPythonBus.h +++ b/Gems/QtForPython/Code/Include/QtForPython/QtForPythonBus.h @@ -30,7 +30,7 @@ namespace QtForPython //! The path of the Qt plugins such as /qtlibs/plugins AZStd::string m_qtPluginsFolder; - //! The 'winId' of the main Qt window in the Lumberyard editor + //! The 'winId' of the main Qt window in the Open 3D Engine editor AZ::u64 m_mainWindowId; }; diff --git a/Gems/SaveData/Code/Tests/SaveDataTest.cpp b/Gems/SaveData/Code/Tests/SaveDataTest.cpp index 422faa7a8e..65029c522e 100644 --- a/Gems/SaveData/Code/Tests/SaveDataTest.cpp +++ b/Gems/SaveData/Code/Tests/SaveDataTest.cpp @@ -90,7 +90,7 @@ char testSaveData[testSaveDataSize] = {'a', 'b', 'c', '1', '2', '3', 'x', 'y', ' AZStd::string GetTestSaveDataCustomDirectoryNameRelative() { - return "Amazon/Lumberyard/SaveDataTest"; + return "Amazon/O3DE/SaveDataTest"; } #if defined(AZ_PLATFORM_WINDOWS) diff --git a/Gems/SceneLoggingExample/Code/CMakeLists.txt b/Gems/SceneLoggingExample/Code/CMakeLists.txt index 56e0fdaa6a..8cd012c4c2 100644 --- a/Gems/SceneLoggingExample/Code/CMakeLists.txt +++ b/Gems/SceneLoggingExample/Code/CMakeLists.txt @@ -21,8 +21,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE . - PUBLIC - Include BUILD_DEPENDENCIES PUBLIC AZ::AzCore @@ -38,8 +36,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE . - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE Gem::SceneLoggingExample.Static diff --git a/Gems/SceneLoggingExample/ReadMe.txt b/Gems/SceneLoggingExample/ReadMe.txt index 40c3d6c043..f7c398c78d 100644 --- a/Gems/SceneLoggingExample/ReadMe.txt +++ b/Gems/SceneLoggingExample/ReadMe.txt @@ -1,12 +1,12 @@ The Scene Logging Example demonstrates how to extend the SceneAPI by adding additional logging to the pipeline. The SceneAPI is -a collection of libraries that handle loading scene files and converting content to data that the Lumberyard engine and editor can load. +a collection of libraries that handle loading scene files and converting content to data that the Open 3D Engine and its editor can load. The following approach is used: 1. The FbxSceneBuilder and SceneData load and convert the scene file (for example, .fbx) into a graph that is stored in memory. 2. SceneCore and SceneData are used to create a manifest with instructions about how to export the file. 3. SceneData analyzes the manifest and memory graph and creates defaults. 4. Scene Settings allows updates to the manifest through a UI. - 5. The ResourceCompilerScene uses the instructions from the manifest and the data in the graph to create assets. These assets are ready for Lumberyard to use. + 5. The ResourceCompilerScene uses the instructions from the manifest and the data in the graph to create assets. These assets are ready for Open 3D Engine to use. The example gem demonstrates the following key features: - Initialization of the SceneAPI libraries. diff --git a/Gems/SceneProcessing/Code/Source/Config/Components/SceneProcessingConfigSystemComponent.cpp b/Gems/SceneProcessing/Code/Source/Config/Components/SceneProcessingConfigSystemComponent.cpp index 2521161605..bb39ea15df 100644 --- a/Gems/SceneProcessing/Code/Source/Config/Components/SceneProcessingConfigSystemComponent.cpp +++ b/Gems/SceneProcessing/Code/Source/Config/Components/SceneProcessingConfigSystemComponent.cpp @@ -171,7 +171,7 @@ namespace AZ "Soft naming conventions", "Update the naming conventions to suit your project.") ->Attribute(AZ::Edit::Attributes::AutoExpand, false) ->DataElement(AZ::Edit::UIHandlers::Default, &SceneProcessingConfigSystemComponent::m_UseCustomNormals, - "Use Custom Normals", "When enabled, Lumberyard will use the DCC assets custom or tangent space normals. When disabled, the normals will be averaged. This setting can be overridden on individual FBX asset settings.") + "Use Custom Normals", "When enabled, Open 3D Engine will use the DCC assets custom or tangent space normals. When disabled, the normals will be averaged. This setting can be overridden on individual FBX asset settings.") ->Attribute(AZ::Edit::Attributes::AutoExpand, false); } } diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index eab22ba14f..b14fd7d4c2 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -110,12 +110,12 @@ namespace ScriptCanvasEditor { static const char* GetMimeType() { - return "application/x-lumberyard-scriptcanvas"; + return "application/x-o3de-scriptcanvas"; } static const char* GetWrappedNodeGroupingMimeType() { - return "application/x-lumberyard-scriptcanvas-wrappednodegrouping"; + return "application/x-03de-scriptcanvas-wrappednodegrouping"; } } @@ -1884,7 +1884,7 @@ namespace ScriptCanvasEditor AZStd::any* userData = nullptr; GraphCanvas::NodeRequestBus::EventResult(userData, nodeId, &GraphCanvas::NodeRequests::GetUserData); AZ::EntityId scSourceNodeId = (userData && userData->is()) ? *AZStd::any_cast(userData) : AZ::EntityId(); - + ScriptCanvas::Nodes::Core::FunctionDefinitionNode* nodeling = azrtti_cast(FindNode(scSourceNodeId)); if (nodeling) diff --git a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp index c7125abbc0..7052ab488f 100644 --- a/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp +++ b/Gems/ScriptCanvas/Code/Editor/SystemComponent.cpp @@ -360,7 +360,7 @@ namespace ScriptCanvasEditor } }; - openers.push_back({ "Lumberyard_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(), scriptCanvasEditorCallback }); + openers.push_back({ "O3DE_ScriptCanvasEditor", "Open In Script Canvas Editor...", QIcon(), scriptCanvasEditorCallback }); } } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.h b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.h index cd7a8965fb..a094e4b477 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.h +++ b/Gems/ScriptCanvas/Code/Editor/View/Widgets/VariablePanel/GraphVariablesTableView.h @@ -56,7 +56,7 @@ namespace ScriptCanvasEditor VarIdRole = Qt::UserRole }; - static const char* GetMimeType() { return "lumberyard/x-scriptcanvas-varpanel"; } + static const char* GetMimeType() { return "o3de/x-scriptcanvas-varpanel"; } AZ_CLASS_ALLOCATOR(GraphVariablesModel, AZ::SystemAllocator, 0); GraphVariablesModel(QObject* parent = nullptr); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Utils/NodeUtils.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Utils/NodeUtils.cpp index 06ad79c21d..c1eb2eed36 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Utils/NodeUtils.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Utils/NodeUtils.cpp @@ -81,8 +81,6 @@ namespace ScriptCanvas { return ConstructCustomNodeIdentifier(scriptCanvasNode->RTTI_GetType()); } - - return NodeTypeIdentifier(0); } NodeTypeIdentifier NodeUtils::ConstructEBusIdentifier(ScriptCanvas::EBusBusId ebusIdentifier) diff --git a/Gems/ScriptCanvasTesting/Code/CMakeLists.txt b/Gems/ScriptCanvasTesting/Code/CMakeLists.txt index cba3991111..639ef114fc 100644 --- a/Gems/ScriptCanvasTesting/Code/CMakeLists.txt +++ b/Gems/ScriptCanvasTesting/Code/CMakeLists.txt @@ -23,8 +23,6 @@ ly_add_target( PRIVATE Source . - PUBLIC - Include COMPILE_DEFINITIONS PRIVATE SCRIPTCANVAS_EDITOR diff --git a/Gems/TestAssetBuilder/Code/CMakeLists.txt b/Gems/TestAssetBuilder/Code/CMakeLists.txt index 1106ebf477..dbd2907033 100644 --- a/Gems/TestAssetBuilder/Code/CMakeLists.txt +++ b/Gems/TestAssetBuilder/Code/CMakeLists.txt @@ -21,8 +21,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PUBLIC AZ::AzCore @@ -38,8 +36,6 @@ ly_add_target( INCLUDE_DIRECTORIES PRIVATE Source - PUBLIC - Include BUILD_DEPENDENCIES PRIVATE Gem::TestAssetBuilder.Static diff --git a/Gems/Twitch/Code/Source/TwitchReflection.cpp b/Gems/Twitch/Code/Source/TwitchReflection.cpp index 91043426cf..d682e37519 100644 --- a/Gems/Twitch/Code/Source/TwitchReflection.cpp +++ b/Gems/Twitch/Code/Source/TwitchReflection.cpp @@ -114,8 +114,8 @@ namespace Twitch " Notifications:" + UserNotificationsToString(info.Notifications) + " CreatedDate:" + info.CreatedDate + " UpdatedDate:" + info.UpdatedDate + - " EMailVerified:" + BoolName(info.EMailVerified, "Yes", "No"); - " Partnered:" + BoolName(info.Partnered, "Yes", "No"); + " EMailVerified:" + BoolName(info.EMailVerified, "Yes", "No") + + " Partnered:" + BoolName(info.Partnered, "Yes", "No") + " TwitterConnected:" + BoolName(info.TwitterConnected, "Yes", "No"); } @@ -164,404 +164,404 @@ namespace Twitch } AZStd::string FriendInfoToString(const FriendInfo & info) - { - return UserInfoIDToString(info.User) + - " CreatedDate:" + info.CreatedDate; - } - - AZStd::string FriendListToString(const FriendList & info) - { - AZStd::string strList; - - for (const auto & i : info) - { - if (!strList.empty()) - { - strList += ","; - } - - strList += "{"; - strList += FriendInfoToString(i); - strList += "}"; - } - - return strList; - } - - AZStd::string FriendRequestToString(const FriendRequest & info) - { - return UserInfoIDToString(info.User) + - " IsRecommended:" + BoolName(info.IsRecommended, "Yes", "No") + - " IsStranger:" + BoolName(info.IsStranger, "Yes", "No") + - " NonStrangerReason:" + info.NonStrangerReason + - " RequestedDate:" + info.RequestedDate; - } - - AZStd::string FriendRequestListToString(const FriendRequestList & info) - { - AZStd::string strList; - - for (const auto & i : info) - { - if (!strList.empty()) - { - strList += ","; - } - - strList += "{"; - strList += FriendRequestToString(i); - strList += "}"; - } - - return strList; - } - - AZStd::string PresenceStatusToString(const PresenceStatus & info) - { - return "UserID:" + info.UserID + - " Index:" + AZStd::string::format("%lld", info.Index) + - " UpdatedDate:" + AZStd::string::format("%lld", info.UpdatedDate) + - " ActivityType:" + PresenceActivityTypeToString(info.ActivityType) + - " Availability:" + PresenceAvailabilityToString(info.Availability); - } - - AZStd::string PresenceStatusListToString(const PresenceStatusList & info) - { - AZStd::string strList; - - for (const auto & i : info) - { - if (!strList.empty()) - { - strList += ","; - } - - strList += "{"; - strList += PresenceStatusToString(i); - strList += "}"; - } - - return strList; - } - - AZStd::string PresenceSettingsToString(const PresenceSettings & info) - { - return "IsInvisible:" + BoolName(info.IsInvisible, "Yes", "No") + - " ShareActivity:" + BoolName(info.ShareActivity, "Shared", "None"); - } - - AZStd::string ChannelInfoToString(const ChannelInfo & info) - { - return "Followers:" + AZStd::string::format("%llu", info.NumFollowers) + - "Views:" + AZStd::string::format("%llu", info.NumViews) + - "ItemsRecieved:" + AZStd::string::format("%llu", info.NumItemsRecieved) + - "Partner:" + BoolName(info.Partner, "Yes", "No") + - "Mature:" + BoolName(info.Mature, "Yes", "No") + - "Id:" + info.Id + - "BroadcasterLanguage:" + info.BroadcasterLanguage + - "DisplayName:" + info.DisplayName + - "eMail:" + info.eMail + - "GameName:" + info.GameName + - "Language:" + info.Lanugage + - "Logo:" + info.Logo + - "Name:" + info.Name + - "ProfileBanner:" + info.ProfileBanner + - "ProfileBannerBackgroundColor:" + info.ProfileBannerBackgroundColor + - "Status:" + info.Status + - "StreamKey:" + info.StreamKey + - "UpdatedDate:" + info.UpdatedDate + - "CreatedDate:" + info.CreatedDate + - "URL:" + info.URL + - "VideoBanner:" + info.VideoBanner; - } - - AZStd::string FollowerToString(const Follower& info) - { - return UserInfoIDToString(info.User) + - " CreatedDate:" + info.CreatedDate + - " Notifications:" + BoolName(info.Notifications, "On", "Off"); - } - - AZStd::string FollowerListToString(const FollowerList & info) - { - AZStd::string strList; - - for (const auto & i : info) - { - if (!strList.empty()) - { - strList += ","; - } - - strList += "{"; - strList += FollowerToString(i); - strList += "}"; - } - - return strList; - } - - AZStd::string TeamInfoToString(const TeamInfo& info) - { - return "ID:" + info.ID + - " Background:" + info.Background + - " Banner:" + info.Banner + - " CreatedDate:" + info.CreatedDate + - " DisplayName:" + info.DisplayName + - " Info:" + info.Info + - " Logo:" + info.Logo + - " Name:" + info.Name + - " UpdatedDate:" + info.UpdatedDate; - } - - AZStd::string TeamInfoListToString(const TeamInfoList& info) - { - AZStd::string strList; - - for (const auto & i : info) - { - if (!strList.empty()) - { - strList += ","; - } - - strList += "{"; - strList += TeamInfoToString(i); - strList += "}"; - } - - return strList; - } - - AZStd::string SubscriberInfoToString(const SubscriberInfo& info) - { - return "ID:" + info.ID + - " CreatedDate:" + info.CreatedDate + - UserInfoIDToString(info.User); - } - - AZStd::string SubscriberInfoListToString(const SubscriberInfoList& info) - { - AZStd::string strList; - - for (const auto & i : info) - { - if (!strList.empty()) - { - strList += ","; - } - - strList += "{"; - strList += SubscriberInfoToString(i); - strList += "}"; - } - - return strList; - } - - AZStd::string VideoInfoShortToString(const VideoInfo& info) - { - return "ID:" + info.ID; - } - - AZStd::string VideoInfoListToString(const VideoInfoList& info) - { - AZStd::string strList; - - for (const auto & i : info) - { - if (!strList.empty()) - { - strList += ","; - } - - strList += "{"; - strList += VideoInfoShortToString(i); - strList += "}"; - } - - return strList; - } - - AZStd::string StartChannelCommercialResultToString(const StartChannelCommercialResult& info) - { - return "Duration:" + AZStd::string::format("%llu", info.Duration) + - " RetryAfter:" + AZStd::string::format("%llu", info.RetryAfter) + - " Message:" + info.Message; - } - - AZStd::string CommunityInfoToString(const CommunityInfo& info) - { - return "ID:" + info.ID + - " AvatarImageURL:" + info.AvatarImageURL + - " CoverImageURL:" + info.CoverImageURL + - " Description:" + info.Description + - " DescriptionHTML:" + info.DescriptionHTML + - " Language:" + info.Language + - " Name:" + info.Name + - " OwnerID:" + info.OwnerID + - " Rules:" + info.Rules + - " RulesHTML:" + info.RulesHTML + - " Summary:" + info.Summary; - } - - AZStd::string CommunityInfoListToString(const CommunityInfoList& info) - { - AZStd::string strList; - - for (const auto & i : info) - { - if (!strList.empty()) - { - strList += ","; - } - - strList += "{"; - strList += CommunityInfoToString(i); - strList += "}"; - } - - return strList; - } - - AZStd::string ReturnValueToString(const ReturnValue& info) - { - return "ReceiptID:" + AZStd::string::format("%llu", info.GetID()) + - " Result: " + ResultCodeToString(info.Result); - } - - AZStd::string Int64Value::ToString() const - { - return ReturnValueToString(*this) + - AZStd::string::format(" Int64:%lld", Value); - } - - AZStd::string Uint64Value::ToString() const - { - return ReturnValueToString(*this) + - AZStd::string::format(" Uint64:%llu", Value); - } - - AZStd::string StringValue::ToString() const - { - return ReturnValueToString(*this) + - " String:" + "\"" + Value + "\""; - } - - AZStd::string UserInfoValue::ToString() const - { - return ReturnValueToString(*this) + - UserInfoToString(Value); - } - - AZStd::string FriendRecommendationValue::ToString() const - { - return ReturnValueToString(*this) + - " ListSize:" + AZStd::string::format("%llu-", static_cast(Value.size())) + - " Recommendations:" + FriendRecommendationsToString(Value); - } - - AZStd::string GetFriendValue::ToString() const - { - return ReturnValueToString(*this) + - " ListSize:" + AZStd::string::format("%llu-", static_cast(Value.Friends.size())) + - " Cursor:" + Value.Cursor + - " Friends:" + FriendListToString(Value.Friends); - } - - AZStd::string FriendStatusValue::ToString() const - { - return ReturnValueToString(*this) + - " Status:" + Value.Status + - UserInfoToString(Value.User); - } - - AZStd::string FriendRequestValue::ToString() const - { - return ReturnValueToString(*this) + - " Total:" + AZStd::string::format("%llu", Value.Total) + - " Cursor:" + Value.Cursor + - " Requests:" + FriendRequestListToString(Value.Requests); - } - - AZStd::string PresenceStatusValue::ToString() const - { - return ReturnValueToString(*this) + - " Total:" + AZStd::string::format("%llu", static_cast(Value.size())) + - " StatusList:" + PresenceStatusListToString(Value); - } - - AZStd::string PresenceSettingsValue::ToString() const - { - return ReturnValueToString(*this) + - " " + PresenceSettingsToString(Value); - } - - AZStd::string ChannelInfoValue::ToString() const - { - return ReturnValueToString(*this) + - " " + ChannelInfoToString(Value); - } - - AZStd::string UserInfoListValue::ToString() const - { - return ReturnValueToString(*this) + - " Total:" + AZStd::string::format("%llu", static_cast(Value.size())) + - " Users:" + UserInfoListToString(Value); - } - - AZStd::string FollowerResultValue::ToString() const - { - return ReturnValueToString(*this) + - " Total:" + AZStd::string::format("%llu", Value.Total) + - " Cursor:" + Value.Cursor + - " Followers:" + FollowerListToString(Value.Followers); - } - - AZStd::string ChannelTeamValue::ToString() const - { - return ReturnValueToString(*this) + - " Total:" + AZStd::string::format("%llu", static_cast(Value.size())) + - " Teams:" + TeamInfoListToString(Value); - } - - AZStd::string SubscriberValue::ToString() const - { - return ReturnValueToString(*this) + - " Total:" + AZStd::string::format("%llu", Value.Total) + - " Subscribers:" + SubscriberInfoListToString(Value.Subscribers); - } - - AZStd::string SubscriberbyUserValue::ToString() const - { - return ReturnValueToString(*this) + - " SubscriberInfo:" + SubscriberInfoToString(Value); - } - - AZStd::string VideoReturnValue::ToString() const - { - return ReturnValueToString(*this) + - " Total:" + AZStd::string::format("%llu", Value.Total) + - " Videos:" + VideoInfoListToString(Value.Videos); - } - - AZStd::string StartChannelCommercialValue::ToString() const - { - return ReturnValueToString(*this) + - " " + StartChannelCommercialResultToString(Value); - } - - AZStd::string CommunityInfoValue::ToString() const - { - return ReturnValueToString(*this) + - " " + CommunityInfoToString(Value); - } - - AZStd::string CommunityInfoReturnValue::ToString() const - { - return ReturnValueToString(*this) + - " Total:" + AZStd::string::format("%llu", Value.Total) + - " Communities:" + CommunityInfoListToString(Value.Communities); + { + return UserInfoIDToString(info.User) + + " CreatedDate:" + info.CreatedDate; + } + + AZStd::string FriendListToString(const FriendList & info) + { + AZStd::string strList; + + for (const auto & i : info) + { + if (!strList.empty()) + { + strList += ","; + } + + strList += "{"; + strList += FriendInfoToString(i); + strList += "}"; + } + + return strList; + } + + AZStd::string FriendRequestToString(const FriendRequest & info) + { + return UserInfoIDToString(info.User) + + " IsRecommended:" + BoolName(info.IsRecommended, "Yes", "No") + + " IsStranger:" + BoolName(info.IsStranger, "Yes", "No") + + " NonStrangerReason:" + info.NonStrangerReason + + " RequestedDate:" + info.RequestedDate; + } + + AZStd::string FriendRequestListToString(const FriendRequestList & info) + { + AZStd::string strList; + + for (const auto & i : info) + { + if (!strList.empty()) + { + strList += ","; + } + + strList += "{"; + strList += FriendRequestToString(i); + strList += "}"; + } + + return strList; + } + + AZStd::string PresenceStatusToString(const PresenceStatus & info) + { + return "UserID:" + info.UserID + + " Index:" + AZStd::string::format("%lld", info.Index) + + " UpdatedDate:" + AZStd::string::format("%lld", info.UpdatedDate) + + " ActivityType:" + PresenceActivityTypeToString(info.ActivityType) + + " Availability:" + PresenceAvailabilityToString(info.Availability); + } + + AZStd::string PresenceStatusListToString(const PresenceStatusList & info) + { + AZStd::string strList; + + for (const auto & i : info) + { + if (!strList.empty()) + { + strList += ","; + } + + strList += "{"; + strList += PresenceStatusToString(i); + strList += "}"; + } + + return strList; + } + + AZStd::string PresenceSettingsToString(const PresenceSettings & info) + { + return "IsInvisible:" + BoolName(info.IsInvisible, "Yes", "No") + + " ShareActivity:" + BoolName(info.ShareActivity, "Shared", "None"); + } + + AZStd::string ChannelInfoToString(const ChannelInfo & info) + { + return "Followers:" + AZStd::string::format("%llu", info.NumFollowers) + + "Views:" + AZStd::string::format("%llu", info.NumViews) + + "ItemsRecieved:" + AZStd::string::format("%llu", info.NumItemsRecieved) + + "Partner:" + BoolName(info.Partner, "Yes", "No") + + "Mature:" + BoolName(info.Mature, "Yes", "No") + + "Id:" + info.Id + + "BroadcasterLanguage:" + info.BroadcasterLanguage + + "DisplayName:" + info.DisplayName + + "eMail:" + info.eMail + + "GameName:" + info.GameName + + "Language:" + info.Lanugage + + "Logo:" + info.Logo + + "Name:" + info.Name + + "ProfileBanner:" + info.ProfileBanner + + "ProfileBannerBackgroundColor:" + info.ProfileBannerBackgroundColor + + "Status:" + info.Status + + "StreamKey:" + info.StreamKey + + "UpdatedDate:" + info.UpdatedDate + + "CreatedDate:" + info.CreatedDate + + "URL:" + info.URL + + "VideoBanner:" + info.VideoBanner; + } + + AZStd::string FollowerToString(const Follower& info) + { + return UserInfoIDToString(info.User) + + " CreatedDate:" + info.CreatedDate + + " Notifications:" + BoolName(info.Notifications, "On", "Off"); + } + + AZStd::string FollowerListToString(const FollowerList & info) + { + AZStd::string strList; + + for (const auto & i : info) + { + if (!strList.empty()) + { + strList += ","; + } + + strList += "{"; + strList += FollowerToString(i); + strList += "}"; + } + + return strList; + } + + AZStd::string TeamInfoToString(const TeamInfo& info) + { + return "ID:" + info.ID + + " Background:" + info.Background + + " Banner:" + info.Banner + + " CreatedDate:" + info.CreatedDate + + " DisplayName:" + info.DisplayName + + " Info:" + info.Info + + " Logo:" + info.Logo + + " Name:" + info.Name + + " UpdatedDate:" + info.UpdatedDate; + } + + AZStd::string TeamInfoListToString(const TeamInfoList& info) + { + AZStd::string strList; + + for (const auto & i : info) + { + if (!strList.empty()) + { + strList += ","; + } + + strList += "{"; + strList += TeamInfoToString(i); + strList += "}"; + } + + return strList; + } + + AZStd::string SubscriberInfoToString(const SubscriberInfo& info) + { + return "ID:" + info.ID + + " CreatedDate:" + info.CreatedDate + + UserInfoIDToString(info.User); + } + + AZStd::string SubscriberInfoListToString(const SubscriberInfoList& info) + { + AZStd::string strList; + + for (const auto & i : info) + { + if (!strList.empty()) + { + strList += ","; + } + + strList += "{"; + strList += SubscriberInfoToString(i); + strList += "}"; + } + + return strList; + } + + AZStd::string VideoInfoShortToString(const VideoInfo& info) + { + return "ID:" + info.ID; + } + + AZStd::string VideoInfoListToString(const VideoInfoList& info) + { + AZStd::string strList; + + for (const auto & i : info) + { + if (!strList.empty()) + { + strList += ","; + } + + strList += "{"; + strList += VideoInfoShortToString(i); + strList += "}"; + } + + return strList; + } + + AZStd::string StartChannelCommercialResultToString(const StartChannelCommercialResult& info) + { + return "Duration:" + AZStd::string::format("%llu", info.Duration) + + " RetryAfter:" + AZStd::string::format("%llu", info.RetryAfter) + + " Message:" + info.Message; + } + + AZStd::string CommunityInfoToString(const CommunityInfo& info) + { + return "ID:" + info.ID + + " AvatarImageURL:" + info.AvatarImageURL + + " CoverImageURL:" + info.CoverImageURL + + " Description:" + info.Description + + " DescriptionHTML:" + info.DescriptionHTML + + " Language:" + info.Language + + " Name:" + info.Name + + " OwnerID:" + info.OwnerID + + " Rules:" + info.Rules + + " RulesHTML:" + info.RulesHTML + + " Summary:" + info.Summary; + } + + AZStd::string CommunityInfoListToString(const CommunityInfoList& info) + { + AZStd::string strList; + + for (const auto & i : info) + { + if (!strList.empty()) + { + strList += ","; + } + + strList += "{"; + strList += CommunityInfoToString(i); + strList += "}"; + } + + return strList; + } + + AZStd::string ReturnValueToString(const ReturnValue& info) + { + return "ReceiptID:" + AZStd::string::format("%llu", info.GetID()) + + " Result: " + ResultCodeToString(info.Result); + } + + AZStd::string Int64Value::ToString() const + { + return ReturnValueToString(*this) + + AZStd::string::format(" Int64:%lld", Value); + } + + AZStd::string Uint64Value::ToString() const + { + return ReturnValueToString(*this) + + AZStd::string::format(" Uint64:%llu", Value); + } + + AZStd::string StringValue::ToString() const + { + return ReturnValueToString(*this) + + " String:" + "\"" + Value + "\""; + } + + AZStd::string UserInfoValue::ToString() const + { + return ReturnValueToString(*this) + + UserInfoToString(Value); + } + + AZStd::string FriendRecommendationValue::ToString() const + { + return ReturnValueToString(*this) + + " ListSize:" + AZStd::string::format("%llu-", static_cast(Value.size())) + + " Recommendations:" + FriendRecommendationsToString(Value); + } + + AZStd::string GetFriendValue::ToString() const + { + return ReturnValueToString(*this) + + " ListSize:" + AZStd::string::format("%llu-", static_cast(Value.Friends.size())) + + " Cursor:" + Value.Cursor + + " Friends:" + FriendListToString(Value.Friends); + } + + AZStd::string FriendStatusValue::ToString() const + { + return ReturnValueToString(*this) + + " Status:" + Value.Status + + UserInfoToString(Value.User); + } + + AZStd::string FriendRequestValue::ToString() const + { + return ReturnValueToString(*this) + + " Total:" + AZStd::string::format("%llu", Value.Total) + + " Cursor:" + Value.Cursor + + " Requests:" + FriendRequestListToString(Value.Requests); + } + + AZStd::string PresenceStatusValue::ToString() const + { + return ReturnValueToString(*this) + + " Total:" + AZStd::string::format("%llu", static_cast(Value.size())) + + " StatusList:" + PresenceStatusListToString(Value); + } + + AZStd::string PresenceSettingsValue::ToString() const + { + return ReturnValueToString(*this) + + " " + PresenceSettingsToString(Value); + } + + AZStd::string ChannelInfoValue::ToString() const + { + return ReturnValueToString(*this) + + " " + ChannelInfoToString(Value); + } + + AZStd::string UserInfoListValue::ToString() const + { + return ReturnValueToString(*this) + + " Total:" + AZStd::string::format("%llu", static_cast(Value.size())) + + " Users:" + UserInfoListToString(Value); + } + + AZStd::string FollowerResultValue::ToString() const + { + return ReturnValueToString(*this) + + " Total:" + AZStd::string::format("%llu", Value.Total) + + " Cursor:" + Value.Cursor + + " Followers:" + FollowerListToString(Value.Followers); + } + + AZStd::string ChannelTeamValue::ToString() const + { + return ReturnValueToString(*this) + + " Total:" + AZStd::string::format("%llu", static_cast(Value.size())) + + " Teams:" + TeamInfoListToString(Value); + } + + AZStd::string SubscriberValue::ToString() const + { + return ReturnValueToString(*this) + + " Total:" + AZStd::string::format("%llu", Value.Total) + + " Subscribers:" + SubscriberInfoListToString(Value.Subscribers); + } + + AZStd::string SubscriberbyUserValue::ToString() const + { + return ReturnValueToString(*this) + + " SubscriberInfo:" + SubscriberInfoToString(Value); + } + + AZStd::string VideoReturnValue::ToString() const + { + return ReturnValueToString(*this) + + " Total:" + AZStd::string::format("%llu", Value.Total) + + " Videos:" + VideoInfoListToString(Value.Videos); + } + + AZStd::string StartChannelCommercialValue::ToString() const + { + return ReturnValueToString(*this) + + " " + StartChannelCommercialResultToString(Value); + } + + AZStd::string CommunityInfoValue::ToString() const + { + return ReturnValueToString(*this) + + " " + CommunityInfoToString(Value); + } + + AZStd::string CommunityInfoReturnValue::ToString() const + { + return ReturnValueToString(*this) + + " Total:" + AZStd::string::format("%llu", Value.Total) + + " Communities:" + CommunityInfoListToString(Value.Communities); } namespace Internal @@ -1218,4 +1218,4 @@ namespace Twitch ->Handler(); } } -} \ No newline at end of file +} diff --git a/Gems/WhiteBox/Code/Source/Platform/Windows/platform_windows_tools.cmake b/Gems/WhiteBox/Code/Source/Platform/Windows/platform_windows_tools.cmake index aea3313cce..561ab67600 100644 --- a/Gems/WhiteBox/Code/Source/Platform/Windows/platform_windows_tools.cmake +++ b/Gems/WhiteBox/Code/Source/Platform/Windows/platform_windows_tools.cmake @@ -10,8 +10,6 @@ # if(PAL_TRAIT_BUILD_HOST_TOOLS) - ly_associate_package(PACKAGE_NAME OpenMesh-8.1-rev1-windows TARGETS OpenMesh PACKAGE_HASH 1c1df639358526c368e790dfce40c45cbdfcfb1c9a041b9d7054a8949d88ee77) - set(LY_BUILD_DEPENDENCIES PRIVATE 3rdParty::OpenMesh) diff --git a/Tests/ly_shared/PlatformSetting.py b/Tests/ly_shared/PlatformSetting.py index d78c90f295..b215275c16 100755 --- a/Tests/ly_shared/PlatformSetting.py +++ b/Tests/ly_shared/PlatformSetting.py @@ -16,7 +16,7 @@ import pytest import logging from typing import Optional, Any -import ly_test_tools.lumberyard.pipeline_utils as utils +import ly_test_tools.o3de.pipeline_utils as utils logger = logging.getLogger(__name__) diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/base.lib b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/base.lib new file mode 100644 index 0000000000..5f9059e1d7 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/base.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:626086670063e2d25c747e4532fba8b070122b63cfd119da97ff96b13a6c3d6e +size 2094438 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/base_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/base_cc.pdb new file mode 100644 index 0000000000..88de799261 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/base_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:270034ee51a53ef434d0383765f951910319b7045867d10e66fb7bc5e5a8f380 +size 831488 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_client.lib b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_client.lib new file mode 100644 index 0000000000..fe4eaddad1 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_client.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:302ef869aad53a2ea5681ee1c5a96e198e5d521165bd6a9027d09ffd7df38fa5 +size 3914060 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_client_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_client_cc.pdb new file mode 100644 index 0000000000..f93a003b98 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_client_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45020f9f0b490f1c001e6cc8bf1c45a29d678611c4655f85074fe23fa6c5ddd1 +size 1175552 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_compat.lib b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_compat.lib new file mode 100644 index 0000000000..3f4d33f8b9 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_compat.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:004901f966fc28e9ae6aecc8086302592cb43208ec31a7c074f699533d84c2db +size 8978 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_compat_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_compat_cc.pdb new file mode 100644 index 0000000000..03f989686b --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_compat_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3aa1cba7cd1564df06777f4dcb4057f8bd2fcbc176ec8a494b17f7277e44a4d +size 77824 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_context.lib b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_context.lib new file mode 100644 index 0000000000..5652923545 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_context.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36acc956e8ecf13ed164d4c416bcc92f0f31db5f30f3d1e7beb33e398a41443b +size 63796 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_context_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_context_cc.pdb new file mode 100644 index 0000000000..35c42abfea --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_context_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f97ecc158d23e273367171dc032ce3ed7feeec7b7221ccf10e36d304ee467b7e +size 454656 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_handler.lib b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_handler.lib new file mode 100644 index 0000000000..c9f32e4272 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_handler.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5ed7b8a7193e75ff9588e6c7d06e2a3c0afda514a620dd275c1338ba6acd161 +size 3054554 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_handler_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_handler_cc.pdb new file mode 100644 index 0000000000..1328fd6d03 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_handler_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65903b1d9275b9268bdf7af1e4c2f2de46cd8dcc83eae4bfa64c2f5b38edbc57 +size 2887680 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_minidump.lib b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_minidump.lib new file mode 100644 index 0000000000..3796a0478e --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_minidump.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0e78280364d17a23a8feb819d71fb830f67ca40b7c932467263740cb2917ead +size 13044588 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_minidump_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_minidump_cc.pdb new file mode 100644 index 0000000000..4c58046197 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_minidump_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5885d9f72f86181199e6b2f1e7fb96419982209fe7e2c8f7b06b7c77c332c836 +size 2289664 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_snapshot.lib b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_snapshot.lib new file mode 100644 index 0000000000..f8b4588ed5 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_snapshot.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fb181c40f80438d0b50f79b093a3503c853a43db8e92f7d5ddfd5bb13793b16 +size 12965800 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_snapshot_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_snapshot_cc.pdb new file mode 100644 index 0000000000..992891a75f --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_snapshot_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27ab636cdc02fe86b73c40961c289d810f4f31be9c59c61e7c5300f0e9168fe9 +size 2355200 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_tool_support.lib b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_tool_support.lib new file mode 100644 index 0000000000..330ad9beee --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_tool_support.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f00b8108a7849e92d4711a0106b94931eced1859fb0281a423ad5179cacdf399 +size 240574 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_tool_support_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_tool_support_cc.pdb new file mode 100644 index 0000000000..ff5ecf71a6 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_tool_support_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:026ca665e79cf98df13477abe84201dd1bdba7a0068b3b411b89eaf9cc8c1711 +size 446464 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_util.lib b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_util.lib new file mode 100644 index 0000000000..78b3281e6c --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_util.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3a6cd014d7a1096ab492ea62061c8eac341ffe97a856710b2dd65e183fe9248 +size 11636150 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_util_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_util_cc.pdb new file mode 100644 index 0000000000..1f51fdbfd5 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/crashpad_util_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4c2b7e7ca514f1f5e768e4c7f5ec341f04b5f1e5fe82a8885476d1e1ed833f4 +size 2363392 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/getopt.cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/getopt.cc.pdb new file mode 100644 index 0000000000..5ef03ecd9b --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/getopt.cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5af26522ab427c4ec2ea9dbe0c41eca46bb31475b8b87ab47c513e56839ba763 +size 86016 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/getopt.lib b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/getopt.lib new file mode 100644 index 0000000000..2c42ac90b0 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/getopt.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd974c961c1a1443414bc21cfa10440ed1367c7cfa15fd9608ca431631917a65 +size 22644 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/zlib.c.pdb b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/zlib.c.pdb new file mode 100644 index 0000000000..58c4ab5305 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/zlib.c.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76c990a27c549c0428095bdbe97060a40d33c3a897587ddd06e2ee8db15d4770 +size 102400 diff --git a/Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/zlib.lib b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/zlib.lib new file mode 100644 index 0000000000..0b3dab07d7 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Debug_x64/third_party/zlib.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78cbbb2b947e55fb13b3f97366d759d22e828ccf2588f2a412b924fcbd2524d8 +size 350630 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/base.lib b/Tools/Crashpad/bin/windows/vs2019/Release_x64/base.lib new file mode 100644 index 0000000000..ab843e4478 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/base.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07139d47140d27876fff382036637bab1e22ae8c65b5ceaf37f92fcd347587a7 +size 1124438 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/base_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Release_x64/base_cc.pdb new file mode 100644 index 0000000000..366ca528e2 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/base_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b09045400a4ee55542916a915c111072a4f8b27be77378cb52f1597fd87d8150 +size 806912 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_client.lib b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_client.lib new file mode 100644 index 0000000000..027348705d --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_client.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4cbb4e87fe52a5b85739cb2cc562cc9da718b8a2d62df74428d40ccdf62cce2 +size 1696870 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_client_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_client_cc.pdb new file mode 100644 index 0000000000..5a66efa3bf --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_client_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae28bf771c2788a34bf642ab95ba102e5d6c7b8e22b23742a93b8092b5c5e687 +size 1085440 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_compat.lib b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_compat.lib new file mode 100644 index 0000000000..7cf7f10d4c --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_compat.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0803ce1fe7b23397997d6cc160803e44c7c172616223004ee5f17a5ae41d165 +size 8734 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_compat_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_compat_cc.pdb new file mode 100644 index 0000000000..bee40682a0 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_compat_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69f1497cdf145f98a04d05cc4bae8f7c60e98de3faafab46c9dacc95d4557fb5 +size 77824 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_context.lib b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_context.lib new file mode 100644 index 0000000000..8699928d13 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_context.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8a96c249ee9af8ddd9d9f66b93cd7ec5edb45dc5e0e012645917490a80897e3 +size 49100 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_context_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_context_cc.pdb new file mode 100644 index 0000000000..c92e68adbd --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_context_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fd31008151c0e7cb2dc6f3547d391ba69aeb4741b8b5b5e76abd83b6415e100 +size 430080 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_handler.lib b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_handler.lib new file mode 100644 index 0000000000..e2d8a48531 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_handler.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c9099859046bf4dafcf6455c39accfefe5ca389d8bfdc86fe2209c5e4b8804f +size 1157858 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_handler_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_handler_cc.pdb new file mode 100644 index 0000000000..49e5c1d8b1 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_handler_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca7cc3c846da2017736d813e56e32071d9e720319dc8fd636372923a3c25d223 +size 2527232 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_minidump.lib b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_minidump.lib new file mode 100644 index 0000000000..4ef4c8ae40 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_minidump.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3430726856c3b68f422614166ed64e7249b2246363c27fd2d63e63f668c2e47d +size 5155320 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_minidump_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_minidump_cc.pdb new file mode 100644 index 0000000000..4a2457000f --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_minidump_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae7f896e3613565161bc41b90dc45aed9539c82261d9b5c2ed9c5a3a0b8f31b9 +size 2052096 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_snapshot.lib b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_snapshot.lib new file mode 100644 index 0000000000..698f891924 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_snapshot.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c1ca49c6246323d9d4f854f4e8767735fdd51b0cc3faa7ce3d5a985e65db1a5 +size 4598666 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_snapshot_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_snapshot_cc.pdb new file mode 100644 index 0000000000..01de39bbf7 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_snapshot_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9eac108b65d4b45ffc08d11f457274c25e9c7aba978b79cdcccd0894a07f679c +size 2134016 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_tool_support.lib b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_tool_support.lib new file mode 100644 index 0000000000..64786f1069 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_tool_support.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:232322c240867a6a781784c754ac69a5e5452ff7bf6ac582ace35e9b1f68aada +size 95970 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_tool_support_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_tool_support_cc.pdb new file mode 100644 index 0000000000..ec48eeab69 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_tool_support_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a2b9b1d36c94c189d9c5ea821a2b819b01c4db449fa6b6a574e19efc2600978 +size 413696 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_util.lib b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_util.lib new file mode 100644 index 0000000000..4c346532a8 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_util.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6bf62815ecf6591fda46ba72b3636df660d5ceaa6571d55dec0f4b306d69cb1 +size 5704098 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_util_cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_util_cc.pdb new file mode 100644 index 0000000000..bd5f778e18 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/crashpad_util_cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e30478f7aa319924d5b2578ec038cd58f93d9be726e918dc6693964b9550532 +size 2256896 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/getopt.cc.pdb b/Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/getopt.cc.pdb new file mode 100644 index 0000000000..5976aa378d --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/getopt.cc.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d154da0553fd94ec3e5059503a41db03f1d68fffed12fc76ab4902ec75f6298e +size 86016 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/getopt.lib b/Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/getopt.lib new file mode 100644 index 0000000000..cf8a5cb625 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/getopt.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f8b36cf3305d9d10e97ebac28d53cf3f6c8cf117d8fc8bac3312c65c8e48d77 +size 29408 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/zlib.c.pdb b/Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/zlib.c.pdb new file mode 100644 index 0000000000..9d6836d135 --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/zlib.c.pdb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97f469e3a535f77fc242040bb80d36f8883182868bb070c33fec041722605259 +size 102400 diff --git a/Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/zlib.lib b/Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/zlib.lib new file mode 100644 index 0000000000..b755b2ce8c --- /dev/null +++ b/Tools/Crashpad/bin/windows/vs2019/Release_x64/third_party/zlib.lib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5f1d98d742d61d430c0bbc73eeb4ab9dc7afb6adaa8bdde7570fe28a3a4aac8 +size 388862 diff --git a/Tools/Crashpad/handler/src/crash_report_upload_thread.cc b/Tools/Crashpad/handler/src/crash_report_upload_thread.cc index f2a29c828e..ccb1512e24 100644 --- a/Tools/Crashpad/handler/src/crash_report_upload_thread.cc +++ b/Tools/Crashpad/handler/src/crash_report_upload_thread.cc @@ -44,7 +44,7 @@ #endif // OS_MACOSX // Amazon - Handle giving the user the option of whether or not to send the report. -namespace Lumberyard +namespace O3de { bool CheckConfirmation(const crashpad::CrashReportDatabase::Report& report); bool AddAttachments(crashpad::HTTPMultipartBuilder& multipartBuilder); @@ -198,7 +198,7 @@ void CrashReportUploadThread::ProcessPendingReport( } // Amazon - Handle giving the user the option of whether or not to send the report. - if (!Lumberyard::CheckConfirmation(report)) + if (!O3DE::CheckConfirmation(report)) { database_->SkipReportUpload(report.uuid, Metrics::CrashSkippedReason::kUploadsDisabled); @@ -350,7 +350,7 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport( "application/octet-stream"); // Amazon - Lumberyard::AddAttachments(http_multipart_builder); + O3de::AddAttachments(http_multipart_builder); std::unique_ptr http_transport(HTTPTransport::Create()); HTTPHeaders content_headers; @@ -390,7 +390,7 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport( http_transport->SetURL(url); // Amazon - Lumberyard::UpdateHttpTransport(http_transport, url); + O3de::UpdateHttpTransport(http_transport, url); if (!http_transport->ExecuteSynchronously(response_body)) { return UploadResult::kRetry; diff --git a/Tools/Crashpad/include/client/crashpad_client.h b/Tools/Crashpad/include/client/crashpad_client.h index 7799bd9c9f..c452cdbb68 100644 --- a/Tools/Crashpad/include/client/crashpad_client.h +++ b/Tools/Crashpad/include/client/crashpad_client.h @@ -94,6 +94,8 @@ class CrashpadClient { //! a background thread. Optionally, WaitForHandlerStart() can be used at //! a suitable time to retreive the result of background startup. This //! option is only used on Windows. + //! \param[in] attachments Vector that stores file paths that should be + //! captured with each report at the time of the crash. //! //! \return `true` on success, `false` on failure with a message logged. bool StartHandler(const base::FilePath& handler, @@ -103,7 +105,8 @@ class CrashpadClient { const std::map& annotations, const std::vector& arguments, bool restartable, - bool asynchronous_start); + bool asynchronous_start, + const std::vector& attachments = {}); #if defined(OS_MACOSX) || DOXYGEN //! \brief Sets the process’ crash handler to a Mach service registered with diff --git a/Tools/LyTestTools/README.txt b/Tools/LyTestTools/README.txt index 16aa7f534f..1cdd4811fc 100644 --- a/Tools/LyTestTools/README.txt +++ b/Tools/LyTestTools/README.txt @@ -67,14 +67,14 @@ PACKAGE STRUCTURE The project is organized into packages. Each package corresponds to a tool: -- LyTestTools.ly_test_tools._internal: contains logging setup, pytest fixture, and lumberyard workspace manager modules +- LyTestTools.ly_test_tools._internal: contains logging setup, pytest fixture, and o3de workspace manager modules - LyTestTools.ly_test_tools.builtin: builtin helpers and fixtures for quickly writing tests - LyTestTools.ly_test_tools.console: modules used for consoles - LyTestTools.ly_test_tools.environment: functions related to file/process management and cleanup - LyTestTools.ly_test_tools.image: modules related to image capturing and processing - LyTestTools.ly_test_tools.launchers: game launchers library - LyTestTools.ly_test_tools.log: modules for interacting with generated or existing log files -- LyTestTools.ly_test_tools.lumberyard: modules used to interact with lumberyard +- LyTestTools.ly_test_tools.o3de: modules used to interact with Open 3D Engine - LyTestTools.ly_test_tools.mobile: modules used for android/ios - LyTestTools.ly_test_tools.report: modules used for reporting - LyTestTools.tests: LyTestTools integration, unit, and example usage tests diff --git a/Tools/LyTestTools/ly_test_tools/_internal/managers/workspace.py b/Tools/LyTestTools/ly_test_tools/_internal/managers/workspace.py index 5bf1864794..df35eda4fa 100755 --- a/Tools/LyTestTools/ly_test_tools/_internal/managers/workspace.py +++ b/Tools/LyTestTools/ly_test_tools/_internal/managers/workspace.py @@ -19,9 +19,9 @@ import tempfile import ly_test_tools.environment.file_system import ly_test_tools.environment.process_utils as process_utils -import ly_test_tools.lumberyard.asset_processor -import ly_test_tools.lumberyard.settings as settings -import ly_test_tools.lumberyard.shader_compiler +import ly_test_tools.o3de.asset_processor +import ly_test_tools.o3de.settings as settings +import ly_test_tools.o3de.shader_compiler import ly_test_tools._internal.managers.artifact_manager as artifact_manager import ly_test_tools._internal.managers.abstract_resource_locator as arl @@ -46,7 +46,7 @@ class AbstractWorkspaceManager: The workspace contains information about the workspace being used and the running pytest test. :param resource_locator: A resource locator to create paths for the workspace - :param project: Lumberyard project to use for the LumberyardRelease object + :param project: O3DE project to use for the LumberyardRelease object :param tmp_path: A path to use for storing temp files, if not specified default to the system's tmp :param output_path: A path used to store artifacts, if not specified defaults to "\\dev\\TestResults\\" @@ -55,8 +55,8 @@ class AbstractWorkspaceManager: self.project = project self.artifact_manager = artifact_manager.NullArtifactManager() - self.asset_processor = ly_test_tools.lumberyard.asset_processor.AssetProcessor(self) - self.shader_compiler = ly_test_tools.lumberyard.shader_compiler.ShaderCompiler(self) + self.asset_processor = ly_test_tools.o3de.asset_processor.AssetProcessor(self) + self.shader_compiler = ly_test_tools.o3de.shader_compiler.ShaderCompiler(self) self._original_cwd = os.getcwd() self.tmp_path = tmp_path self.output_path = output_path diff --git a/Tools/LyTestTools/ly_test_tools/log/log_monitor.py b/Tools/LyTestTools/ly_test_tools/log/log_monitor.py index 6c02c72bca..ca3cd24303 100755 --- a/Tools/LyTestTools/ly_test_tools/log/log_monitor.py +++ b/Tools/LyTestTools/ly_test_tools/log/log_monitor.py @@ -32,7 +32,7 @@ def check_exact_match(line, expected_line): """ Uses regular expressions to find an exact (not partial) match for 'expected_line' in 'line', i.e. in the example below it matches 'foo' and succeeds: - line value: '66118.999958 - INFO - [MainThread] - ly_test_tools.lumberyard.asset_processor - foo' + line value: '66118.999958 - INFO - [MainThread] - ly_test_tools.o3de.asset_processor - foo' expected_line: 'foo' :param line: The log line string to search, diff --git a/Tools/LyTestTools/ly_test_tools/lumberyard/__init__.py b/Tools/LyTestTools/ly_test_tools/o3de/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from Tools/LyTestTools/ly_test_tools/lumberyard/__init__.py rename to Tools/LyTestTools/ly_test_tools/o3de/__init__.py diff --git a/Tools/LyTestTools/ly_test_tools/lumberyard/ap_log_parser.py b/Tools/LyTestTools/ly_test_tools/o3de/ap_log_parser.py old mode 100755 new mode 100644 similarity index 100% rename from Tools/LyTestTools/ly_test_tools/lumberyard/ap_log_parser.py rename to Tools/LyTestTools/ly_test_tools/o3de/ap_log_parser.py diff --git a/Tools/LyTestTools/ly_test_tools/lumberyard/asset_processor.py b/Tools/LyTestTools/ly_test_tools/o3de/asset_processor.py old mode 100755 new mode 100644 similarity index 99% rename from Tools/LyTestTools/ly_test_tools/lumberyard/asset_processor.py rename to Tools/LyTestTools/ly_test_tools/o3de/asset_processor.py index 70c5a37dfd..230e85e6bf --- a/Tools/LyTestTools/ly_test_tools/lumberyard/asset_processor.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/asset_processor.py @@ -26,8 +26,8 @@ import psutil import ly_test_tools import ly_test_tools.environment.waiter as waiter import ly_test_tools.environment.file_system as file_system -import ly_test_tools.lumberyard.pipeline_utils as utils -from ly_test_tools.lumberyard.ap_log_parser import APLogParser +import ly_test_tools.o3de.pipeline_utils as utils +from ly_test_tools.o3de.ap_log_parser import APLogParser logger = logging.getLogger(__name__) diff --git a/Tools/LyTestTools/ly_test_tools/lumberyard/asset_processor_config_util.py b/Tools/LyTestTools/ly_test_tools/o3de/asset_processor_config_util.py old mode 100755 new mode 100644 similarity index 98% rename from Tools/LyTestTools/ly_test_tools/lumberyard/asset_processor_config_util.py rename to Tools/LyTestTools/ly_test_tools/o3de/asset_processor_config_util.py index 7b49d406b7..259d6b5b0b --- a/Tools/LyTestTools/ly_test_tools/lumberyard/asset_processor_config_util.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/asset_processor_config_util.py @@ -15,8 +15,8 @@ AssetProcessorPlatformConfig.setreg import logging import os.path as path -from ly_test_tools.lumberyard.settings import RegistrySettings -from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_SETTINGS_ROOT_KEY +from ly_test_tools.o3de.settings import RegistrySettings +from ly_test_tools.o3de.asset_processor import ASSET_PROCESSOR_SETTINGS_ROOT_KEY logger = logging.getLogger(__name__) AssetProcessorConfig = "AssetProcessorPlatformConfig.setreg" diff --git a/Tools/LyTestTools/ly_test_tools/lumberyard/asset_processor_utils.py b/Tools/LyTestTools/ly_test_tools/o3de/asset_processor_utils.py old mode 100755 new mode 100644 similarity index 100% rename from Tools/LyTestTools/ly_test_tools/lumberyard/asset_processor_utils.py rename to Tools/LyTestTools/ly_test_tools/o3de/asset_processor_utils.py diff --git a/Tools/LyTestTools/ly_test_tools/lumberyard/ini_configuration_util.py b/Tools/LyTestTools/ly_test_tools/o3de/ini_configuration_util.py old mode 100755 new mode 100644 similarity index 100% rename from Tools/LyTestTools/ly_test_tools/lumberyard/ini_configuration_util.py rename to Tools/LyTestTools/ly_test_tools/o3de/ini_configuration_util.py diff --git a/Tools/LyTestTools/ly_test_tools/lumberyard/pipeline_utils.py b/Tools/LyTestTools/ly_test_tools/o3de/pipeline_utils.py old mode 100755 new mode 100644 similarity index 99% rename from Tools/LyTestTools/ly_test_tools/lumberyard/pipeline_utils.py rename to Tools/LyTestTools/ly_test_tools/o3de/pipeline_utils.py index 8a1ffbd646..3763b7eac0 --- a/Tools/LyTestTools/ly_test_tools/lumberyard/pipeline_utils.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/pipeline_utils.py @@ -29,7 +29,7 @@ from typing import Dict, List, Tuple, Optional, Callable # Import LyTestTools import ly_test_tools.environment.file_system as fs import ly_test_tools.environment.process_utils as process_utils -from ly_test_tools.lumberyard.ap_log_parser import APLogParser +from ly_test_tools.o3de.ap_log_parser import APLogParser logger = logging.getLogger(__name__) diff --git a/Tools/LyTestTools/ly_test_tools/lumberyard/settings.py b/Tools/LyTestTools/ly_test_tools/o3de/settings.py old mode 100755 new mode 100644 similarity index 100% rename from Tools/LyTestTools/ly_test_tools/lumberyard/settings.py rename to Tools/LyTestTools/ly_test_tools/o3de/settings.py diff --git a/Tools/LyTestTools/ly_test_tools/lumberyard/shader_compiler.py b/Tools/LyTestTools/ly_test_tools/o3de/shader_compiler.py old mode 100755 new mode 100644 similarity index 100% rename from Tools/LyTestTools/ly_test_tools/lumberyard/shader_compiler.py rename to Tools/LyTestTools/ly_test_tools/o3de/shader_compiler.py diff --git a/Tools/LyTestTools/tests/unit/test_asset_processor.py b/Tools/LyTestTools/tests/unit/test_asset_processor.py index 2f40d26088..09731ccec5 100755 --- a/Tools/LyTestTools/tests/unit/test_asset_processor.py +++ b/Tools/LyTestTools/tests/unit/test_asset_processor.py @@ -8,7 +8,7 @@ or, if provided, by the license below or the license accompanying this file. Do remove or modify any license notices. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -Unit tests for ly_test_tools.lumberyard.asset_processor +Unit tests for ly_test_tools.o3de.asset_processor """ import datetime import unittest.mock as mock @@ -18,7 +18,7 @@ import pytest import ly_test_tools._internal.managers.workspace import ly_test_tools._internal.managers.abstract_resource_locator -import ly_test_tools.lumberyard.asset_processor +import ly_test_tools.o3de.asset_processor pytestmark = pytest.mark.SUITE_smoke @@ -34,12 +34,12 @@ mock_project_path = os.path.join('some', 'dir', mock_project) mock.MagicMock(return_value=mock_initial_path)) @mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_engine_root', mock.MagicMock(return_value=(mock_engine_root, mock_dev_path))) -@mock.patch('ly_test_tools.lumberyard.asset_processor.logger.warning', mock.MagicMock()) +@mock.patch('ly_test_tools.o3de.asset_processor.logger.warning', mock.MagicMock()) class TestAssetProcessor(object): @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager') def test_Init_DefaultParams_MembersSetCorrectly(self, mock_workspace): - under_test = ly_test_tools.lumberyard.asset_processor.AssetProcessor(mock_workspace) + under_test = ly_test_tools.o3de.asset_processor.AssetProcessor(mock_workspace) assert under_test._workspace == mock_workspace assert under_test._port is not None @@ -47,15 +47,15 @@ class TestAssetProcessor(object): @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager') @mock.patch('subprocess.Popen') - @mock.patch('ly_test_tools.lumberyard.asset_processor.AssetProcessor.connect_socket') - @mock.patch('ly_test_tools.lumberyard.asset_processor.ASSET_PROCESSOR_PLATFORM_MAP', {'foo': 'bar'}) + @mock.patch('ly_test_tools.o3de.asset_processor.AssetProcessor.connect_socket') + @mock.patch('ly_test_tools.o3de.asset_processor.ASSET_PROCESSOR_PLATFORM_MAP', {'foo': 'bar'}) def test_Start_NoneRunning_ProcStarted(self, mock_connect, mock_popen, mock_workspace): mock_ap_path = 'mock_ap_path' mock_workspace.asset_processor_platform = 'foo' mock_workspace.paths.asset_processor.return_value = mock_ap_path mock_workspace.project = mock_project mock_workspace.paths.project.return_value = mock_project_path - under_test = ly_test_tools.lumberyard.asset_processor.AssetProcessor(mock_workspace) + under_test = ly_test_tools.o3de.asset_processor.AssetProcessor(mock_workspace) under_test.enable_asset_processor_platform = mock.MagicMock() under_test.wait_for_idle = mock.MagicMock() @@ -77,7 +77,7 @@ class TestAssetProcessor(object): @mock.patch('ly_test_tools.environment.process_utils.process_exists', mock.MagicMock(return_value=True)) @mock.patch('socket.socket.connect') def test_Start_ProcAlreadyRunning_ProcNotChanged(self, mock_connect, mock_popen, mock_workspace): - under_test = ly_test_tools.lumberyard.asset_processor.AssetProcessor(mock_workspace) + under_test = ly_test_tools.o3de.asset_processor.AssetProcessor(mock_workspace) under_test.process_exists = mock.MagicMock(return_value=True) under_test.asset_processor_platform = mock.MagicMock(return_value=ly_test_tools.HOST_OS_PLATFORM) mock_proc = mock.MagicMock() @@ -90,9 +90,9 @@ class TestAssetProcessor(object): mock_connect.assert_not_called() @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager') - @mock.patch('ly_test_tools.lumberyard.asset_processor.waiter.wait_for') + @mock.patch('ly_test_tools.o3de.asset_processor.waiter.wait_for') def test_Stop_ProcAlreadyRunning_ProcStopped(self, mock_waiter, mock_workspace): - under_test = ly_test_tools.lumberyard.asset_processor.AssetProcessor(mock_workspace) + under_test = ly_test_tools.o3de.asset_processor.AssetProcessor(mock_workspace) under_test.get_process_list = mock.MagicMock(return_value=[mock.MagicMock()]) under_test._control_connection = mock.MagicMock() under_test.get_pid = mock.MagicMock(return_value=0) @@ -111,7 +111,7 @@ class TestAssetProcessor(object): def test_BatchProcess_NoFastscanBatchCompletes_Success(self, mock_run, mock_workspace): mock_workspace.project = None mock_workspace.paths.project.return_value = mock_project_path - under_test = ly_test_tools.lumberyard.asset_processor.AssetProcessor(mock_workspace) + under_test = ly_test_tools.o3de.asset_processor.AssetProcessor(mock_workspace) apb_path = mock_workspace.paths.asset_processor_batch() mock_run.return_value.returncode = 0 result, _ = under_test.batch_process(1, False) @@ -128,7 +128,7 @@ class TestAssetProcessor(object): def test_BatchProcess_FastscanBatchCompletes_Success(self, mock_run, mock_workspace): mock_workspace.project = mock_project mock_workspace.paths.project.return_value = mock_project_path - under_test = ly_test_tools.lumberyard.asset_processor.AssetProcessor(mock_workspace) + under_test = ly_test_tools.o3de.asset_processor.AssetProcessor(mock_workspace) apb_path = mock_workspace.paths.asset_processor_batch() mock_run.return_value.returncode = 0 @@ -147,7 +147,7 @@ class TestAssetProcessor(object): def test_BatchProcess_ReturnCodeFail_Failure(self, mock_run, mock_workspace): mock_workspace.project = None mock_workspace.paths.project.return_value = mock_project_path - under_test = ly_test_tools.lumberyard.asset_processor.AssetProcessor(mock_workspace) + under_test = ly_test_tools.o3de.asset_processor.AssetProcessor(mock_workspace) apb_path = mock_workspace.paths.asset_processor_batch() mock_run.return_value.returncode = 1 @@ -162,7 +162,7 @@ class TestAssetProcessor(object): @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager') def test_EnableAssetProcessorPlatform_AssetProcessorObject_Updated(self, mock_workspace): - under_test = ly_test_tools.lumberyard.asset_processor.AssetProcessor(mock_workspace) + under_test = ly_test_tools.o3de.asset_processor.AssetProcessor(mock_workspace) under_test.enable_asset_processor_platform('foo') assert "foo" in under_test._enabled_platform_overrides @@ -170,7 +170,7 @@ class TestAssetProcessor(object): @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager') def test_BackupAPSettings_Called_CallsBackupAPSettings(self, mock_workspace): mock_temp_path = 'foo_path' - mock_asset_processor = ly_test_tools.lumberyard.asset_processor.AssetProcessor(mock_workspace) + mock_asset_processor = ly_test_tools.o3de.asset_processor.AssetProcessor(mock_workspace) mock_workspace.settings.get_temp_path.return_value = mock_temp_path mock_asset_processor.backup_ap_settings() @@ -180,18 +180,18 @@ class TestAssetProcessor(object): @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager') def test_RestoreAPSettings_Called_CallsRestoreAPSettings(self, mock_workspace): mock_temp_path = 'foo_path' - mock_asset_processor = ly_test_tools.lumberyard.asset_processor.AssetProcessor(mock_workspace) + mock_asset_processor = ly_test_tools.o3de.asset_processor.AssetProcessor(mock_workspace) mock_workspace.settings.get_temp_path.return_value = mock_temp_path mock_asset_processor.restore_ap_settings() mock_workspace.settings.restore_asset_processor_settings.assert_called_with(mock_temp_path) - @mock.patch('ly_test_tools.lumberyard.asset_processor.AssetProcessor.restore_ap_settings') - @mock.patch('ly_test_tools.lumberyard.asset_processor.AssetProcessor.stop') + @mock.patch('ly_test_tools.o3de.asset_processor.AssetProcessor.restore_ap_settings') + @mock.patch('ly_test_tools.o3de.asset_processor.AssetProcessor.stop') @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager') def test_Teardown_Called_CallsRestoreAPSettingsAndStop(self, mock_workspace, mock_stop, mock_restore_ap): - mock_asset_processor = ly_test_tools.lumberyard.asset_processor.AssetProcessor(mock_workspace) + mock_asset_processor = ly_test_tools.o3de.asset_processor.AssetProcessor(mock_workspace) mock_asset_processor.teardown() diff --git a/Tools/LyTestTools/tests/unit/test_launcher_android.py b/Tools/LyTestTools/tests/unit/test_launcher_android.py index febd418f93..e9993ebf01 100755 --- a/Tools/LyTestTools/tests/unit/test_launcher_android.py +++ b/Tools/LyTestTools/tests/unit/test_launcher_android.py @@ -234,7 +234,7 @@ class TestAndroidLauncher: mock_workspace.shader_compiler.stop.assert_called_once() @mock.patch('ly_test_tools.launchers.platforms.base.Launcher._config_ini_to_dict') - @mock.patch('ly_test_tools.lumberyard.settings.LySettings.modify_platform_setting', mock.MagicMock) + @mock.patch('ly_test_tools.o3de.settings.LySettings.modify_platform_setting', mock.MagicMock) def test_ConfigureSettings_DefaultValues_SetsValues(self, mock_config): mock_config.return_value = VALID_ANDROID_CONFIG mock_workspace = MockedWorkspace() diff --git a/Tools/LyTestTools/tests/unit/test_settings.py b/Tools/LyTestTools/tests/unit/test_settings.py index 47c4d1bc18..55f1b3c3f1 100755 --- a/Tools/LyTestTools/tests/unit/test_settings.py +++ b/Tools/LyTestTools/tests/unit/test_settings.py @@ -14,7 +14,7 @@ import unittest import pytest -import ly_test_tools.lumberyard.settings +import ly_test_tools.o3de.settings pytestmark = pytest.mark.SUITE_smoke @@ -51,10 +51,10 @@ class TestReplaceLineInFile(unittest.TestCase): try: with mock.patch('__builtin__.open'): - ly_test_tools.lumberyard.settings._edit_text_settings_file(self.file_name, self.search_for, self.replace_with) + ly_test_tools.o3de.settings._edit_text_settings_file(self.file_name, self.search_for, self.replace_with) except ImportError: with mock.patch('builtins.open'): - ly_test_tools.lumberyard.settings._edit_text_settings_file(self.file_name, self.search_for, self.replace_with) + ly_test_tools.o3de.settings._edit_text_settings_file(self.file_name, self.search_for, self.replace_with) mock_log_warning.assert_called_once() @@ -68,10 +68,10 @@ class TestReplaceLineInFile(unittest.TestCase): with pytest.raises(NotImplementedError): try: with mock.patch('__builtin__.open'): - ly_test_tools.lumberyard.settings._edit_text_settings_file(self.file_name, self.search_for, self.replace_with) + ly_test_tools.o3de.settings._edit_text_settings_file(self.file_name, self.search_for, self.replace_with) except ImportError: with mock.patch('builtins.open'): - ly_test_tools.lumberyard.settings._edit_text_settings_file(self.file_name, self.search_for, self.replace_with) + ly_test_tools.o3de.settings._edit_text_settings_file(self.file_name, self.search_for, self.replace_with) @mock.patch('fileinput.input') @mock.patch('os.path.isfile') @@ -80,10 +80,10 @@ class TestReplaceLineInFile(unittest.TestCase): try: with mock.patch('__builtin__.open'): - ly_test_tools.lumberyard.settings._edit_text_settings_file(self.file_name, self.search_for, self.replace_with) + ly_test_tools.o3de.settings._edit_text_settings_file(self.file_name, self.search_for, self.replace_with) except ImportError: with mock.patch('builtins.open'): - ly_test_tools.lumberyard.settings._edit_text_settings_file(self.file_name, self.search_for, self.replace_with) + ly_test_tools.o3de.settings._edit_text_settings_file(self.file_name, self.search_for, self.replace_with) mock_input.return_value.close.assert_called_once_with() @@ -101,7 +101,7 @@ class TestReplaceLineInFile(unittest.TestCase): mock.call.write("Setting4="), mock.call.write('\n'), ] - ly_test_tools.lumberyard.settings._edit_text_settings_file(self.file_name, 'Setting1', 'NewFoo') + ly_test_tools.o3de.settings._edit_text_settings_file(self.file_name, 'Setting1', 'NewFoo') mock_stdout.assert_has_calls(expected_print_lines) @@ -119,7 +119,7 @@ class TestReplaceLineInFile(unittest.TestCase): mock.call.write("Setting4="), mock.call.write('\n'), ] - ly_test_tools.lumberyard.settings._edit_text_settings_file(self.file_name, 'Setting2', 'NewBar') + ly_test_tools.o3de.settings._edit_text_settings_file(self.file_name, 'Setting2', 'NewBar') mock_stdout.assert_has_calls(expected_print_lines) @@ -137,7 +137,7 @@ class TestReplaceLineInFile(unittest.TestCase): mock.call.write("Setting4=NewContent"), mock.call.write('\n'), ] - ly_test_tools.lumberyard.settings._edit_text_settings_file(self.file_name, 'Setting4', 'NewContent') + ly_test_tools.o3de.settings._edit_text_settings_file(self.file_name, 'Setting4', 'NewContent') mock_stdout.assert_has_calls(expected_print_lines) @@ -155,7 +155,7 @@ class TestReplaceLineInFile(unittest.TestCase): mock.call.write("Setting4="), mock.call.write('\n'), ] - ly_test_tools.lumberyard.settings._edit_text_settings_file(self.file_name, 'Setting5', 'NewSetting!') + ly_test_tools.o3de.settings._edit_text_settings_file(self.file_name, 'Setting5', 'NewSetting!') mock_stdout.assert_has_calls(expected_print_lines) @@ -182,7 +182,7 @@ class TestJsonSettings(unittest.TestCase): mock_open = mock.mock_open(read_data=self.mock_file_content) with mock.patch('builtins.open', mock_open): - with ly_test_tools.lumberyard.settings.JsonSettings(self.test_file_name) as js: + with ly_test_tools.o3de.settings.JsonSettings(self.test_file_name) as js: # get the whole document value = js.get_key('') assert len(value) == 5 @@ -204,7 +204,7 @@ class TestJsonSettings(unittest.TestCase): default_value = -10 with mock.patch('builtins.open', mock_open): - with ly_test_tools.lumberyard.settings.JsonSettings(self.test_file_name) as js: + with ly_test_tools.o3de.settings.JsonSettings(self.test_file_name) as js: value = js.get_key('/scale/w', default_value) assert value == default_value @@ -213,7 +213,7 @@ class TestJsonSettings(unittest.TestCase): expected = 100 with mock.patch('builtins.open', mock_open): - with ly_test_tools.lumberyard.settings.JsonSettings(self.test_file_name) as js: + with ly_test_tools.o3de.settings.JsonSettings(self.test_file_name) as js: js.set_key('/scale/x', expected) value = js.get_key('/scale/x') assert value == expected @@ -230,7 +230,7 @@ class TestJsonSettings(unittest.TestCase): json_dump.side_effect = _mock_dump with mock.patch('builtins.open', mock_open): - with ly_test_tools.lumberyard.settings.JsonSettings(self.test_file_name) as js: + with ly_test_tools.o3de.settings.JsonSettings(self.test_file_name) as js: js.set_key('/name', expected) assert expected == new_dict_content['name'] @@ -246,7 +246,7 @@ class TestJsonSettings(unittest.TestCase): json_dump.side_effect = _mock_dump with mock.patch('builtins.open', mock_open): - with ly_test_tools.lumberyard.settings.JsonSettings(self.test_file_name) as js: + with ly_test_tools.o3de.settings.JsonSettings(self.test_file_name) as js: js.remove_key('/scale/z') assert len(new_dict_content['scale']) == 2 diff --git a/Tools/LyTestTools/tests/unit/test_shader_compiler.py b/Tools/LyTestTools/tests/unit/test_shader_compiler.py index 99bc1d21dc..d419247eb4 100755 --- a/Tools/LyTestTools/tests/unit/test_shader_compiler.py +++ b/Tools/LyTestTools/tests/unit/test_shader_compiler.py @@ -8,7 +8,7 @@ or, if provided, by the license below or the license accompanying this file. Do remove or modify any license notices. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -Unit tests for ly_test_tools.lumberyard.shader_compiler +Unit tests for ly_test_tools.o3de.shader_compiler """ import unittest.mock as mock @@ -16,7 +16,7 @@ import pytest import ly_test_tools._internal.managers.workspace import ly_test_tools._internal.managers.abstract_resource_locator -import ly_test_tools.lumberyard.shader_compiler +import ly_test_tools.o3de.shader_compiler pytestmark = pytest.mark.SUITE_smoke @@ -31,12 +31,12 @@ mock_project = 'mock_project' mock.MagicMock(return_value=mock_initial_path)) @mock.patch('ly_test_tools._internal.managers.abstract_resource_locator._find_engine_root', mock.MagicMock(return_value=(mock_engine_root, mock_dev_path))) -@mock.patch('ly_test_tools.lumberyard.asset_processor.logger.warning', mock.MagicMock()) +@mock.patch('ly_test_tools.o3de.asset_processor.logger.warning', mock.MagicMock()) class TestShaderCompiler(object): @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager') def test_Init_MockWorkspace_MembersSetCorrectly(self, mock_workspace): - under_test = ly_test_tools.lumberyard.shader_compiler.ShaderCompiler(mock_workspace) + under_test = ly_test_tools.o3de.shader_compiler.ShaderCompiler(mock_workspace) assert under_test._workspace == mock_workspace assert under_test._sc_proc is None @@ -48,7 +48,7 @@ class TestShaderCompiler(object): mock_shader_compiler_path = 'mock_shader_compiler_path' mock_workspace.paths.get_shader_compiler_path.return_value = mock_shader_compiler_path mock_popen.return_value = mock.MagicMock() - under_test = ly_test_tools.lumberyard.shader_compiler.ShaderCompiler(mock_workspace) + under_test = ly_test_tools.o3de.shader_compiler.ShaderCompiler(mock_workspace) assert under_test._sc_proc is None @@ -59,9 +59,9 @@ class TestShaderCompiler(object): @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager') @mock.patch('subprocess.Popen') - @mock.patch('ly_test_tools.lumberyard.shader_compiler.MAC', True) + @mock.patch('ly_test_tools.o3de.shader_compiler.MAC', True) def test_Start_NotImplemented_ErrorRaised(self, mock_popen, mock_workspace): - under_test = ly_test_tools.lumberyard.shader_compiler.ShaderCompiler(mock_workspace) + under_test = ly_test_tools.o3de.shader_compiler.ShaderCompiler(mock_workspace) assert under_test._sc_proc is None @@ -73,13 +73,13 @@ class TestShaderCompiler(object): @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager') @mock.patch('subprocess.Popen') - @mock.patch('ly_test_tools.lumberyard.shader_compiler.logger.info') - @mock.patch('ly_test_tools.lumberyard.shader_compiler.MAC', True) + @mock.patch('ly_test_tools.o3de.shader_compiler.logger.info') + @mock.patch('ly_test_tools.o3de.shader_compiler.MAC', True) def test_Start_AlreadyRunning_ProcessNotChanged(self, mock_logger, mock_popen, mock_workspace): mock_shader_compiler_path = 'mock_shader_compiler_path' mock_workspace.paths.get_shader_compiler_path.return_value = mock_shader_compiler_path mock_popen.return_value = mock.MagicMock() - under_test = ly_test_tools.lumberyard.shader_compiler.ShaderCompiler(mock_workspace) + under_test = ly_test_tools.o3de.shader_compiler.ShaderCompiler(mock_workspace) under_test._sc_proc = 'foo' @@ -92,12 +92,12 @@ class TestShaderCompiler(object): 'but we already have one open!'.format(mock_shader_compiler_path)) @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager') - @mock.patch('ly_test_tools.lumberyard.shader_compiler.process_utils.kill_processes_started_from') - @mock.patch('ly_test_tools.lumberyard.shader_compiler.waiter.wait_for') + @mock.patch('ly_test_tools.o3de.shader_compiler.process_utils.kill_processes_started_from') + @mock.patch('ly_test_tools.o3de.shader_compiler.waiter.wait_for') def test_Stop_AlreadyRunning_ProcessStopped(self, mock_wait, mock_kill, mock_workspace): mock_shader_compiler_path = 'mock_shader_compiler_path' mock_workspace.paths.get_shader_compiler_path.return_value = mock_shader_compiler_path - under_test = ly_test_tools.lumberyard.shader_compiler.ShaderCompiler(mock_workspace) + under_test = ly_test_tools.o3de.shader_compiler.ShaderCompiler(mock_workspace) under_test._sc_proc = 'foo' @@ -108,13 +108,13 @@ class TestShaderCompiler(object): mock_wait.assert_called_once() @mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager') - @mock.patch('ly_test_tools.lumberyard.shader_compiler.process_utils.kill_processes_started_from') - @mock.patch('ly_test_tools.lumberyard.shader_compiler.waiter.wait_for') - @mock.patch('ly_test_tools.lumberyard.shader_compiler.logger.info') + @mock.patch('ly_test_tools.o3de.shader_compiler.process_utils.kill_processes_started_from') + @mock.patch('ly_test_tools.o3de.shader_compiler.waiter.wait_for') + @mock.patch('ly_test_tools.o3de.shader_compiler.logger.info') def test_Stop_NoneRunning_MessageLogged(self, mock_logger, mock_wait, mock_kill, mock_workspace): mock_shader_compiler_path = 'mock_shader_compiler_path' mock_workspace.paths.get_shader_compiler_path.return_value = mock_shader_compiler_path - under_test = ly_test_tools.lumberyard.shader_compiler.ShaderCompiler(mock_workspace) + under_test = ly_test_tools.o3de.shader_compiler.ShaderCompiler(mock_workspace) under_test._sc_proc = None diff --git a/Tools/build/JenkinsScripts/build/Platform/Mac/build_config.json b/Tools/build/JenkinsScripts/build/Platform/Mac/build_config.json index f5d3b316c4..e7e1193062 100644 --- a/Tools/build/JenkinsScripts/build/Platform/Mac/build_config.json +++ b/Tools/build/JenkinsScripts/build/Platform/Mac/build_config.json @@ -153,5 +153,15 @@ "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD" } + }, + "mac_packaging_all": { + "TAGS": [ + "packaging" + ], + "COMMAND": "python_mac.sh", + "PARAMETERS": { + "SCRIPT_PATH": "scripts/build/package/package.py", + "SCRIPT_PARAMETERS": "--platform Mac --type all" + } } } diff --git a/cmake/3rdParty.cmake b/cmake/3rdParty.cmake index 197d48eee6..b6731ae239 100644 --- a/cmake/3rdParty.cmake +++ b/cmake/3rdParty.cmake @@ -107,6 +107,7 @@ function(ly_add_external_target) set(BASE_PATH "${LY_3RDPARTY_PATH}/${ly_add_external_target_3RDPARTY_DIRECTORY}") else() + ly_install_external_target(${ly_add_external_target_3RDPARTY_ROOT_DIRECTORY}) set(BASE_PATH "${ly_add_external_target_3RDPARTY_ROOT_DIRECTORY}") endif() @@ -288,6 +289,25 @@ function(ly_add_external_target) endfunction() +#! ly_install_external_target: external libraries which are not part of 3rdParty need to be installed +# +# \arg:3RDPARTY_ROOT_DIRECTORY custom 3rd party directory which needs to be installed +function(ly_install_external_target 3RDPARTY_ROOT_DIRECTORY) + + # Install the Find file to our /cmake directory + install(FILES ${CMAKE_CURRENT_LIST_FILE} DESTINATION cmake) + + # We only want to install external targets that are part of our source tree + # Checking for relative path beginning with "../" also works when the path + # given is on another drive letter on windows(i.e., RELATIVE_PATH returns an absolute path) + file(RELATIVE_PATH rel_path ${CMAKE_SOURCE_DIR} ${3RDPARTY_ROOT_DIRECTORY}) + if (NOT ${rel_path} MATCHES "^../") + get_filename_component(rel_path ${rel_path} DIRECTORY) + install(DIRECTORY ${3RDPARTY_ROOT_DIRECTORY} DESTINATION ${rel_path}) + endif() + +endfunction() + # Add the 3rdParty folder to find the modules list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/3rdParty) ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/3rdParty/Platform/${PAL_PLATFORM_NAME}) diff --git a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake index ff7c1a4d11..4659c3f03a 100644 --- a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake +++ b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake @@ -31,6 +31,8 @@ ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform TARG ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5) ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform TARGETS PVRTexTool PACKAGE_HASH d0d6da61c7557de0d2c71fc35ba56c3be49555b703f0e853d4c58225537acf1e) +ly_associate_package(PACKAGE_NAME poly2tri-0.3.3-rev2-multiplatform TARGETS poly2tri PACKAGE_HASH 04092d06716f59b936b61906eaf3647db23b685d81d8b66131eb53e0aeaa1a38) +ly_associate_package(PACKAGE_NAME v-hacd-2.0-rev1-multiplatform TARGETS v-hacd PACKAGE_HASH 5c71aef19cc9787d018d64eec076e9f51ea5a3e0dc6b6e22e57c898f6cc4afe3) # platform-specific: ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-linux TARGETS freetype PACKAGE_HASH 9ad246873067717962c6b780d28a5ce3cef3321b73c9aea746a039c798f52e93) diff --git a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake index 488350f9b4..7973eb3303 100644 --- a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake +++ b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake @@ -36,6 +36,8 @@ ly_associate_package(PACKAGE_NAME glad-2.0.0-beta-rev2-multiplatform ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform TARGETS lux_core PACKAGE_HASH c8c13cf7bc351643e1abd294d0841b24dee60e51647dff13db7aec396ad1e0b5) ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform TARGETS PVRTexTool PACKAGE_HASH d0d6da61c7557de0d2c71fc35ba56c3be49555b703f0e853d4c58225537acf1e) +ly_associate_package(PACKAGE_NAME poly2tri-0.3.3-rev2-multiplatform TARGETS poly2tri PACKAGE_HASH 04092d06716f59b936b61906eaf3647db23b685d81d8b66131eb53e0aeaa1a38) +ly_associate_package(PACKAGE_NAME v-hacd-2.0-rev1-multiplatform TARGETS v-hacd PACKAGE_HASH 5c71aef19cc9787d018d64eec076e9f51ea5a3e0dc6b6e22e57c898f6cc4afe3) # platform-specific: ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-mac-ios TARGETS freetype PACKAGE_HASH 67b4f57aed92082d3fd7c16aa244a7d908d90122c296b0a63f73e0a0b8761977) diff --git a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake index c37ee73375..afecb0788c 100644 --- a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake +++ b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake @@ -37,6 +37,9 @@ ly_associate_package(PACKAGE_NAME lux_core-2.2-rev5-multiplatform ly_associate_package(PACKAGE_NAME xxhash-0.7.4-rev1-multiplatform TARGETS xxhash PACKAGE_HASH e81f3e6c4065975833996dd1fcffe46c3cf0f9e3a4207ec5f4a1b564ba75861e) ly_associate_package(PACKAGE_NAME Blast-1.1.7-rev1-multiplatform TARGETS Blast PACKAGE_HASH 36b8f393bcd25d0f85cfc7a831ebbdac881e6054c4f0735649966aa6aa86e6f0) ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform TARGETS PVRTexTool PACKAGE_HASH d0d6da61c7557de0d2c71fc35ba56c3be49555b703f0e853d4c58225537acf1e) +ly_associate_package(PACKAGE_NAME NvCloth-1.1.6-rev1-multiplatform TARGETS NvCloth PACKAGE_HASH 05fc62634ca28644e7659a89e97f4520d791e6ddf4b66f010ac669e4e2ed4454) +ly_associate_package(PACKAGE_NAME poly2tri-0.3.3-rev2-multiplatform TARGETS poly2tri PACKAGE_HASH 04092d06716f59b936b61906eaf3647db23b685d81d8b66131eb53e0aeaa1a38) +ly_associate_package(PACKAGE_NAME v-hacd-2.0-rev1-multiplatform TARGETS v-hacd PACKAGE_HASH 5c71aef19cc9787d018d64eec076e9f51ea5a3e0dc6b6e22e57c898f6cc4afe3) # platform-specific: ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-windows TARGETS freetype PACKAGE_HASH 88dedc86ccb8c92f14c2c033e51ee7d828fa08eafd6475c6aa963938a99f4bf3) @@ -51,3 +54,4 @@ ly_associate_package(PACKAGE_NAME pyside2-qt-5.15.1-rev2-windows TARGETS pys ly_associate_package(PACKAGE_NAME openimageio-2.1.16.0-rev1-windows TARGETS OpenImageIO PACKAGE_HASH b9f6d6df180ad240b9f17a68c1862c7d8f38234de0e692e83116254b0ee467e5) ly_associate_package(PACKAGE_NAME qt-5.15.2-windows TARGETS Qt PACKAGE_HASH edaf954c647c99727bfd313dab2959803d2df0873914bb96368c3d8286eed6d9) ly_associate_package(PACKAGE_NAME libsamplerate-0.2.1-rev2-windows TARGETS libsamplerate PACKAGE_HASH dcf3c11a96f212a52e2c9241abde5c364ee90b0f32fe6eeb6dcdca01d491829f) +ly_associate_package(PACKAGE_NAME OpenMesh-8.1-rev1-windows TARGETS OpenMesh PACKAGE_HASH 1c1df639358526c368e790dfce40c45cbdfcfb1c9a041b9d7054a8949d88ee77) \ No newline at end of file diff --git a/cmake/3rdParty/Platform/Windows/Crashpad_windows.cmake b/cmake/3rdParty/Platform/Windows/Crashpad_windows.cmake index 5d82e71443..ec1ce8db02 100644 --- a/cmake/3rdParty/Platform/Windows/Crashpad_windows.cmake +++ b/cmake/3rdParty/Platform/Windows/Crashpad_windows.cmake @@ -9,11 +9,12 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -set(libpath ${BASE_PATH}/bin/windows/vs2015/$,Debug,Release>_x64) +set(libpath ${BASE_PATH}/bin/windows/vs2019/$,Debug,Release>_x64) set(CRASHPAD_LIBS ${libpath}/base.lib ${libpath}/crashpad_client.lib + ${libpath}/crashpad_context.lib ${libpath}/crashpad_util.lib winhttp version @@ -30,6 +31,6 @@ set(CRASHPAD_HANDLER_LIBS ${libpath}/third_party/getopt.lib ${libpath}/crashpad_minidump.lib ${libpath}/crashpad_snapshot.lib - ${libpath}/crashpad_handler_lib.lib + ${libpath}/crashpad_handler.lib ${libpath}/third_party/zlib.lib ) diff --git a/cmake/3rdPartyPackages.cmake b/cmake/3rdPartyPackages.cmake index 75a9f1a2cb..3984111996 100644 --- a/cmake/3rdPartyPackages.cmake +++ b/cmake/3rdPartyPackages.cmake @@ -13,7 +13,7 @@ include_guard() include(cmake/LySet.cmake) # OVERVIEW: -# this is the Lumberyard Package system. +# this is the Open 3D Engine Package system. # It allows you to host a package on a server and download it as needed when a target # requests that specific package, or manually whenever you want to do so. # Most users will just call ly_associate_package(...) to associate a package with a target diff --git a/cmake/FindTargetTemplate.cmake b/cmake/FindTargetTemplate.cmake new file mode 100644 index 0000000000..7d0129d05a --- /dev/null +++ b/cmake/FindTargetTemplate.cmake @@ -0,0 +1,45 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +# Generated by O3DE + +include(FindPackageHandleStandardArgs) + +ly_add_target( + +NAME @NAME_PLACEHOLDER@ UNKNOWN IMPORTED + +@NAMESPACE_PLACEHOLDER@ + +@INCLUDE_DIRECTORIES_PLACEHOLDER@ + +@BUILD_DEPENDENCIES_PLACEHOLDER@ + +@RUNTIME_DEPENDENCIES_PLACEHOLDER@ + +@COMPILE_DEFINITIONS_PLACEHOLDER@ +) + +# The below if was generated from if (NOT HEADER_ONLY_PLACEHOLDER) +# HEADER_ONLY_PLACEHOLDER evaluates to TRUE or FALSE +if (NOT @HEADER_ONLY_PLACEHOLDER@) + # Load information for each installed configuration. + foreach(config @ALL_CONFIGS@) + set(@NAME_PLACEHOLDER@_${config}_FOUND FALSE) + include("${LY_ROOT_FOLDER}/cmake_autogen/@NAME_PLACEHOLDER@/@NAME_PLACEHOLDER@_${config}.cmake") + endforeach() + + find_package_handle_standard_args(@NAME_PLACEHOLDER@ + "Could not find package @NAME_PLACEHOLDER@" + @TARGET_CONFIG_FOUND_VARS_PLACEHOLDER@) +else() + set(@NAME_PLACEHOLDER@_FOUND TRUE) +endif() \ No newline at end of file diff --git a/cmake/Findo3deTemplate.cmake b/cmake/Findo3deTemplate.cmake new file mode 100644 index 0000000000..0e904fd95d --- /dev/null +++ b/cmake/Findo3deTemplate.cmake @@ -0,0 +1,35 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +# Generated by O3DE + +include(FindPackageHandleStandardArgs) + +# This will be called from within the installed engine's CMakeLists.txt +macro(ly_find_o3de_packages) + @FIND_PACKAGES_PLACEHOLDER@ + find_package(LauncherGenerator) +endmacro() + + +function(o3de_current_file_path path) + set(${path} ${CMAKE_CURRENT_FUNCTION_LIST_DIR} PARENT_SCOPE) +endfunction() + + +# We are using the engine's CMakeLists.txt to handle initialization/importing targets +# Since this is external to the project's source, we need to specify an output directory +# even though we don't build +macro(o3de_initialize) + set(LY_PROJECTS ${CMAKE_SOURCE_DIR}) + o3de_current_file_path(current_path) + add_subdirectory(${current_path}/.. o3de) +endmacro() \ No newline at end of file diff --git a/cmake/Install.cmake b/cmake/Install.cmake new file mode 100644 index 0000000000..b56f5ced85 --- /dev/null +++ b/cmake/Install.cmake @@ -0,0 +1,13 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) +include(${pal_dir}/Install_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) \ No newline at end of file diff --git a/cmake/LYWrappers.cmake b/cmake/LYWrappers.cmake index 1cfc9c473a..25465ce69c 100644 --- a/cmake/LYWrappers.cmake +++ b/cmake/LYWrappers.cmake @@ -53,6 +53,8 @@ define_property(TARGET PROPERTY GEM_MODULE # \arg:HEADERONLY (bool) defines this target to be a header only library. A ${NAME}_HEADERS project will be created for the IDE # \arg:EXECUTABLE (bool) defines this target to be an executable # \arg:APPLICATION (bool) defines this target to be an application (executable that is not a console) +# \arg:UNKNOWN (bool) defines this target to be unknown. This is used when importing installed targets from Find files +# \arg:IMPORTED (bool) defines this target to be imported. # \arg:NAMESPACE namespace declaration for this target. It will be used for IDE and dependencies # \arg:OUTPUT_NAME (optional) overrides the name of the output target. If not specified, the name will be used. # \arg:OUTPUT_SUBDIRECTORY places the runtime binary in a subfolder within the output folder (this only affects to runtime binaries) @@ -75,7 +77,7 @@ define_property(TARGET PROPERTY GEM_MODULE # \arg:AUTOGEN_RULES a set of AutoGeneration rules to be passed to the AzAutoGen expansion system function(ly_add_target) - set(options STATIC SHARED MODULE GEM_MODULE HEADERONLY EXECUTABLE APPLICATION AUTOMOC AUTOUIC AUTORCC NO_UNITY) + set(options STATIC SHARED MODULE GEM_MODULE HEADERONLY EXECUTABLE APPLICATION UNKNOWN IMPORTED AUTOMOC AUTOUIC AUTORCC NO_UNITY) set(oneValueArgs NAME NAMESPACE OUTPUT_SUBDIRECTORY OUTPUT_NAME) set(multiValueArgs FILES_CMAKE GENERATED_FILES INCLUDE_DIRECTORIES COMPILE_DEFINITIONS BUILD_DEPENDENCIES RUNTIME_DEPENDENCIES PLATFORM_INCLUDE_FILES TARGET_PROPERTIES AUTOGEN_RULES) @@ -85,8 +87,10 @@ function(ly_add_target) if(NOT ly_add_target_NAME) message(FATAL_ERROR "You must provide a name for the target") endif() - if(NOT ly_add_target_FILES_CMAKE) - message(FATAL_ERROR "You must provide a list of _files.cmake files for the target") + if(NOT ly_add_target_IMPORTED) + if(NOT ly_add_target_FILES_CMAKE) + message(FATAL_ERROR "You must provide a list of _files.cmake files for the target") + endif() endif() # If the GEM_MODULE tag is passed set the normal MODULE argument @@ -125,8 +129,12 @@ function(ly_add_target) set(linking_options APPLICATION) set(linking_count "${linking_count}1") endif() + if(ly_add_target_UNKNOWN) + set(linking_options UNKNOWN) + set(linking_count "${linking_count}1") + endif() if(NOT ("${linking_count}" STREQUAL "1")) - message(FATAL_ERROR "More than one of the following options [STATIC | SHARED | MODULE | HEADERONLY | EXECUTABLE | APPLICATION] was specified and they are mutually exclusive") + message(FATAL_ERROR "More than one of the following options [STATIC | SHARED | MODULE | HEADERONLY | EXECUTABLE | APPLICATION | UNKNOWN] was specified and they are mutually exclusive") endif() if(ly_add_target_NAMESPACE) @@ -157,6 +165,11 @@ function(ly_add_target) SOURCES ${ALLFILES} ${ly_add_target_GENERATED_FILES} ) set(project_NAME ${ly_add_target_NAME}_HEADERS) + elseif(ly_add_target_UNKNOWN) + add_library(${ly_add_target_NAME} + ${linking_options} + IMPORTED + ) else() add_library(${ly_add_target_NAME} ${linking_options} @@ -197,7 +210,7 @@ function(ly_add_target) endif() if (ly_add_target_INCLUDE_DIRECTORIES) - target_include_directories(${ly_add_target_NAME} + ly_target_include_directories(${ly_add_target_NAME} ${ly_add_target_INCLUDE_DIRECTORIES} ) endif() @@ -325,6 +338,17 @@ function(ly_add_target) ) endif() + if(NOT ly_add_target_IMPORTED) + ly_install_target( + ${ly_add_target_NAME} + NAMESPACE ${ly_add_target_NAMESPACE} + INCLUDE_DIRECTORIES ${ly_add_target_INCLUDE_DIRECTORIES} + BUILD_DEPENDENCIES ${ly_add_target_BUILD_DEPENDENCIES} + RUNTIME_DEPENDENCIES ${ly_add_target_RUNTIME_DEPENDENCIES} + COMPILE_DEFINITIONS ${ly_add_target_COMPILE_DEFINITIONS} + ) + endif() + endfunction() #! ly_target_link_libraries: wraps target_link_libraries handling also MODULE linkage. @@ -384,7 +408,7 @@ function(ly_delayed_target_link_libraries) endif() if(item_type STREQUAL MODULE_LIBRARY) - target_include_directories(${target} ${visibility} $) + ly_target_include_directories(${target} ${visibility} $) target_link_libraries(${target} ${visibility} $) target_compile_definitions(${target} ${visibility} $) target_compile_options(${target} ${visibility} $) @@ -485,7 +509,7 @@ endfunction() # Looks at the the following variables within the platform include file to set the equivalent target properties # LY_FILES_CMAKE -> extract list of files -> target_sources # LY_FILES -> target_source -# LY_INCLUDE_DIRECTORIES -> target_include_directories +# LY_INCLUDE_DIRECTORIES -> ly_target_include_directories # LY_COMPILE_DEFINITIONS -> target_compile_definitions # LY_COMPILE_OPTIONS -> target_compile_options # LY_LINK_OPTIONS -> target_link_options @@ -511,11 +535,7 @@ macro(ly_configure_target_platform_properties) message(FATAL_ERROR "The supplied PLATFORM_INCLUDE_FILE(${platform_include_file}) cannot be included.\ Parsing of target will halt") endif() - if(ly_add_target_HEADERONLY) - target_sources(${ly_add_target_NAME} INTERFACE ${platform_include_file}) - else() - target_sources(${ly_add_target_NAME} PRIVATE ${platform_include_file}) - endif() + target_sources(${ly_add_target_NAME} PRIVATE ${platform_include_file}) ly_source_groups_from_folders("${platform_include_file}") if(LY_FILES_CMAKE) @@ -531,7 +551,7 @@ macro(ly_configure_target_platform_properties) target_sources(${ly_add_target_NAME} PRIVATE ${LY_FILES}) endif() if (LY_INCLUDE_DIRECTORIES) - target_include_directories(${ly_add_target_NAME} ${LY_INCLUDE_DIRECTORIES}) + ly_target_include_directories(${ly_add_target_NAME} ${LY_INCLUDE_DIRECTORIES}) endif() if(LY_COMPILE_DEFINITIONS) target_compile_definitions(${ly_add_target_NAME} ${LY_COMPILE_DEFINITIONS}) @@ -634,6 +654,42 @@ function(ly_add_source_properties) endfunction() +function(ly_target_include_directories TARGET) + + # Add the includes to the build and install interface + set(reserved_keywords PRIVATE PUBLIC INTERFACE) + unset(last_keyword) + foreach(include ${ARGN}) + if(${include} IN_LIST reserved_keywords) + list(APPEND adapted_includes ${include}) + elseif(IS_ABSOLUTE ${include}) + list(APPEND adapted_includes + $ + ) + else() + string(GENEX_STRIP ${include} include_genex_expr) + if(include_genex_expr STREQUAL include) # only for cases where there are no generation expressions + # We will be installing the includes using the same directory structure used in our source tree. + # The INSTALL_INTERFACE path tells CMake the location of the includes relative to the install prefix. + # When the target is imported into an external project, cmake will find these includes at /include/ + # where is the location of the lumberyard install on disk. + file(REAL_PATH ${include} include_real) + file(RELATIVE_PATH install_dir ${CMAKE_SOURCE_DIR} ${include_real}) + list(APPEND adapted_includes + $ + $ + ) + else() + list(APPEND adapted_includes + ${include} + ) + endif() + endif() + endforeach() + target_include_directories(${TARGET} ${adapted_includes}) + +endfunction() + #! ly_project_add_subdirectory: calls add_subdirectory() if the project name is in the project list # diff --git a/cmake/LyAutoGen.cmake b/cmake/LyAutoGen.cmake index a95b0cd76f..16a8a8de55 100644 --- a/cmake/LyAutoGen.cmake +++ b/cmake/LyAutoGen.cmake @@ -26,8 +26,7 @@ function(ly_add_autogen) if(ly_add_autogen_AUTOGEN_RULES) set(AZCG_INPUTFILES ${ly_add_autogen_ALLFILES}) list(FILTER AZCG_INPUTFILES INCLUDE REGEX ".*\.(xml|json|jinja)$") - list(APPEND ly_add_autogen_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/Azcg/Generated") - target_include_directories(${ly_add_autogen_NAME} ${ly_add_autogen_INCLUDE_DIRECTORIES}) + ly_target_include_directories(${ly_add_autogen_NAME} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/Azcg/Generated") execute_process( COMMAND ${LY_PYTHON_CMD} "${LY_ROOT_FOLDER}/Code/Framework/AzAutoGen/AzAutoGen.py" "${CMAKE_BINARY_DIR}/Azcg/TemplateCache/" "${CMAKE_CURRENT_BINARY_DIR}/Azcg/Generated/" "${CMAKE_CURRENT_SOURCE_DIR}" "${AZCG_INPUTFILES}" "${ly_add_autogen_AUTOGEN_RULES}" "-n" OUTPUT_VARIABLE AUTOGEN_OUTPUTS diff --git a/cmake/Platform/Android/Install_android.cmake b/cmake/Platform/Android/Install_android.cmake new file mode 100644 index 0000000000..8473ba1d0e --- /dev/null +++ b/cmake/Platform/Android/Install_android.cmake @@ -0,0 +1,12 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +include(cmake/Platform/Common/Install_common.cmake) \ No newline at end of file diff --git a/cmake/Platform/Android/platform_android_files.cmake b/cmake/Platform/Android/platform_android_files.cmake index 0ccca99881..04c9e20a94 100644 --- a/cmake/Platform/Android/platform_android_files.cmake +++ b/cmake/Platform/Android/platform_android_files.cmake @@ -12,7 +12,9 @@ set(FILES ../Common/Configurations_common.cmake ../Common/Clang/Configurations_clang.cmake + ../Common/Install_common.cmake Configurations_android.cmake + Install_android.cmake LYTestWrappers_android.cmake LYWrappers_android.cmake PAL_android.cmake diff --git a/cmake/Platform/Common/Install_common.cmake b/cmake/Platform/Common/Install_common.cmake new file mode 100644 index 0000000000..9164105f3a --- /dev/null +++ b/cmake/Platform/Common/Install_common.cmake @@ -0,0 +1,284 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + + +#! ly_install_target: registers the target to be installed by cmake install. +# +# \arg:NAME name of the target +# \arg:NAMESPACE namespace declaration for this target. It will be used for IDE and dependencies +# \arg:INCLUDE_DIRECTORIES paths to the include directories +# \arg:BUILD_DEPENDENCIES list of interfaces this target depends on (could be a compilation dependency +# if the dependency is only exposing an include path, or could be a linking +# dependency is exposing a lib) +# \arg:RUNTIME_DEPENDENCIES list of dependencies this target depends on at runtime +# \arg:COMPILE_DEFINITIONS list of compilation definitions this target will use to compile +function(ly_install_target ly_install_target_NAME) + + # All include directories marked PUBLIC or INTERFACE will be installed + set(include_location "include") + get_target_property(include_directories ${ly_install_target_NAME} INTERFACE_INCLUDE_DIRECTORIES) + + if (include_directories) + set_target_properties(${ly_install_target_NAME} PROPERTIES PUBLIC_HEADER "${include_directories}") + # The include directories are specified relative to the CMakeLists.txt file that adds the target. + # We need to install the includes relative to our source tree root because that's where INSTALL_INTERFACE + # will point CMake when it looks for headers + file(RELATIVE_PATH relative_path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + string(APPEND include_location "/${relative_path}") + endif() + + ly_generate_target_find_file( + NAME ${ly_install_target_NAME} + ${ARGN} + ) + + install( + TARGETS ${ly_install_target_NAME} + EXPORT ${ly_install_target_NAME}Targets + LIBRARY DESTINATION lib/$ + ARCHIVE DESTINATION lib/$ + RUNTIME DESTINATION bin/$ + PUBLIC_HEADER DESTINATION ${include_location} + ) + + install(EXPORT ${ly_install_target_NAME}Targets + DESTINATION cmake_autogen/${ly_install_target_NAME} + ) + + # Header only targets(i.e., INTERFACE) don't have outputs + get_target_property(target_type ${ly_install_target_NAME} TYPE) + if(NOT ${target_type} STREQUAL "INTERFACE_LIBRARY") + ly_generate_target_config_file(${ly_install_target_NAME}) + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${ly_install_target_NAME}_$.cmake" + DESTINATION cmake_autogen/${ly_install_target_NAME} + ) + endif() + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Find${ly_install_target_NAME}.cmake" + DESTINATION cmake + ) + +endfunction() + + +#! ly_generate_target_find_file: generates the Find${target}.cmake file which is used when importing installed packages. +# +# \arg:NAME name of the target +# \arg:INCLUDE_DIRECTORIES paths to the include directories +# \arg:NAMESPACE namespace declaration for this target. It will be used for IDE and dependencies +# \arg:BUILD_DEPENDENCIES list of interfaces this target depends on (could be a compilation dependency +# if the dependency is only exposing an include path, or could be a linking +# dependency is exposing a lib) +# \arg:RUNTIME_DEPENDENCIES list of dependencies this target depends on at runtime +# \arg:COMPILE_DEFINITIONS list of compilation definitions this target will use to compile +function(ly_generate_target_find_file) + + set(options) + set(oneValueArgs NAME NAMESPACE) + set(multiValueArgs COMPILE_DEFINITIONS BUILD_DEPENDENCIES RUNTIME_DEPENDENCIES INCLUDE_DIRECTORIES) + cmake_parse_arguments(ly_generate_target_find_file "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + # These targets will be imported. So we strip PRIVATE properties. + # We can only set INTERFACE properties on imported targets + unset(build_dependencies_interface_props) + unset(compile_definitions_interface_props) + unset(include_directories_interface_props) + unset(installed_include_directories_interface_props) + ly_strip_non_interface_properties(build_dependencies_interface_props ${ly_generate_target_find_file_BUILD_DEPENDENCIES}) + ly_strip_non_interface_properties(compile_definitions_interface_props ${ly_generate_target_find_file_COMPILE_DEFINITIONS}) + ly_strip_non_interface_properties(include_directories_interface_props ${ly_generate_target_find_file_INCLUDE_DIRECTORIES}) + + set(NAME_PLACEHOLDER ${ly_generate_target_find_file_NAME}) + + # Includes need additional processing to add the install root + foreach(include ${include_directories_interface_props}) + set(installed_include_prefix "\${LY_ROOT_FOLDER}/include/") + file(RELATIVE_PATH relative_path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${include}) + string(APPEND installed_include_prefix ${relative_path}) + list(APPEND installed_include_directories_interface_props ${installed_include_prefix}) + endforeach() + + if(ly_generate_target_find_file_NAMESPACE) + set(NAMESPACE_PLACEHOLDER "NAMESPACE ${ly_generate_target_find_file_NAMESPACE}") + endif() + if(installed_include_directories_interface_props) + string(REPLACE ";" "\n" include_dirs "${installed_include_directories_interface_props}") + set(INCLUDE_DIRECTORIES_PLACEHOLDER "INCLUDE_DIRECTORIES\nINTERFACE\n${include_dirs}") + endif() + if(build_dependencies_interface_props) + string(REPLACE ";" "\n" build_deps "${build_dependencies_interface_props}") + set(BUILD_DEPENDENCIES_PLACEHOLDER "BUILD_DEPENDENCIES\nINTERFACE\n${build_deps}") + endif() + if(ly_generate_target_find_file_RUNTIME_DEPENDENCIES) + string(REPLACE ";" "\n" runtime_deps "${ly_generate_target_find_file_RUNTIME_DEPENDENCIES}") + set(RUNTIME_DEPENDENCIES_PLACEHOLDER "RUNTIME_DEPENDENCIES\n${runtime_deps}") + endif() + if(compile_definitions_interface_props) + string(REPLACE ";" "\n" compile_defs "${compile_definitions_interface_props}") + set(COMPILE_DEFINITIONS_PLACEHOLDER "COMPILE_DEFINITIONS\nINTERFACE\n${compile_defs}") + endif() + + string(REPLACE ";" " " ALL_CONFIGS "${CMAKE_CONFIGURATION_TYPES}") + + set(target_config_found_vars "") + foreach(config ${CMAKE_CONFIGURATION_TYPES}) + string(APPEND target_config_found_vars "\n${ly_generate_target_find_file_NAME}_${config}_FOUND") + endforeach() + set(TARGET_CONFIG_FOUND_VARS_PLACEHOLDER "${target_config_found_vars}") + + # Interface libs aren't built so they don't generate a library. These are our HEADER_ONLY targets. + get_target_property(target_type ${ly_generate_target_find_file_NAME} TYPE) + if(NOT ${target_type} STREQUAL "INTERFACE_LIBRARY") + set(HEADER_ONLY_PLACEHOLDER FALSE) + else() + set(HEADER_ONLY_PLACEHOLDER TRUE) + endif() + + configure_file(${LY_ROOT_FOLDER}/cmake/FindTargetTemplate.cmake ${CMAKE_CURRENT_BINARY_DIR}/Find${ly_generate_target_find_file_NAME}.cmake @ONLY) + +endfunction() + + +#! ly_generate_target_config_file: generates the ${target}_$.cmake files for a target +# +# The generated file will set the location of the target binary per configuration +# These per config files will be included by the target's find file to set the location of the binary/ +# \arg:NAME name of the target +function(ly_generate_target_config_file NAME) + + # SHARED_LIBRARY is omitted from this list because we link to the implib on Windows + set(BINARY_DIR_OUTPUTS EXECUTABLE APPLICATION) + set(target_file_contents "") + if(${target_type} IN_LIST BINARY_DIR_OUTPUTS) + set(out_file_generator TARGET_FILE_NAME) + set(out_dir bin) + else() + set(out_file_generator TARGET_LINKER_FILE_NAME) + set(out_dir lib) + endif() + + string(APPEND target_file_contents " +# Generated by O3DE + +set_target_properties(${NAME} PROPERTIES IMPORTED_LOCATION \"\${LY_ROOT_FOLDER}/${out_dir}/$/$<${out_file_generator}:${NAME}>\") + +if(EXISTS \"\${LY_ROOT_FOLDER}/${out_dir}/$/$<${out_file_generator}:${NAME}>\") + set(${NAME}_$_FOUND TRUE) +else() + set(${NAME}_$_FOUND FALSE) +endif()") + + file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${NAME}_$.cmake" CONTENT ${target_file_contents}) + +endfunction() + + +#! ly_strip_non_interface_properties: strips private properties since we're exporting an interface target +# +# \arg:INTERFACE_PROPERTIES list of interface properties to be returned +function(ly_strip_non_interface_properties INTERFACE_PROPERTIES) + set(reserved_keywords PRIVATE PUBLIC INTERFACE) + unset(last_keyword) + unset(stripped_props) + foreach(prop ${ARGN}) + if(${prop} IN_LIST reserved_keywords) + set(last_keyword ${prop}) + else() + if (NOT last_keyword STREQUAL "PRIVATE") + list(APPEND stripped_props ${prop}) + endif() + endif() + endforeach() + + set(${INTERFACE_PROPERTIES} ${stripped_props} PARENT_SCOPE) +endfunction() + + +#! ly_setup_o3de_install: generates the Findo3de.cmake file and setup install locations for scripts, tools, assets etc., +function(ly_setup_o3de_install) + + get_property(all_targets GLOBAL PROPERTY LY_ALL_TARGETS) + unset(find_package_list) + foreach(target IN LISTS all_targets) + list(APPEND find_package_list "find_package(${target})") + endforeach() + + string(REPLACE ";" "\n" FIND_PACKAGES_PLACEHOLDER "${find_package_list}") + + configure_file(${LY_ROOT_FOLDER}/cmake/Findo3deTemplate.cmake ${CMAKE_CURRENT_BINARY_DIR}/Findo3de.cmake @ONLY) + + ly_install_launcher_target_generator() + + ly_install_o3de_directories() + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Findo3de.cmake" + DESTINATION cmake + ) + + install(FILES "${CMAKE_SOURCE_DIR}/CMakeLists.txt" + DESTINATION . + ) + +endfunction() + + +#! ly_install_o3de_directories: install directories required by the engine +function(ly_install_o3de_directories) + + # List of directories we want to install relative to engine root + set(DIRECTORIES_TO_INSTALL Tools/LyTestTools Tools/RemoteConsole ctest_scripts scripts) + foreach(dir ${DIRECTORIES_TO_INSTALL}) + + get_filename_component(install_path ${dir} DIRECTORY) + if (NOT install_path) + set(install_path .) + endif() + + install(DIRECTORY "${CMAKE_SOURCE_DIR}/${dir}" + DESTINATION ${install_path} + ) + + endforeach() + + # Directories which have excludes + install(DIRECTORY "${CMAKE_SOURCE_DIR}/cmake" + DESTINATION . + REGEX "Findo3de.cmake" EXCLUDE + ) + + install(DIRECTORY "${CMAKE_SOURCE_DIR}/python" + DESTINATION . + REGEX "downloaded_packages" EXCLUDE + REGEX "runtime" EXCLUDE + ) + +endfunction() + + +#! ly_install_launcher_target_generator: install source files needed for project launcher generation +function(ly_install_launcher_target_generator) + + install(FILES + ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/launcher_generator.cmake + ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/launcher_project_files.cmake + ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/LauncherProject.cpp + ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/StaticModules.in + DESTINATION LauncherGenerator + ) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/Platform + DESTINATION LauncherGenerator + ) + install(FILES ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/FindLauncherGenerator.cmake + DESTINATION cmake + ) + +endfunction() \ No newline at end of file diff --git a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake index 7ecfb98706..25b6e63ab9 100644 --- a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake +++ b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake @@ -76,7 +76,6 @@ ly_append_configurations_options( /wd4457 # declaration hides function parameter /wd4459 # declaration hides global declaration /wd4701 # potentially unintialized local variable - /wd4702 # unreachable code # Enabling warnings that are disabled by default from /W4 # https://docs.microsoft.com/en-us/cpp/preprocessor/compiler-warnings-that-are-off-by-default?view=vs-2019 @@ -162,10 +161,10 @@ ly_set(LY_CXX_SYSTEM_INCLUDE_CONFIGURATION_FLAG /experimental:external # Turns on "external" headers feature for MSVC compilers /external:W0 # Set warning level in external headers to 0. This is used to suppress warnings 3rdParty libraries which uses the "system_includes" option in their json configuration /wd4193 # Temporary workaround for the /experiment:external feature generating warning C4193: #pragma warning(pop): no matching '#pragma warning(push)' + /wd4702 # Despite we set it to W0, we found that 3rdParty::OpenMesh was issuing these warnings while using some template functions. Disabling it here does the trick ) if(NOT CMAKE_INCLUDE_SYSTEM_FLAG_CXX) ly_set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX /external:I) endif() include(cmake/Platform/Common/TargetIncludeSystemDirectories_unsupported.cmake) - diff --git a/cmake/Platform/Linux/Install_linux.cmake b/cmake/Platform/Linux/Install_linux.cmake new file mode 100644 index 0000000000..8473ba1d0e --- /dev/null +++ b/cmake/Platform/Linux/Install_linux.cmake @@ -0,0 +1,12 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +include(cmake/Platform/Common/Install_common.cmake) \ No newline at end of file diff --git a/cmake/Platform/Linux/platform_linux_files.cmake b/cmake/Platform/Linux/platform_linux_files.cmake index 678d2961e5..8b6bdf1361 100644 --- a/cmake/Platform/Linux/platform_linux_files.cmake +++ b/cmake/Platform/Linux/platform_linux_files.cmake @@ -12,7 +12,9 @@ set(FILES ../Common/Configurations_common.cmake ../Common/Clang/Configurations_clang.cmake + ../Common/Install_common.cmake Configurations_linux.cmake + Install_linux.cmake LYTestWrappers_linux.cmake LYWrappers_linux.cmake PAL_linux.cmake diff --git a/cmake/Platform/Mac/Install_mac.cmake b/cmake/Platform/Mac/Install_mac.cmake new file mode 100644 index 0000000000..8c96c199de --- /dev/null +++ b/cmake/Platform/Mac/Install_mac.cmake @@ -0,0 +1,21 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +# Empty implementations for untested platforms to fix build errors. + +function(ly_install_target ly_install_target_NAME) + +endfunction() + + +function(ly_setup_o3de_install) + +endfunction() \ No newline at end of file diff --git a/cmake/Platform/Mac/platform_mac_files.cmake b/cmake/Platform/Mac/platform_mac_files.cmake index 30c89d0f4c..82e2827623 100644 --- a/cmake/Platform/Mac/platform_mac_files.cmake +++ b/cmake/Platform/Mac/platform_mac_files.cmake @@ -13,6 +13,7 @@ set(FILES ../Common/Configurations_common.cmake ../Common/Clang/Configurations_clang.cmake Configurations_mac.cmake + Install_mac.cmake LYTestWrappers_mac.cmake LYWrappers_mac.cmake PAL_mac.cmake diff --git a/cmake/Platform/Windows/Install_windows.cmake b/cmake/Platform/Windows/Install_windows.cmake new file mode 100644 index 0000000000..8473ba1d0e --- /dev/null +++ b/cmake/Platform/Windows/Install_windows.cmake @@ -0,0 +1,12 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +include(cmake/Platform/Common/Install_common.cmake) \ No newline at end of file diff --git a/cmake/Platform/Windows/platform_windows_files.cmake b/cmake/Platform/Windows/platform_windows_files.cmake index 3310972cee..bf9cb05d17 100644 --- a/cmake/Platform/Windows/platform_windows_files.cmake +++ b/cmake/Platform/Windows/platform_windows_files.cmake @@ -14,6 +14,7 @@ set(FILES ../Common/VisualStudio_common.cmake ../Common/Configurations_common.cmake ../Common/MSVC/Configurations_msvc.cmake + ../Common/Install_common.cmake ../Common/LYWrappers_default.cmake ../Common/TargetIncludeSystemDirectories_unsupported.cmake Configurations_windows.cmake @@ -21,4 +22,5 @@ set(FILES LYWrappers_windows.cmake PAL_windows.cmake PALDetection_windows.cmake + Install_windows.cmake ) diff --git a/cmake/Platform/iOS/Install_ios.cmake b/cmake/Platform/iOS/Install_ios.cmake new file mode 100644 index 0000000000..8c96c199de --- /dev/null +++ b/cmake/Platform/iOS/Install_ios.cmake @@ -0,0 +1,21 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +# Empty implementations for untested platforms to fix build errors. + +function(ly_install_target ly_install_target_NAME) + +endfunction() + + +function(ly_setup_o3de_install) + +endfunction() \ No newline at end of file diff --git a/cmake/Platform/iOS/platform_ios_files.cmake b/cmake/Platform/iOS/platform_ios_files.cmake index 1e8b18d0ea..ca14b5e80f 100644 --- a/cmake/Platform/iOS/platform_ios_files.cmake +++ b/cmake/Platform/iOS/platform_ios_files.cmake @@ -13,6 +13,7 @@ set(FILES ../Common/Configurations_common.cmake ../Common/Clang/Configurations_clang.cmake Configurations_ios.cmake + Install_ios.cmake LYTestWrappers_ios.cmake LYWrappers_ios.cmake PAL_ios.cmake diff --git a/cmake/SettingsRegistry.cmake b/cmake/SettingsRegistry.cmake index fda8428cbb..fd5985a5a1 100644 --- a/cmake/SettingsRegistry.cmake +++ b/cmake/SettingsRegistry.cmake @@ -10,7 +10,7 @@ # # Responsible for generating a settings registry file containing the moduleload dependencies of any ly_delayed_load_targets -# This is used for example, to allow Lumberyard Applications to know which set of gems have built for a particular project/target +# This is used for example, to allow Open 3D Engine Applications to know which set of gems have built for a particular project/target # combination include_guard() diff --git a/cmake/Tools/Platform/Android/android_support.py b/cmake/Tools/Platform/Android/android_support.py index d98aee177c..6443077457 100755 --- a/cmake/Tools/Platform/Android/android_support.py +++ b/cmake/Tools/Platform/Android/android_support.py @@ -787,14 +787,14 @@ class AndroidProjectGenerator(object): gradle_build_env[f'CUSTOM_APPLY_ASSET_LAYOUT_{native_config_upper}_TASK'] = \ CUSTOM_GRADLE_COPY_NATIVE_CONFIG_BUILD_ARTIFACTS_FORMAT_STR.format(config=native_config, config_lower=native_config_lower, - asset_layout_folder=(self.build_dir / 'app/src/main/assets').as_posix(), + asset_layout_folder=(self.build_dir / 'app/src/main/assets').resolve().as_posix(), file_includes='Test.Assets/**/*.*') else: # Copy over settings registry files from the Registry folder with build output directory gradle_build_env[f'CUSTOM_APPLY_ASSET_LAYOUT_{native_config_upper}_TASK'] = \ CUSTOM_GRADLE_COPY_NATIVE_CONFIG_BUILD_ARTIFACTS_FORMAT_STR.format(config=native_config, config_lower=native_config_lower, - asset_layout_folder=(self.build_dir / 'app/src/main/assets').as_posix(), + asset_layout_folder=(self.build_dir / 'app/src/main/assets').resolve().as_posix(), file_includes='**/Registry/*.setreg') if self.include_assets_in_apk: @@ -805,7 +805,7 @@ class AndroidProjectGenerator(object): asset_type=self.asset_type, project_path=self.project_path.as_posix(), asset_mode=self.asset_mode if native_config != 'Release' else 'PAK', - asset_layout_folder=common.normalize_path_for_settings(self.build_dir / 'app/src/main/assets'), + asset_layout_folder=(self.build_dir / 'app/src/main/assets').resolve().as_posix(), config=native_config) else: gradle_build_env[f'CUSTOM_APPLY_ASSET_LAYOUT_{native_config_upper}_TASK'] = '' diff --git a/cmake/Tools/Platform/Android/generate_android_project.py b/cmake/Tools/Platform/Android/generate_android_project.py index 28c6d7c601..f3f6a3acda 100755 --- a/cmake/Tools/Platform/Android/generate_android_project.py +++ b/cmake/Tools/Platform/Android/generate_android_project.py @@ -28,7 +28,7 @@ from cmake.Tools.Platform.Android import android_support GRADLE_ARGUMENT_NAME = '--gradle-install-path' GRADLE_MIN_VERSION = LooseVersion('4.10.1') -GRADLE_MAX_VERSION = LooseVersion('5.6.4') +GRADLE_MAX_VERSION = LooseVersion('7.0.0') GRADLE_VERSION_REGEX = re.compile(r"Gradle\s(\d+.\d+.?\d*)") GRADLE_EXECUTABLE = 'gradle.bat' if platform.system() == 'Windows' else 'gradle' diff --git a/cmake/UnitTest.cmake b/cmake/UnitTest.cmake index 096f0f7e7e..c867f9dc18 100644 --- a/cmake/UnitTest.cmake +++ b/cmake/UnitTest.cmake @@ -39,7 +39,7 @@ set(CTEST_RUN_FLAGS ${CTEST_RUN_FLAGS_STRING} CACHE STRING "Command line argumen set(CMAKE_CTEST_ARGUMENTS ${CTEST_RUN_FLAGS} -LE SUITE_benchmark) #! ly_add_suite_build_and_run_targets - Add CMake Targets for associating dependencies with each -# suite of test supported by Lumberyard +# suite of test supported by Open 3D Engine function(ly_add_suite_build_and_run_targets) if(NOT PAL_TRAIT_BUILD_TESTS_SUPPORTED) return() diff --git a/cmake/Version.cmake b/cmake/Version.cmake index ade3d86318..08d79d4ce6 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -10,6 +10,6 @@ # string(TIMESTAMP current_year "%Y") -set(LY_VERSION_COPYRIGHT_YEAR ${current_year} CACHE STRING "Lumberyard's copyright year") -set(LY_VERSION_STRING "0.0.0.0" CACHE STRING "Lumberyard's version") -set(LY_VERSION_BUILD_NUMBER 0 CACHE STRING "Lumberyard's build number") \ No newline at end of file +set(LY_VERSION_COPYRIGHT_YEAR ${current_year} CACHE STRING "Open 3D Engine's copyright year") +set(LY_VERSION_STRING "0.0.0.0" CACHE STRING "Open 3D Engine's version") +set(LY_VERSION_BUILD_NUMBER 0 CACHE STRING "Open 3D Engine's build number") \ No newline at end of file diff --git a/cmake/cmake_files.cmake b/cmake/cmake_files.cmake index 03b6c1d990..2b0f65ca99 100644 --- a/cmake/cmake_files.cmake +++ b/cmake/cmake_files.cmake @@ -19,6 +19,7 @@ set(FILES EngineFinder.cmake FileUtil.cmake Findo3de.cmake + Install.cmake LyAutoGen.cmake LySet.cmake LYTestWrappers.cmake diff --git a/engine.json b/engine.json index ed6677d795..5091605f4c 100644 --- a/engine.json +++ b/engine.json @@ -1,6 +1,6 @@ { "engine_name": "o3de", "FileVersion": 1, - "LumberyardVersion": "0.0.0.0", - "LumberyardCopyrightYear": 2021 + "O3DEVersion": "0.0.0.0", + "O3DECopyrightYear": 2021 } diff --git a/scripts/build/package/Platform/3rdParty/package_filelists/3rdParty.json b/scripts/build/package/Platform/3rdParty/package_filelists/3rdParty.json index eed4c45fcb..26733303a6 100644 --- a/scripts/build/package/Platform/3rdParty/package_filelists/3rdParty.json +++ b/scripts/build/package/Platform/3rdParty/package_filelists/3rdParty.json @@ -4,6 +4,7 @@ "AWS/AWSNativeSDK/1.7.167-az.2/**": "#include", "AWS/GameLift/3.4.0/**": "#include", "civetweb/civetweb-20160922-az.2/**": "#include", + "CMake/3.19.1/**": "#include", "DirectXShaderCompiler/1.0.1-az.1/**": "#include", "DirectXShaderCompiler/2020.08.07/**": "#include", "DirectXShaderCompiler/5.0.0-az/**": "#include", @@ -13,7 +14,6 @@ "FbxSdk/2016.1.2-az.1/**": "#include", "libav/11.7/**": "#include", "OpenSSL/1.1.1b-noasm-az/**": "#include", - "Qt/5.15.1.2-az/**": "#include", "RadTelemetry/3.5.0.17/**": "#include", "tiff/3.9.5-az.3/**": "#include", diff --git a/scripts/build/package/Platform/Mac/package_env.json b/scripts/build/package/Platform/Mac/package_env.json index 642c39d625..f21c9fdaab 100644 --- a/scripts/build/package/Platform/Mac/package_env.json +++ b/scripts/build/package/Platform/Mac/package_env.json @@ -1,5 +1,7 @@ { - "local_env": {}, + "local_env": { + "S3_PREFIX": "${BRANCH_NAME}/Mac" + }, "types":{ "all":{ "PACKAGE_TARGETS":[ @@ -7,6 +9,16 @@ "FILE_LIST": "all.json", "FILE_LIST_TYPE": "All", "PACKAGE_NAME": "${PACKAGE_NAME_PATTERN}-mac-all-${BUILD_NUMBER}.zip" + }, + { + "FILE_LIST": "3rdParty.json", + "FILE_LIST_TYPE": "Mac", + "PACKAGE_NAME": "${PACKAGE_NAME_PATTERN}-mac-3rdParty-${BUILD_NUMBER}.zip" + }, + { + "FILE_LIST": "3rdParty.json", + "FILE_LIST_TYPE": "3rdParty", + "PACKAGE_NAME": "${PACKAGE_NAME_PATTERN}-mac-3rdParty-Warsaw-${BUILD_NUMBER}.zip" } ], "BOOTSTRAP_CFG_GAME_FOLDER":"CMakeTestbed", diff --git a/scripts/build/package/Platform/Mac/package_filelists/3rdParty.json b/scripts/build/package/Platform/Mac/package_filelists/3rdParty.json new file mode 100644 index 0000000000..ff019f701f --- /dev/null +++ b/scripts/build/package/Platform/Mac/package_filelists/3rdParty.json @@ -0,0 +1,82 @@ +{ + "@3rdParty":{ + "3rdParty.txt":"#include", + "AWS/AWSNativeSDK/1.7.167-az.2":{ + "*":"#include", + "include/**":"#include", + "LICENSE*":"#include", + "lib/mac/**":"#include", + "bin/mac/**":"#include", + "lib/ios/**":"#include", + "bin/ios/**":"#include" + }, + "DirectXShaderCompiler/1.0.1-az.1":{ + "*":"#include", + "src/**":"#include", + "bin/darwin_x64/**":"#include" + }, + "DirectXShaderCompiler/2020.08.07":{ + "*":"#include", + "bin/darwin_x64/**":"#include" + }, + "DirectXShaderCompiler/5.0.0-az":{ + "*":"#include", + "bin/darwin_x64/**":"#include" + }, + "etc2comp/2017_04_24-az.2":{ + "*":"#include", + "EtcLib/Etc/**":"#include", + "EtcLib/EtcCodec/**":"#include", + "EtcLib/*":"#include", + "EtcLib/OSX_x86/**":"#include" + }, + "expat/2.1.0-pkg.3":{ + "*":"#include", + "amiga/**":"#include", + "bcb5/**":"#include", + "conftools/**":"#include", + "doc/**":"#include", + "examples/**":"#include", + "lib/**":"#include", + "m4/**":"#include", + "tests/**":"#include", + "vms/**":"#include", + "win32/**":"#include", + "xmlwf/**":"#include", + "build/osx/**":"#include" + }, + "FreeType2/2.5.0.1-pkg.3":{ + "freetype-2.5.0.1/**":"#include", + "dist/**":"#include", + "mac/**":"#include", + "ios*/**":"#include", + "build/osx/**":"#include" + }, + "Redistributables/FbxSdk/2016.1.2":{ + "*mac*":"#include" + }, + "OpenSSL/1.1.1b-noasm-az":{ + "include/**":"#include", + "ssl/**":"#include", + "LICENSE":"#include", + "bin/**":"#include", + "lib/darwin*/**":"#include", + "lib/ios*/**":"#include" + }, + "Qt/5.15.1.2-az":{ + "LICENSE":"#include", + "LGPL_EXCEPTION.TXT":"#include", + "LICENSE.GPLV3":"#include", + "LICENSE.LGPLV3":"#include", + "QT-NOTICE.TXT":"#include", + "clang_64/**":"#include" + }, + "tiff/3.9.5-az.3":{ + "COPYRIGHT":"#include", + "README":"#include", + "RELEASE-DATE":"#include", + "VERSION":"#include", + "libtiff/macosx_clang/**":"#include" + } + } +} \ No newline at end of file From 774580cea2d399814cd83881438d2426dd861c96 Mon Sep 17 00:00:00 2001 From: alexpete Date: Tue, 13 Apr 2021 17:30:43 -0700 Subject: [PATCH 5/5] Updating README to mention 3p rev13 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9246104a29..caed4b515c 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ If you have the Git credential manager core installed, you should not be prompte ### Build Steps -1. Download the 3rdParty zip file from here: **[https://d2c171ws20a1rv.cloudfront.net/3rdParty-windows-no-symbols-rev12.zip](https://d2c171ws20a1rv.cloudfront.net/3rdParty-windows-no-symbols-rev12.zip)** +1. Download the 3rdParty zip file from here: **[https://d2c171ws20a1rv.cloudfront.net/3rdParty-windows-no-symbols-rev13.zip](https://d2c171ws20a1rv.cloudfront.net/3rdParty-windows-no-symbols-rev13.zip)** 2. Unzip this file into a writable folder. This will also act as a cache location for the 3rdParty downloader by default (configurable with the `LY_PACKAGE_DOWNLOAD_CACHE_LOCATION` environment variable) 3. Install the following redistributables to the following: - Visual Studio and VC++ redistributable can be installed to any location