Merge branch 'main' into modify_test_timeout
This commit is contained in:
@@ -16,39 +16,53 @@
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME})
|
||||
|
||||
add_subdirectory(assetpipeline)
|
||||
add_subdirectory(atom_renderer)
|
||||
|
||||
## Physics ##
|
||||
# DISABLED - see LYN-2536
|
||||
#if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
# ly_add_pytest(
|
||||
# NAME AutomatedTesting::PhysicsTests
|
||||
# TEST_SUITE main
|
||||
# TEST_SERIAL
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Active.py
|
||||
# TIMEOUT 1500
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# Legacy::Editor
|
||||
# Legacy::CryRenderNULL
|
||||
# AZ::AssetProcessor
|
||||
# AutomatedTesting.Assets
|
||||
# COMPONENT
|
||||
# Physics
|
||||
# )
|
||||
# ly_add_pytest(
|
||||
# NAME AutomatedTesting::PhysicsTests_Sandbox
|
||||
# TEST_SUITE sandbox
|
||||
# TEST_SERIAL
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Sandbox.py
|
||||
# TIMEOUT 1500
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# Legacy::Editor
|
||||
# Legacy::CryRenderNULL
|
||||
# AZ::AssetProcessor
|
||||
# AutomatedTesting.Assets
|
||||
# COMPONENT
|
||||
# Physics
|
||||
# )
|
||||
#endif()
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PhysicsTests_Main
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Main.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
Legacy::CryRenderNULL
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Physics
|
||||
)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PhysicsTests_Periodic
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Periodic.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
Legacy::CryRenderNULL
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Physics
|
||||
)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PhysicsTests_Sandbox
|
||||
TEST_SUITE sandbox
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Sandbox.py
|
||||
TIMEOUT 3600
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
Legacy::CryRenderNULL
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Physics
|
||||
)
|
||||
endif()
|
||||
|
||||
## ScriptCanvas ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
@@ -177,8 +191,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
|
||||
|
||||
## DynVeg ##
|
||||
ly_add_pytest(
|
||||
NAME DynamicVegetationTests_Main_GPU
|
||||
TEST_REQUIRES gpu
|
||||
NAME AutomatedTesting::DynamicVegetationTests_Main
|
||||
TEST_SERIAL
|
||||
TEST_SUITE main
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
|
||||
@@ -194,8 +207,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME DynamicVegetationTests_Sandbox_GPU
|
||||
TEST_REQUIRES gpu
|
||||
NAME AutomatedTesting::DynamicVegetationTests_Sandbox
|
||||
TEST_SERIAL
|
||||
TEST_SUITE sandbox
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
|
||||
@@ -211,8 +223,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME DynamicVegetationTests_Periodic_GPU
|
||||
TEST_REQUIRES gpu
|
||||
NAME AutomatedTesting::DynamicVegetationTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg
|
||||
@@ -228,8 +239,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
|
||||
|
||||
## LandscapeCanvas ##
|
||||
ly_add_pytest(
|
||||
NAME LandscapeCanvasTests_Main
|
||||
TEST_REQUIRES gpu
|
||||
NAME AutomatedTesting::LandscapeCanvasTests_Main
|
||||
TEST_SERIAL
|
||||
TEST_SUITE main
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
|
||||
@@ -244,8 +254,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME LandscapeCanvasTests_Periodic
|
||||
TEST_REQUIRES gpu
|
||||
NAME AutomatedTesting::LandscapeCanvasTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
|
||||
@@ -261,8 +270,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
|
||||
|
||||
## GradientSignal ##
|
||||
ly_add_pytest(
|
||||
NAME GradientSignalTests_Periodic
|
||||
TEST_REQUIRES gpu
|
||||
NAME AutomatedTesting::GradientSignalTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/gradient_signal
|
||||
@@ -280,7 +288,7 @@ endif()
|
||||
## Editor ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_FOUNDATION_TEST_SUPPORTED)
|
||||
ly_add_pytest(
|
||||
NAME EditorTests_Periodic
|
||||
NAME AutomatedTesting::EditorTests_Periodic
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/editor
|
||||
@@ -298,7 +306,7 @@ endif()
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
# Unstable, SPEC-3838 will restore
|
||||
#ly_add_pytest(
|
||||
# NAME asset_load_benchmark_test
|
||||
# NAME AutomatedTesting::asset_load_benchmark_test
|
||||
# TEST_SERIAL
|
||||
# TEST_SUITE benchmark
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/streaming/benchmark/asset_load_benchmark_test.py
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ def teardown_editor(editor):
|
||||
|
||||
|
||||
def launch_and_validate_results(request, test_directory, editor, editor_script, expected_lines, unexpected_lines=[],
|
||||
halt_on_unexpected=False, run_python="--runpythontest", auto_test_mode=True, null_renderer=False, cfg_args=[],
|
||||
halt_on_unexpected=False, run_python="--runpythontest", auto_test_mode=True, null_renderer=True, cfg_args=[],
|
||||
timeout=300):
|
||||
"""
|
||||
Runs the Editor with the specified script, and monitors for expected log lines.
|
||||
@@ -58,7 +58,7 @@ def launch_and_validate_results(request, test_directory, editor, editor_script,
|
||||
if auto_test_mode:
|
||||
editor.args.extend(["--autotest_mode"])
|
||||
if null_renderer:
|
||||
editor.args.extend(["-NullRenderer"])
|
||||
editor.args.extend(["-rhi=Null"])
|
||||
|
||||
with editor.start():
|
||||
|
||||
|
||||
+18
@@ -278,6 +278,12 @@ class Tracer:
|
||||
self.function = args[3]
|
||||
self.message = args[4]
|
||||
|
||||
def __str__(self):
|
||||
return f"Warning: [{self.filename}:{self.function}:{self.line}]: [{self.window}] {self.message}"
|
||||
|
||||
def __repr__(self):
|
||||
return f"[Warning: {self.message}]"
|
||||
|
||||
class ErrorInfo:
|
||||
def __init__(self, args):
|
||||
self.window = args[0]
|
||||
@@ -285,6 +291,12 @@ class Tracer:
|
||||
self.line = args[2]
|
||||
self.function = args[3]
|
||||
self.message = args[4]
|
||||
|
||||
def __str__(self):
|
||||
return f"Error: [{self.filename}:{self.function}:{self.line}]: [{self.window}] {self.message}"
|
||||
|
||||
def __repr__(self):
|
||||
return f"[Error: {self.message}]"
|
||||
|
||||
class AssertInfo:
|
||||
def __init__(self, args):
|
||||
@@ -292,6 +304,12 @@ class Tracer:
|
||||
self.line = args[1]
|
||||
self.function = args[2]
|
||||
self.message = args[3]
|
||||
|
||||
def __str__(self):
|
||||
return f"Assert: [{self.filename}:{self.function}:{self.line}]: {self.message}"
|
||||
|
||||
def __repr__(self):
|
||||
return f"[Assert: {self.message}]"
|
||||
|
||||
def _on_warning(self, args):
|
||||
warningInfo = Tracer.WarningInfo(args)
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Atom Renderer: Automated Tests
|
||||
# Runs EditorPythonBindings (hydra) scripts inside the Editor to verify test results for the Atom renderer.
|
||||
################################################################################
|
||||
|
||||
if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED AND AutomatedTesting IN_LIST LY_PROJECTS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::AtomRenderer_HydraTests_Main
|
||||
TEST_SUITE main
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/test_Atom_MainSuite.py
|
||||
TEST_SERIAL
|
||||
TIMEOUT 300
|
||||
RUNTIME_DEPENDENCIES
|
||||
AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
Editor
|
||||
)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::AtomRenderer_HydraTests_Sandbox
|
||||
TEST_SUITE sandbox
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/test_Atom_SandboxSuite.py
|
||||
TEST_SERIAL
|
||||
TIMEOUT 300
|
||||
RUNTIME_DEPENDENCIES
|
||||
AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
Editor
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,10 @@
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
@@ -0,0 +1,10 @@
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
+271
@@ -0,0 +1,271 @@
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
|
||||
# This module does a bulk test and update of many components at once.
|
||||
# Each test case is listed below in the format:
|
||||
# "Test Case ID: Test Case Title (URL)"
|
||||
|
||||
# C32078130: Tone Mapper (https://testrail.agscollab.com/index.php?/cases/view/32078130)
|
||||
# C32078129: Light (https://testrail.agscollab.com/index.php?/cases/view/32078129)
|
||||
# C32078131: Radius Weight Modifier (https://testrail.agscollab.com/index.php?/cases/view/32078131)
|
||||
# C32078127: PostFX Layer (https://testrail.agscollab.com/index.php?/cases/view/32078127)
|
||||
# C32078126: Point Light (https://testrail.agscollab.com/index.php?/cases/view/32078126)
|
||||
# C32078125: Physical Sky (https://testrail.agscollab.com/index.php?/cases/view/32078125)
|
||||
# C32078115: Global Skylight (IBL) (https://testrail.agscollab.com/index.php?/cases/view/32078115)
|
||||
# C32078121: Exposure Control (https://testrail.agscollab.com/index.php?/cases/view/32078121)
|
||||
# C32078120: Directional Light (https://testrail.agscollab.com/index.php?/cases/view/32078120)
|
||||
# C32078119: DepthOfField (https://testrail.agscollab.com/index.php?/cases/view/32078119)
|
||||
# C32078118: Decal (https://testrail.agscollab.com/index.php?/cases/view/32078118)
|
||||
# C32078117: Area Light (https://testrail.agscollab.com/index.php?/cases/view/32078117)
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import azlmbr.math as math
|
||||
import azlmbr.bus as bus
|
||||
import azlmbr.paths
|
||||
import azlmbr.asset as asset
|
||||
import azlmbr.entity as entity
|
||||
import azlmbr.legacy.general as general
|
||||
import azlmbr.editor as editor
|
||||
|
||||
sys.path.append(os.path.join(azlmbr.paths.devroot, "AutomatedTesting", "Gem", "PythonTests"))
|
||||
|
||||
import editor_python_test_tools.hydra_editor_utils as hydra
|
||||
from editor_python_test_tools.utils import TestHelper
|
||||
from editor_python_test_tools.editor_test_helper import EditorTestHelper
|
||||
|
||||
|
||||
EditorTestHelper = EditorTestHelper(log_prefix="AtomEditorComponents")
|
||||
|
||||
|
||||
def run():
|
||||
"""
|
||||
Summary:
|
||||
The below common tests are done for each of the components.
|
||||
1) Addition of component to the entity
|
||||
2) UNDO/REDO of addition of component
|
||||
3) Enter/Exit game mode
|
||||
4) Hide/Show entity containing component
|
||||
5) Deletion of component
|
||||
6) UNDO/REDO of deletion of component
|
||||
Some additional tests for specific components include
|
||||
1) Assigning value to some properties of each component
|
||||
2) Verifying if the component is activated only when the required components are added
|
||||
|
||||
Expected Result:
|
||||
1) Component can be added to an entity.
|
||||
2) The addition of component can be undone and redone.
|
||||
3) Game mode can be entered/exited without issue.
|
||||
4) Entity with component can be hidden/shown.
|
||||
5) Component can be deleted.
|
||||
6) The deletion of component can be undone and redone.
|
||||
7) Component is activated only when the required components are added
|
||||
8) Values can be assigned to the properties of the component
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
def create_entity_undo_redo_component_addition(component_name):
|
||||
new_entity = hydra.Entity(f"{component_name}")
|
||||
new_entity.create_entity(math.Vector3(512.0, 512.0, 34.0), [component_name])
|
||||
general.log(f"{component_name}_test: Component added to the entity: "
|
||||
f"{hydra.has_components(new_entity.id, [component_name])}")
|
||||
|
||||
# undo component addition
|
||||
general.undo()
|
||||
TestHelper.wait_for_condition(lambda: not hydra.has_components(new_entity.id, [component_name]), 2.0)
|
||||
general.log(f"{component_name}_test: Component removed after UNDO: "
|
||||
f"{not hydra.has_components(new_entity.id, [component_name])}")
|
||||
|
||||
# redo component addition
|
||||
general.redo()
|
||||
TestHelper.wait_for_condition(lambda: hydra.has_components(new_entity.id, [component_name]), 2.0)
|
||||
general.log(f"{component_name}_test: Component added after REDO: "
|
||||
f"{hydra.has_components(new_entity.id, [component_name])}")
|
||||
|
||||
return new_entity
|
||||
|
||||
def verify_enter_exit_game_mode(component_name):
|
||||
general.enter_game_mode()
|
||||
TestHelper.wait_for_condition(lambda: general.is_in_game_mode(), 1.0)
|
||||
general.log(f"{component_name}_test: Entered game mode: {general.is_in_game_mode()}")
|
||||
general.exit_game_mode()
|
||||
TestHelper.wait_for_condition(lambda: not general.is_in_game_mode(), 1.0)
|
||||
general.log(f"{component_name}_test: Exit game mode: {not general.is_in_game_mode()}")
|
||||
|
||||
def verify_hide_unhide_entity(component_name, entity_obj):
|
||||
|
||||
def is_entity_hidden(entity_id):
|
||||
return editor.EditorEntityInfoRequestBus(bus.Event, "IsHidden", entity_id)
|
||||
|
||||
editor.EditorEntityAPIBus(bus.Event, "SetVisibilityState", entity_obj.id, False)
|
||||
general.idle_wait_frames(1)
|
||||
general.log(f"{component_name}_test: Entity is hidden: {is_entity_hidden(entity_obj.id)}")
|
||||
editor.EditorEntityAPIBus(bus.Event, "SetVisibilityState", entity_obj.id, True)
|
||||
general.idle_wait_frames(1)
|
||||
general.log(f"{component_name}_test: Entity is shown: {not is_entity_hidden(entity_obj.id)}")
|
||||
|
||||
def verify_deletion_undo_redo(component_name, entity_obj):
|
||||
editor.ToolsApplicationRequestBus(bus.Broadcast, "DeleteEntityById", entity_obj.id)
|
||||
TestHelper.wait_for_condition(lambda: not hydra.find_entity_by_name(entity_obj.name), 1.0)
|
||||
general.log(f"{component_name}_test: Entity deleted: {not hydra.find_entity_by_name(entity_obj.name)}")
|
||||
|
||||
general.undo()
|
||||
TestHelper.wait_for_condition(lambda: hydra.find_entity_by_name(entity_obj.name) is not None, 1.0)
|
||||
general.log(f"{component_name}_test: UNDO entity deletion works: "
|
||||
f"{hydra.find_entity_by_name(entity_obj.name) is not None}")
|
||||
|
||||
general.redo()
|
||||
TestHelper.wait_for_condition(lambda: not hydra.find_entity_by_name(entity_obj.name), 1.0)
|
||||
general.log(f"{component_name}_test: REDO entity deletion works: "
|
||||
f"{not hydra.find_entity_by_name(entity_obj.name)}")
|
||||
|
||||
def verify_required_component_addition(entity_obj, components_to_add, component_name):
|
||||
|
||||
def is_component_enabled(entity_componentid_pair):
|
||||
return editor.EditorComponentAPIBus(bus.Broadcast, "IsComponentEnabled", entity_componentid_pair)
|
||||
|
||||
general.log(
|
||||
f"{component_name}_test: Entity disabled initially: "
|
||||
f"{not is_component_enabled(entity_obj.components[0])}")
|
||||
for component in components_to_add:
|
||||
entity_obj.add_component(component)
|
||||
TestHelper.wait_for_condition(lambda: is_component_enabled(entity_obj.components[0]), 1.0)
|
||||
general.log(
|
||||
f"{component_name}_test: Entity enabled after adding "
|
||||
f"required components: {is_component_enabled(entity_obj.components[0])}"
|
||||
)
|
||||
|
||||
def verify_set_property(entity_obj, path, value):
|
||||
entity_obj.get_set_test(0, path, value)
|
||||
|
||||
# Wait for Editor idle loop before executing Python hydra scripts.
|
||||
TestHelper.init_idle()
|
||||
|
||||
# Create a new level.
|
||||
new_level_name = "tmp_level" # Specified in TestAllComponentsBasicTests.py
|
||||
heightmap_resolution = 512
|
||||
heightmap_meters_per_pixel = 1
|
||||
terrain_texture_resolution = 412
|
||||
use_terrain = False
|
||||
|
||||
# Return codes are ECreateLevelResult defined in CryEdit.h
|
||||
return_code = general.create_level_no_prompt(
|
||||
new_level_name, heightmap_resolution, heightmap_meters_per_pixel, terrain_texture_resolution, use_terrain)
|
||||
if return_code == 1:
|
||||
general.log(f"{new_level_name} level already exists")
|
||||
elif return_code == 2:
|
||||
general.log("Failed to create directory")
|
||||
elif return_code == 3:
|
||||
general.log("Directory length is too long")
|
||||
elif return_code != 0:
|
||||
general.log("Unknown error, failed to create level")
|
||||
else:
|
||||
general.log(f"{new_level_name} level created successfully")
|
||||
EditorTestHelper.after_level_load(bypass_viewport_resize=True)
|
||||
|
||||
# Delete all existing entities initially
|
||||
search_filter = azlmbr.entity.SearchFilter()
|
||||
all_entities = entity.SearchBus(azlmbr.bus.Broadcast, "SearchEntities", search_filter)
|
||||
editor.ToolsApplicationRequestBus(bus.Broadcast, "DeleteEntities", all_entities)
|
||||
|
||||
class ComponentTests:
|
||||
"""Test launcher for each component."""
|
||||
def __init__(self, component_name, *additional_tests):
|
||||
self.component_name = component_name
|
||||
self.additional_tests = additional_tests
|
||||
self.run_component_tests()
|
||||
|
||||
def run_component_tests(self):
|
||||
# Run common and additional tests
|
||||
entity_obj = create_entity_undo_redo_component_addition(self.component_name)
|
||||
|
||||
# Enter/Exit game mode test
|
||||
verify_enter_exit_game_mode(self.component_name)
|
||||
|
||||
# Any additional tests are executed here
|
||||
for test in self.additional_tests:
|
||||
test(entity_obj)
|
||||
|
||||
# Hide/Unhide entity test
|
||||
verify_hide_unhide_entity(self.component_name, entity_obj)
|
||||
|
||||
# Deletion/Undo/Redo test
|
||||
verify_deletion_undo_redo(self.component_name, entity_obj)
|
||||
|
||||
# Area Light Component
|
||||
area_light = "Area Light"
|
||||
ComponentTests(
|
||||
area_light, lambda entity_obj: verify_required_component_addition(
|
||||
entity_obj, ["Capsule Shape"], area_light))
|
||||
|
||||
# Decal Component
|
||||
material_asset_path = os.path.join("Materials", "decal", "aiirship_nose_number_decal.material")
|
||||
material_asset = asset.AssetCatalogRequestBus(
|
||||
bus.Broadcast, "GetAssetIdByPath", material_asset_path, math.Uuid(), False)
|
||||
ComponentTests(
|
||||
"Decal", lambda entity_obj: verify_set_property(
|
||||
entity_obj, "Settings|Decal Settings|Material", material_asset))
|
||||
|
||||
# DepthOfField Component
|
||||
camera_entity = hydra.Entity("camera_entity")
|
||||
camera_entity.create_entity(math.Vector3(512.0, 512.0, 34.0), ["Camera"])
|
||||
depth_of_field = "DepthOfField"
|
||||
ComponentTests(
|
||||
depth_of_field,
|
||||
lambda entity_obj: verify_required_component_addition(entity_obj, ["PostFX Layer"], depth_of_field),
|
||||
lambda entity_obj: verify_set_property(
|
||||
entity_obj, "Controller|Configuration|Camera Entity", camera_entity.id))
|
||||
|
||||
# Directional Light Component
|
||||
ComponentTests(
|
||||
"Directional Light",
|
||||
lambda entity_obj: verify_set_property(
|
||||
entity_obj, "Controller|Configuration|Shadow|Camera", camera_entity.id))
|
||||
|
||||
# Exposure Control Component
|
||||
ComponentTests(
|
||||
"Exposure Control", lambda entity_obj: verify_required_component_addition(
|
||||
entity_obj, ["PostFX Layer"], "Exposure Control"))
|
||||
|
||||
# Global Skylight (IBL) Component
|
||||
diffuse_image_path = os.path.join("LightingPresets", "greenwich_park_02_4k_iblskyboxcm.exr.streamingimage")
|
||||
diffuse_image_asset = asset.AssetCatalogRequestBus(
|
||||
bus.Broadcast, "GetAssetIdByPath", diffuse_image_path, math.Uuid(), False)
|
||||
specular_image_path = os.path.join("LightingPresets", "greenwich_park_02_4k_iblskyboxcm.exr.streamingimage")
|
||||
specular_image_asset = asset.AssetCatalogRequestBus(
|
||||
bus.Broadcast, "GetAssetIdByPath", specular_image_path, math.Uuid(), False)
|
||||
ComponentTests(
|
||||
"Global Skylight (IBL)",
|
||||
lambda entity_obj: verify_set_property(
|
||||
entity_obj, "Controller|Configuration|Diffuse Image", diffuse_image_asset),
|
||||
lambda entity_obj: verify_set_property(
|
||||
entity_obj, "Controller|Configuration|Specular Image", specular_image_asset))
|
||||
|
||||
# Physical Sky Component
|
||||
ComponentTests("Physical Sky")
|
||||
|
||||
# Point Light Component
|
||||
ComponentTests("Point Light")
|
||||
|
||||
# PostFX Layer Component
|
||||
ComponentTests("PostFX Layer")
|
||||
|
||||
# Radius Weight Modifier Component
|
||||
ComponentTests("Radius Weight Modifier")
|
||||
|
||||
# Spot Light Component
|
||||
ComponentTests("Light")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
@@ -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.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
import pytest
|
||||
|
||||
import ly_test_tools.environment.file_system as file_system
|
||||
|
||||
import editor_python_test_tools.hydra_test_utils as hydra
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
EDITOR_TIMEOUT = 60
|
||||
TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "atom_hydra_scripts")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("level", ["tmp_level"])
|
||||
class TestAtomEditorComponents(object):
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_teardown(self, request, workspace, project, level):
|
||||
# Cleanup our temp level
|
||||
file_system.delete(
|
||||
[os.path.join(workspace.paths.engine_root(), project, "Levels", "AtomLevels", level)], True, True)
|
||||
|
||||
def teardown():
|
||||
# Cleanup our temp level
|
||||
file_system.delete(
|
||||
[os.path.join(workspace.paths.engine_root(), project, "Levels", "AtomLevels", level)], True, True)
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
# It requires at least one test
|
||||
def test_Dummy(self, request, editor, level, workspace, project, launcher_platform):
|
||||
pass
|
||||
@@ -0,0 +1,219 @@
|
||||
"""
|
||||
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 logging
|
||||
import os
|
||||
import pytest
|
||||
|
||||
import ly_test_tools.environment.file_system as file_system
|
||||
|
||||
import editor_python_test_tools.hydra_test_utils as hydra
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
EDITOR_TIMEOUT = 60
|
||||
TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "atom_hydra_scripts")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("level", ["tmp_level"])
|
||||
class TestAtomEditorComponents(object):
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_teardown(self, request, workspace, project, level):
|
||||
# Cleanup our temp level
|
||||
file_system.delete(
|
||||
[os.path.join(workspace.paths.engine_root(), project, "Levels", "AtomLevels", level)], True, True)
|
||||
|
||||
def teardown():
|
||||
# Cleanup our temp level
|
||||
file_system.delete(
|
||||
[os.path.join(workspace.paths.engine_root(), project, "Levels", "AtomLevels", level)], True, True)
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
@pytest.mark.test_case_id(
|
||||
"C32078130", # Tone Mapper
|
||||
"C32078129", # Light
|
||||
"C32078131", # Radius Weight Modifier
|
||||
"C32078127", # PostFX Layer
|
||||
"C32078126", # Point Light
|
||||
"C32078125", # Physical Sky
|
||||
"C32078115", # Global Skylight (IBL)
|
||||
"C32078121", # Exposure Control
|
||||
"C32078120", # Directional Light
|
||||
"C32078119", # DepthOfField
|
||||
"C32078118") # Decal
|
||||
def test_AtomEditorComponents_AddedToEntity(self, request, editor, level, workspace, project, launcher_platform):
|
||||
cfg_args = [level]
|
||||
|
||||
expected_lines = [
|
||||
# Area Light Component
|
||||
"Area Light Entity successfully created",
|
||||
"Area Light_test: Component added to the entity: True",
|
||||
"Area Light_test: Component removed after UNDO: True",
|
||||
"Area Light_test: Component added after REDO: True",
|
||||
"Area Light_test: Entered game mode: True",
|
||||
"Area Light_test: Entity enabled after adding required components: True",
|
||||
"Area Light_test: Entity is hidden: True",
|
||||
"Area Light_test: Entity is shown: True",
|
||||
"Area Light_test: Entity deleted: True",
|
||||
"Area Light_test: UNDO entity deletion works: True",
|
||||
"Area Light_test: REDO entity deletion works: True",
|
||||
# Decal Component
|
||||
"Decal Entity successfully created",
|
||||
"Decal_test: Component added to the entity: True",
|
||||
"Decal_test: Component removed after UNDO: True",
|
||||
"Decal_test: Component added after REDO: True",
|
||||
"Decal_test: Entered game mode: True",
|
||||
"Decal_test: Exit game mode: True",
|
||||
"Decal Settings|Decal Settings|Material: SUCCESS",
|
||||
"Decal_test: Entity is hidden: True",
|
||||
"Decal_test: Entity is shown: True",
|
||||
"Decal_test: Entity deleted: True",
|
||||
"Decal_test: UNDO entity deletion works: True",
|
||||
"Decal_test: REDO entity deletion works: True",
|
||||
# DepthOfField Component
|
||||
"DepthOfField Entity successfully created",
|
||||
"DepthOfField_test: Component added to the entity: True",
|
||||
"DepthOfField_test: Component removed after UNDO: True",
|
||||
"DepthOfField_test: Component added after REDO: True",
|
||||
"DepthOfField_test: Entered game mode: True",
|
||||
"DepthOfField_test: Exit game mode: True",
|
||||
"DepthOfField_test: Entity disabled initially: True",
|
||||
"DepthOfField_test: Entity enabled after adding required components: True",
|
||||
"DepthOfField Controller|Configuration|Camera Entity: SUCCESS",
|
||||
"DepthOfField_test: Entity is hidden: True",
|
||||
"DepthOfField_test: Entity is shown: True",
|
||||
"DepthOfField_test: Entity deleted: True",
|
||||
"DepthOfField_test: UNDO entity deletion works: True",
|
||||
"DepthOfField_test: REDO entity deletion works: True",
|
||||
# Directional Light Component
|
||||
"Directional Light Entity successfully created",
|
||||
"Directional Light_test: Component added to the entity: True",
|
||||
"Directional Light_test: Component removed after UNDO: True",
|
||||
"Directional Light_test: Component added after REDO: True",
|
||||
"Directional Light_test: Entered game mode: True",
|
||||
"Directional Light_test: Exit game mode: True",
|
||||
"Directional Light Controller|Configuration|Shadow|Camera: SUCCESS",
|
||||
"Directional Light_test: Entity is hidden: True",
|
||||
"Directional Light_test: Entity is shown: True",
|
||||
"Directional Light_test: Entity deleted: True",
|
||||
"Directional Light_test: UNDO entity deletion works: True",
|
||||
"Directional Light_test: REDO entity deletion works: True",
|
||||
# Exposure Control Component
|
||||
"Exposure Control Entity successfully created",
|
||||
"Exposure Control_test: Component added to the entity: True",
|
||||
"Exposure Control_test: Component removed after UNDO: True",
|
||||
"Exposure Control_test: Component added after REDO: True",
|
||||
"Exposure Control_test: Entered game mode: True",
|
||||
"Exposure Control_test: Exit game mode: True",
|
||||
"Exposure Control_test: Entity disabled initially: True",
|
||||
"Exposure Control_test: Entity enabled after adding required components: True",
|
||||
"Exposure Control_test: Entity is hidden: True",
|
||||
"Exposure Control_test: Entity is shown: True",
|
||||
"Exposure Control_test: Entity deleted: True",
|
||||
"Exposure Control_test: UNDO entity deletion works: True",
|
||||
"Exposure Control_test: REDO entity deletion works: True",
|
||||
# Global Skylight (IBL) Component
|
||||
"Global Skylight (IBL) Entity successfully created",
|
||||
"Global Skylight (IBL)_test: Component added to the entity: True",
|
||||
"Global Skylight (IBL)_test: Component removed after UNDO: True",
|
||||
"Global Skylight (IBL)_test: Component added after REDO: True",
|
||||
"Global Skylight (IBL)_test: Entered game mode: True",
|
||||
"Global Skylight (IBL)_test: Exit game mode: True",
|
||||
"Global Skylight (IBL) Controller|Configuration|Diffuse Image: SUCCESS",
|
||||
"Global Skylight (IBL) Controller|Configuration|Specular Image: SUCCESS",
|
||||
"Global Skylight (IBL)_test: Entity is hidden: True",
|
||||
"Global Skylight (IBL)_test: Entity is shown: True",
|
||||
"Global Skylight (IBL)_test: Entity deleted: True",
|
||||
"Global Skylight (IBL)_test: UNDO entity deletion works: True",
|
||||
"Global Skylight (IBL)_test: REDO entity deletion works: True",
|
||||
# Physical Sky Component
|
||||
"Physical Sky Entity successfully created",
|
||||
"Physical Sky component was added to entity",
|
||||
"Entity has a Physical Sky component",
|
||||
"Physical Sky_test: Component added to the entity: True",
|
||||
"Physical Sky_test: Component removed after UNDO: True",
|
||||
"Physical Sky_test: Component added after REDO: True",
|
||||
"Physical Sky_test: Entered game mode: True",
|
||||
"Physical Sky_test: Exit game mode: True",
|
||||
"Physical Sky_test: Entity is hidden: True",
|
||||
"Physical Sky_test: Entity is shown: True",
|
||||
"Physical Sky_test: Entity deleted: True",
|
||||
"Physical Sky_test: UNDO entity deletion works: True",
|
||||
"Physical Sky_test: REDO entity deletion works: True",
|
||||
# Point Light Component
|
||||
"Point Light Entity successfully created",
|
||||
"Point Light_test: Component added to the entity: True",
|
||||
"Point Light_test: Component removed after UNDO: True",
|
||||
"Point Light_test: Component added after REDO: True",
|
||||
"Point Light_test: Entered game mode: True",
|
||||
"Point Light_test: Exit game mode: True",
|
||||
"Point Light_test: Entity is hidden: True",
|
||||
"Point Light_test: Entity is shown: True",
|
||||
"Point Light_test: Entity deleted: True",
|
||||
"Point Light_test: UNDO entity deletion works: True",
|
||||
"Point Light_test: REDO entity deletion works: True",
|
||||
# PostFX Layer Component
|
||||
"PostFX Layer Entity successfully created",
|
||||
"PostFX Layer_test: Component added to the entity: True",
|
||||
"PostFX Layer_test: Component removed after UNDO: True",
|
||||
"PostFX Layer_test: Component added after REDO: True",
|
||||
"PostFX Layer_test: Entered game mode: True",
|
||||
"PostFX Layer_test: Exit game mode: True",
|
||||
"PostFX Layer_test: Entity is hidden: True",
|
||||
"PostFX Layer_test: Entity is shown: True",
|
||||
"PostFX Layer_test: Entity deleted: True",
|
||||
"PostFX Layer_test: UNDO entity deletion works: True",
|
||||
"PostFX Layer_test: REDO entity deletion works: True",
|
||||
# Radius Weight Modifier Component
|
||||
"Radius Weight Modifier Entity successfully created",
|
||||
"Radius Weight Modifier_test: Component added to the entity: True",
|
||||
"Radius Weight Modifier_test: Component removed after UNDO: True",
|
||||
"Radius Weight Modifier_test: Component added after REDO: True",
|
||||
"Radius Weight Modifier_test: Entered game mode: True",
|
||||
"Radius Weight Modifier_test: Exit game mode: True",
|
||||
"Radius Weight Modifier_test: Entity is hidden: True",
|
||||
"Radius Weight Modifier_test: Entity is shown: True",
|
||||
"Radius Weight Modifier_test: Entity deleted: True",
|
||||
"Radius Weight Modifier_test: UNDO entity deletion works: True",
|
||||
"Radius Weight Modifier_test: REDO entity deletion works: True",
|
||||
# Light Component
|
||||
"Light Entity successfully created",
|
||||
"Light_test: Component added to the entity: True",
|
||||
"Light_test: Component removed after UNDO: True",
|
||||
"Light_test: Component added after REDO: True",
|
||||
"Light_test: Entered game mode: True",
|
||||
"Light_test: Exit game mode: True",
|
||||
"Light_test: Entity is hidden: True",
|
||||
"Light_test: Entity is shown: True",
|
||||
"Light_test: Entity deleted: True",
|
||||
"Light_test: UNDO entity deletion works: True",
|
||||
"Light_test: REDO entity deletion works: True",
|
||||
]
|
||||
|
||||
unexpected_lines = [
|
||||
"failed to open",
|
||||
"Traceback (most recent call last):",
|
||||
]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
TEST_DIRECTORY,
|
||||
editor,
|
||||
"hydra_AtomEditorComponents_AddedToEntity.py",
|
||||
timeout=EDITOR_TIMEOUT,
|
||||
expected_lines=expected_lines,
|
||||
unexpected_lines=unexpected_lines,
|
||||
halt_on_unexpected=True,
|
||||
null_renderer=True,
|
||||
cfg_args=cfg_args,
|
||||
)
|
||||
@@ -94,13 +94,13 @@ class TestAutomationBase:
|
||||
editor_starttime = time.time()
|
||||
self.logger.debug("Running automated test")
|
||||
testcase_module_filepath = self._get_testcase_module_filepath(testcase_module)
|
||||
pycmd = ["--runpythontest", testcase_module_filepath, "-BatchMode", "-autotest_mode", "-NullRenderer"] + extra_cmdline_args
|
||||
pycmd = ["--runpythontest", testcase_module_filepath, "-BatchMode", "-autotest_mode", "-rhi=null"] + extra_cmdline_args
|
||||
editor.args.extend(pycmd) # args are added to the WinLauncher start command
|
||||
editor.start(backupFiles = False, launch_ap = False)
|
||||
try:
|
||||
editor.wait(TestAutomationBase.MAX_TIMEOUT)
|
||||
except WaitTimeoutError:
|
||||
errors.append(TestRunError("TIMEOUT", "Editor did not close after {TestAutomationBase.MAX_TIMEOUT} seconds, verify the test is ending and the application didn't freeze"))
|
||||
errors.append(TestRunError("TIMEOUT", f"Editor did not close after {TestAutomationBase.MAX_TIMEOUT} seconds, verify the test is ending and the application didn't freeze"))
|
||||
editor.kill()
|
||||
|
||||
output = editor.get_output()
|
||||
@@ -118,16 +118,16 @@ class TestAutomationBase:
|
||||
else:
|
||||
error_str = "Test failed, no output available..\n"
|
||||
errors.append(TestRunError("FAILED TEST", error_str))
|
||||
if return_code != TestAutomationBase.TEST_FAIL_RETCODE: # Crashed
|
||||
if return_code and return_code != TestAutomationBase.TEST_FAIL_RETCODE: # Crashed
|
||||
crash_info = "-- No crash log available --"
|
||||
error_log = os.path.join(workspace.paths.project_log(), 'error.log')
|
||||
crash_log = os.path.join(workspace.paths.project_log(), 'error.log')
|
||||
try:
|
||||
waiter.wait_for(lambda: os.path.exists(error_log), timeout=TestAutomationBase.WAIT_FOR_CRASH_LOG)
|
||||
waiter.wait_for(lambda: os.path.exists(crash_log), timeout=TestAutomationBase.WAIT_FOR_CRASH_LOG)
|
||||
except AssertionError:
|
||||
pass
|
||||
|
||||
try:
|
||||
with open(error_log) as f:
|
||||
with open(crash_log) as f:
|
||||
crash_info = f.read()
|
||||
except Exception as ex:
|
||||
crash_info += f"\n{str(ex)}"
|
||||
|
||||
+3
-3
@@ -21,8 +21,8 @@ import azlmbr.legacy.general as general
|
||||
import azlmbr.paths
|
||||
|
||||
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
|
||||
from automatedtesting_shared.editor_test_helper import EditorTestHelper
|
||||
import automatedtesting_shared.pyside_utils as pyside_utils
|
||||
from editor_python_test_tools.editor_test_helper import EditorTestHelper
|
||||
import editor_python_test_tools.pyside_utils as pyside_utils
|
||||
|
||||
|
||||
class AssetBrowserTreeNavigationTest(EditorTestHelper):
|
||||
@@ -66,7 +66,7 @@ class AssetBrowserTreeNavigationTest(EditorTestHelper):
|
||||
return collapse_success and expand_success
|
||||
|
||||
# This is the hierarchy we are expanding (4 steps inside)
|
||||
self.file_path = ("AutomatedTesting", "Assets", "ImageGradients", "lumberyard_gsi.png")
|
||||
self.file_path = ("AutomatedTesting", "Assets", "ImageGradients", "image_grad_test_gsi.png")
|
||||
|
||||
# 1) Open a new level
|
||||
self.test_success = self.create_level(
|
||||
|
||||
@@ -22,8 +22,8 @@ import azlmbr.entity as entity
|
||||
import azlmbr.paths
|
||||
|
||||
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
|
||||
from automatedtesting_shared.editor_test_helper import EditorTestHelper
|
||||
import automatedtesting_shared.pyside_utils as pyside_utils
|
||||
from editor_python_test_tools.editor_test_helper import EditorTestHelper
|
||||
import editor_python_test_tools.pyside_utils as pyside_utils
|
||||
|
||||
|
||||
class TestDockingBasicDockedTools(EditorTestHelper):
|
||||
|
||||
@@ -19,8 +19,8 @@ import sys
|
||||
import azlmbr.paths
|
||||
|
||||
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
|
||||
from automatedtesting_shared.editor_test_helper import EditorTestHelper
|
||||
import automatedtesting_shared.pyside_utils as pyside_utils
|
||||
from editor_python_test_tools.editor_test_helper import EditorTestHelper
|
||||
import editor_python_test_tools.pyside_utils as pyside_utils
|
||||
|
||||
|
||||
class TestEditMenuOptions(EditorTestHelper):
|
||||
|
||||
@@ -20,8 +20,8 @@ import sys
|
||||
import azlmbr.paths
|
||||
|
||||
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
|
||||
from automatedtesting_shared.editor_test_helper import EditorTestHelper
|
||||
import automatedtesting_shared.pyside_utils as pyside_utils
|
||||
from editor_python_test_tools.editor_test_helper import EditorTestHelper
|
||||
import editor_python_test_tools.pyside_utils as pyside_utils
|
||||
|
||||
|
||||
class TestFileMenuOptions(EditorTestHelper):
|
||||
|
||||
@@ -19,8 +19,8 @@ import sys
|
||||
import azlmbr.paths
|
||||
|
||||
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
|
||||
from automatedtesting_shared.editor_test_helper import EditorTestHelper
|
||||
import automatedtesting_shared.pyside_utils as pyside_utils
|
||||
from editor_python_test_tools.editor_test_helper import EditorTestHelper
|
||||
import editor_python_test_tools.pyside_utils as pyside_utils
|
||||
|
||||
|
||||
class TestViewMenuOptions(EditorTestHelper):
|
||||
|
||||
@@ -19,7 +19,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
layout = {
|
||||
'path': r'Software\Amazon\Lumberyard\Editor\fancyWindowLayouts',
|
||||
'path': r'Software\Amazon\O3DE\Editor\fancyWindowLayouts',
|
||||
'value': 'last'
|
||||
}
|
||||
restore_camera = {
|
||||
|
||||
@@ -1,71 +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.
|
||||
"""
|
||||
|
||||
"""
|
||||
C13660194 : Asset Browser - Filtering
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
|
||||
# Bail on the test if ly_test_tools doesn't exist.
|
||||
pytest.importorskip('ly_test_tools')
|
||||
import ly_test_tools.environment.file_system as file_system
|
||||
import editor_python_test_tools.hydra_test_utils as hydra
|
||||
|
||||
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
|
||||
log_monitor_timeout = 90
|
||||
|
||||
|
||||
@pytest.mark.parametrize('project', ['AutomatedTesting'])
|
||||
@pytest.mark.parametrize('level', ['tmp_level'])
|
||||
@pytest.mark.usefixtures("automatic_process_killer")
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
class TestSearchFiltering(object):
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_teardown(self, request, workspace, project, level):
|
||||
def teardown():
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||
|
||||
@pytest.mark.test_case_id("C13660194")
|
||||
@pytest.mark.SUITE_periodic
|
||||
def test_SearchFiltering_Asset_Browser_Filtering(self, request, editor, level, launcher_platform):
|
||||
expected_lines = [
|
||||
"cedar.fbx asset is filtered in Asset Browser",
|
||||
"Animation file type(s) is present in the file tree: True",
|
||||
"FileTag file type(s) and Animation file type(s) is present in the file tree: True",
|
||||
"FileTag file type(s) is present in the file tree after removing Animation filter: True",
|
||||
]
|
||||
|
||||
unexpected_lines = [
|
||||
"Asset Browser opened: False",
|
||||
"Animation file type(s) is present in the file tree: False",
|
||||
"FileTag file type(s) and Animation file type(s) is present in the file tree: False",
|
||||
"FileTag file type(s) is present in the file tree after removing Animation filter: False",
|
||||
]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
test_directory,
|
||||
editor,
|
||||
"AssetBrowser_SearchFiltering.py",
|
||||
expected_lines,
|
||||
unexpected_lines=unexpected_lines,
|
||||
cfg_args=[level],
|
||||
auto_test_mode=False,
|
||||
run_python="--runpython",
|
||||
timeout=log_monitor_timeout,
|
||||
)
|
||||
@@ -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.
|
||||
"""
|
||||
|
||||
"""
|
||||
C13660195: Asset Browser - File Tree Navigation
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
|
||||
# Bail on the test if ly_test_tools doesn't exist.
|
||||
pytest.importorskip('ly_test_tools')
|
||||
import ly_test_tools.environment.file_system as file_system
|
||||
import editor_python_test_tools.hydra_test_utils as hydra
|
||||
|
||||
test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts")
|
||||
log_monitor_timeout = 90
|
||||
|
||||
|
||||
@pytest.mark.parametrize('project', ['AutomatedTesting'])
|
||||
@pytest.mark.parametrize('level', ['tmp_level'])
|
||||
@pytest.mark.usefixtures("automatic_process_killer")
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
class TestTreeNavigation(object):
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_teardown(self, request, workspace, project, level):
|
||||
def teardown():
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||
|
||||
@pytest.mark.test_case_id("C13660195")
|
||||
@pytest.mark.SUITE_periodic
|
||||
def test_TreeNavigation_Asset_Browser(self, request, editor, level, launcher_platform):
|
||||
expected_lines = [
|
||||
"Collapse/Expand tests: True",
|
||||
"Asset visibility test: True",
|
||||
"Scrollbar visibility test: True",
|
||||
"TreeNavigation_Asset_Browser: result=SUCCESS"
|
||||
]
|
||||
|
||||
hydra.launch_and_validate_results(
|
||||
request,
|
||||
test_directory,
|
||||
editor,
|
||||
"TreeNavigation_Asset_Browser.py",
|
||||
expected_lines,
|
||||
run_python="--runpython",
|
||||
cfg_args=[level],
|
||||
timeout=log_monitor_timeout,
|
||||
)
|
||||
@@ -85,7 +85,8 @@ class TestAltitudeFilter(object):
|
||||
|
||||
@pytest.mark.test_case_id("C4847478")
|
||||
@pytest.mark.SUITE_periodic
|
||||
def test_AltitudeFilterFilterStageToggle(self, request, editor, level, workspace, launcher_platform):
|
||||
@pytest.mark.xfail # LYN-3275
|
||||
def test_AltitudeFilter_FilterStageToggle(self, request, editor, level, workspace, launcher_platform):
|
||||
cfg_args = [level]
|
||||
|
||||
expected_lines = [
|
||||
|
||||
@@ -101,6 +101,7 @@ class TestLayerSpawner(object):
|
||||
|
||||
@pytest.mark.test_case_id("C4765973")
|
||||
@pytest.mark.SUITE_periodic
|
||||
@pytest.mark.xfail # LYN-3275
|
||||
def test_LayerSpawner_FilterStageToggle(self, request, editor, level, workspace, launcher_platform):
|
||||
|
||||
expected_lines = [
|
||||
|
||||
@@ -46,6 +46,7 @@ class TestMeshBlocker(object):
|
||||
"""
|
||||
@pytest.mark.test_case_id("C3980834")
|
||||
@pytest.mark.SUITE_periodic
|
||||
@pytest.mark.xfail # LYN-3273
|
||||
def test_MeshBlocker_InstancesBlockedByMesh(self, request, editor, level, launcher_platform):
|
||||
expected_lines = [
|
||||
"'Instance Spawner' created",
|
||||
@@ -69,6 +70,7 @@ class TestMeshBlocker(object):
|
||||
"""
|
||||
@pytest.mark.test_case_id("C4766030")
|
||||
@pytest.mark.SUITE_periodic
|
||||
@pytest.mark.xfail # LYN-3273
|
||||
def test_MeshBlocker_InstancesBlockedByMeshHeightTuning(self, request, editor, level, launcher_platform):
|
||||
expected_lines = [
|
||||
"'Instance Spawner' created",
|
||||
|
||||
@@ -60,6 +60,7 @@ class TestPositionModifier(object):
|
||||
|
||||
@pytest.mark.test_case_id("C4874100")
|
||||
@pytest.mark.SUITE_sandbox
|
||||
@pytest.mark.xfail # LYN-3275
|
||||
def test_PositionModifier_AutoSnapToSurfaceWorks(self, request, editor, level, launcher_platform):
|
||||
|
||||
expected_lines = [
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import azlmbr.math as math
|
||||
import azlmbr.paths
|
||||
|
||||
sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests'))
|
||||
from automatedtesting_shared.editor_test_helper import EditorTestHelper
|
||||
from editor_python_test_tools.editor_test_helper import EditorTestHelper
|
||||
|
||||
editorId = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID
|
||||
createdEntityId = None
|
||||
|
||||
@@ -22,7 +22,7 @@ import pytest
|
||||
# Bail on the test if ly_test_tools doesn't exist.
|
||||
pytest.importorskip('ly_test_tools')
|
||||
import ly_test_tools.environment.file_system as file_system
|
||||
import automateeditor_python_test_toolsdtesting_shared.hydra_test_utils as hydra
|
||||
import editor_python_test_tools.hydra_test_utils as hydra
|
||||
|
||||
test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts')
|
||||
|
||||
|
||||
+9
-5
@@ -24,7 +24,7 @@ class Tests():
|
||||
# fmt: on
|
||||
|
||||
|
||||
def run():
|
||||
def C14861501_PhysXCollider_RenderMeshAutoAssigned():
|
||||
"""
|
||||
Summary:
|
||||
Create entity with Mesh component and assign a render mesh to the Mesh component. Add Physics Collider component
|
||||
@@ -61,7 +61,7 @@ def run():
|
||||
from asset_utils import Asset
|
||||
|
||||
# Asset paths
|
||||
STATIC_MESH = os.path.join("assets", "c14861501_physxcollider_rendermeshautoassigned", "spherebot", "r0-b_body.cgf")
|
||||
STATIC_MESH = os.path.join("assets", "c14861501_physxcollider_rendermeshautoassigned", "spherebot", "r0-b_body.azmodel")
|
||||
PHYSX_MESH = os.path.join(
|
||||
"assets", "c14861501_physxcollider_rendermeshautoassigned", "spherebot", "r0-b_body.pxmesh"
|
||||
)
|
||||
@@ -80,8 +80,8 @@ def run():
|
||||
|
||||
# 4) Assign a render mesh asset to Mesh component (the fbx mesh having both Static mesh and PhysX collision Mesh)
|
||||
mesh_asset = Asset.find_asset_by_path(STATIC_MESH)
|
||||
mesh_component.set_component_property_value("MeshComponentRenderNode|Mesh asset", mesh_asset.id)
|
||||
mesh_asset.id = mesh_component.get_component_property_value("MeshComponentRenderNode|Mesh asset")
|
||||
mesh_component.set_component_property_value("Controller|Configuration|Mesh Asset", mesh_asset.id)
|
||||
mesh_asset.id = mesh_component.get_component_property_value("Controller|Configuration|Mesh Asset")
|
||||
Report.result(Tests.assign_mesh_asset, mesh_asset.get_path() == STATIC_MESH.replace(os.sep, "/"))
|
||||
|
||||
# 5) Add PhysX Collider component
|
||||
@@ -95,4 +95,8 @@ def run():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from utils import Report
|
||||
Report.start_test(C14861501_PhysXCollider_RenderMeshAutoAssigned)
|
||||
|
||||
+2
-2
@@ -62,8 +62,8 @@ def C14861502_PhysXCollider_AssetAutoAssigned():
|
||||
# Open 3D Engine Imports
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
MESH_ASSET_PATH = os.path.join("Objects", "SphereBot", "r0-b_body.cgf")
|
||||
MESH_PROPERTY_PATH = "MeshComponentRenderNode|Mesh asset"
|
||||
MESH_ASSET_PATH = os.path.join("Objects", "SphereBot", "r0-b_body.azmodel")
|
||||
MESH_PROPERTY_PATH = "Controller|Configuration|Mesh Asset"
|
||||
TESTED_PROPERTY_PATH = "Shape Configuration|Asset|PhysX Mesh"
|
||||
|
||||
helper.init_idle()
|
||||
|
||||
@@ -69,7 +69,7 @@ def run():
|
||||
import azlmbr.asset as azasset
|
||||
|
||||
# Asset paths
|
||||
STATIC_MESH = os.path.join("assets", "c14861504_rendermeshasset_withnopxasset", "test_asset.cgf")
|
||||
STATIC_MESH = os.path.join("assets", "c14861504_rendermeshasset_withnopxasset", "test_asset.azmodel")
|
||||
|
||||
helper.init_idle()
|
||||
# 1) Load the empty level
|
||||
@@ -85,8 +85,8 @@ def run():
|
||||
|
||||
# 4) Assign a render mesh asset to Mesh component (the fbx mesh having both Static mesh and PhysX collision Mesh)
|
||||
mesh_asset = Asset.find_asset_by_path(STATIC_MESH)
|
||||
mesh_component.set_component_property_value("MeshComponentRenderNode|Mesh asset", mesh_asset.id)
|
||||
mesh_asset.id = mesh_component.get_component_property_value("MeshComponentRenderNode|Mesh asset")
|
||||
mesh_component.set_component_property_value("Controller|Configuration|Mesh Asset", mesh_asset.id)
|
||||
mesh_asset.id = mesh_component.get_component_property_value("Controller|Configuration|Mesh Asset")
|
||||
Report.result(Tests.assign_mesh_asset, mesh_asset.get_path() == STATIC_MESH.replace(os.sep, "/"))
|
||||
|
||||
# 5) Add PhysX Collider component
|
||||
|
||||
+10
-11
@@ -27,7 +27,7 @@ class Tests():
|
||||
# fmt: on
|
||||
|
||||
|
||||
def run():
|
||||
def C4044695_PhysXCollider_AddMultipleSurfaceFbx():
|
||||
"""
|
||||
Summary:
|
||||
Create entity with Mesh and PhysX Collider components and assign a fbx file in both the components.
|
||||
@@ -45,12 +45,7 @@ def run():
|
||||
4) Select the PhysicsAsset shape in the PhysX Collider component
|
||||
5) Assign the fbx file in PhysX Mesh and Mesh component
|
||||
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 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.
|
||||
|
||||
|
||||
:return: None
|
||||
"""
|
||||
# Builtins
|
||||
@@ -70,7 +65,7 @@ def run():
|
||||
SURFACE_TAG_COUNT = 4 # Number of surface tags included in used asset
|
||||
|
||||
# Asset paths
|
||||
STATIC_MESH = os.path.join("assets", "c4044695_physxcollider_addmultiplesurfacefbx", "test.cgf")
|
||||
STATIC_MESH = os.path.join("assets", "c4044695_physxcollider_addmultiplesurfacefbx", "test.azmodel")
|
||||
PHYSX_MESH = os.path.join("assets", "c4044695_physxcollider_addmultiplesurfacefbx", "test.pxmesh")
|
||||
|
||||
helper.init_idle()
|
||||
@@ -100,8 +95,8 @@ def run():
|
||||
Report.result(Tests.assign_px_mesh_asset, px_asset.get_path() == PHYSX_MESH.replace(os.sep, "/"))
|
||||
|
||||
mesh_asset = Asset.find_asset_by_path(STATIC_MESH)
|
||||
mesh_component.set_component_property_value("MeshComponentRenderNode|Mesh asset", mesh_asset.id)
|
||||
mesh_asset.id = mesh_component.get_component_property_value("MeshComponentRenderNode|Mesh asset")
|
||||
mesh_component.set_component_property_value("Controller|Configuration|Mesh Asset", mesh_asset.id)
|
||||
mesh_asset.id = mesh_component.get_component_property_value("Controller|Configuration|Mesh Asset")
|
||||
Report.result(Tests.assign_mesh_asset, mesh_asset.get_path() == STATIC_MESH.replace(os.sep, "/"))
|
||||
|
||||
# 6) Check if multiple material slots show up under Materials section in the PhysX Collider component
|
||||
@@ -116,4 +111,8 @@ def run():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
import ImportPathHelper as imports
|
||||
imports.init()
|
||||
|
||||
from utils import Report
|
||||
Report.start_test(C4044695_PhysXCollider_AddMultipleSurfaceFbx)
|
||||
|
||||
@@ -27,7 +27,7 @@ class Tests():
|
||||
def C4976236_AddPhysxColliderComponent():
|
||||
"""
|
||||
Summary:
|
||||
Load level with Entity having PhysX Collider component. Verify that editor remains stable in Game mode.
|
||||
Opens an empty level and creates an Entity with PhysX Collider. Verify that editor remains stable in Game mode.
|
||||
|
||||
Expected Behavior:
|
||||
The Editor is stable there are no warnings or errors.
|
||||
@@ -37,16 +37,10 @@ def C4976236_AddPhysxColliderComponent():
|
||||
2) Create test entity
|
||||
3) Start the Tracer to catch any errors and warnings
|
||||
4) Add the PhysX Collider component and change shape to box
|
||||
5) Add Mesh component and an asset
|
||||
6) Enter game mode
|
||||
7) Verify there are no errors and warnings in the logs
|
||||
8) Exit game mode
|
||||
9) Close the editor
|
||||
|
||||
Note:
|
||||
- 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.
|
||||
5) Enter game mode
|
||||
6) Verify there are no errors and warnings in the logs
|
||||
7) Exit game mode
|
||||
8) Close the editor
|
||||
|
||||
:return: None
|
||||
"""
|
||||
@@ -60,7 +54,7 @@ def C4976236_AddPhysxColliderComponent():
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
from editor_python_test_tools.utils import Tracer
|
||||
from asset_utils import Asset
|
||||
|
||||
|
||||
helper.init_idle()
|
||||
# 1) Load the level
|
||||
helper.open_level("Physics", "Base")
|
||||
@@ -74,17 +68,12 @@ def C4976236_AddPhysxColliderComponent():
|
||||
# 4) Add the PhysX Collider component and change shape to box
|
||||
collider_component = test_entity.add_component("PhysX Collider")
|
||||
Report.result(Tests.add_physx_collider, test_entity.has_component("PhysX Collider"))
|
||||
collider_component.set_component_property_value('Shape Configuration|Shape', 1)
|
||||
collider_component.set_component_property_value('Shape Configuration|Shape', azlmbr.physics.ShapeType_Box)
|
||||
|
||||
# 5) Add Mesh component and an asset
|
||||
mesh_component = test_entity.add_component("Mesh")
|
||||
asset = Asset.find_asset_by_path(r"Objects\default\primitive_cube.cgf")
|
||||
mesh_component.set_component_property_value('MeshComponentRenderNode|Mesh asset', asset.id)
|
||||
|
||||
# 6) Enter game mode
|
||||
# 5) Enter game mode
|
||||
helper.enter_game_mode(Tests.enter_game_mode)
|
||||
|
||||
# 7) Verify there are no errors and warnings in the logs
|
||||
# 6) Verify there are no errors and warnings in the logs
|
||||
success_condition = not (section_tracer.has_errors or section_tracer.has_warnings)
|
||||
Report.result(Tests.no_errors_and_warnings_found, success_condition)
|
||||
if not success_condition:
|
||||
@@ -92,9 +81,8 @@ def C4976236_AddPhysxColliderComponent():
|
||||
Report.info(f"Warnings found: {section_tracer.warnings}")
|
||||
if section_tracer.has_errors:
|
||||
Report.info(f"Errors found: {section_tracer.errors}")
|
||||
Report.failure(Tests.no_errors_and_warnings_found)
|
||||
|
||||
# 8) Exit game mode
|
||||
# 7) Exit game mode
|
||||
helper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
"""
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
# This suite consists of all test cases that are passing and have been verified.
|
||||
|
||||
import pytest
|
||||
import os
|
||||
import sys
|
||||
|
||||
from .FileManagement import FileManagement as fm
|
||||
from ly_test_tools import LAUNCHERS
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
|
||||
|
||||
from base import TestAutomationBase
|
||||
|
||||
|
||||
revert_physics_config = fm.file_revert_list(['physxdebugconfiguration.setreg', 'physxdefaultsceneconfiguration.setreg', 'physxsystemconfiguration.setreg'], 'AutomatedTesting/Registry')
|
||||
|
||||
|
||||
@pytest.mark.SUITE_main
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(self, request, workspace, editor, launcher_platform):
|
||||
from . import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
+3
-17
@@ -27,26 +27,16 @@ from base import TestAutomationBase
|
||||
revert_physics_config = fm.file_revert_list(['physxdebugconfiguration.setreg', 'physxdefaultsceneconfiguration.setreg', 'physxsystemconfiguration.setreg'], 'AutomatedTesting/Registry')
|
||||
|
||||
|
||||
@pytest.mark.SUITE_main
|
||||
@pytest.mark.SUITE_periodic
|
||||
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
|
||||
# Marking the test as an expected failure due to sporadic failure on Automated Review: SPEC-3146
|
||||
# The test still runs, but a failure of the test doesn't result in the test run failing
|
||||
@pytest.mark.xfail(
|
||||
reason="This test seems to fail sometimes due to it being the first test in the testsuite, we'll duplicate it temporarly."
|
||||
"Need to figure out the reason why this is the case")
|
||||
@revert_physics_config
|
||||
def test_C000000_RigidBody_EnablingGravityWorksPoC_DUPLICATE(self, request, workspace, editor, launcher_platform):
|
||||
from . import C100000_RigidBody_EnablingGravityWorksPoC as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
@revert_physics_config
|
||||
def test_C3510642_Terrain_NotCollideWithTerrain(self, request, workspace, editor, launcher_platform):
|
||||
from . import C3510642_Terrain_NotCollideWithTerrain as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
|
||||
@revert_physics_config
|
||||
def test_C4976195_RigidBodies_InitialLinearVelocity(self, request, workspace, editor, launcher_platform):
|
||||
from . import C4976195_RigidBodies_InitialLinearVelocity as test_module
|
||||
@@ -530,8 +520,4 @@ class TestAutomation(TestAutomationBase):
|
||||
|
||||
def test_C100000_RigidBody_EnablingGravityWorksPoC(self, request, workspace, editor, launcher_platform):
|
||||
from . import C100000_RigidBody_EnablingGravityWorksPoC as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
|
||||
def test_C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC(self, request, workspace, editor, launcher_platform):
|
||||
from . import C111111_RigidBody_EnablingGravityWorksUsingNotificationsPoC as test_module
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:75cb1c8454aafc3de81351450a9480f91cb98d926a6e47f87a5ffe91e1d5a7d5
|
||||
size 4745
|
||||
oid sha256:f63204a86af8bc0963a4823d047a2e222cc19aabd14570d0789dc90cdc82970c
|
||||
size 2017
|
||||
|
||||
@@ -1,356 +1,356 @@
|
||||
<TimeOfDay Time="13.5" TimeStart="13.5" TimeEnd="13.5" TimeAnimSpeed="0">
|
||||
<Variable Name="Sun color" Color="0.99989021,0.99946922,0.9991194">
|
||||
<Spline Keys="-0.000628322:(0.783538:0.89627:0.930341):36,0:(0.783538:0.887923:0.921582):36,0.229167:(0.783538:0.879623:0.921582):36,0.25:(0.947307:0.745404:0.577581):36,0.458333:(1:1:1):36,0.5625:(1:1:1):36,0.75:(0.947307:0.745404:0.577581):36,0.770833:(0.783538:0.879623:0.921582):36,1:(0.783538:0.89627:0.930556):36,"/>
|
||||
<Variable Name="Sun color" Color="0.78353798,0.89626998,0.93034101">
|
||||
<Spline Keys="-0.000628322:(0.783538:0.89627:0.930341):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sun intensity" Value="92366.68">
|
||||
<Spline Keys="0:1000:36,0.229167:1000:36,0.5:120000:36,0.770833:1000:65572,0.999306:1000:36,"/>
|
||||
<Variable Name="Sun intensity" Value="1000">
|
||||
<Spline Keys="0:1000:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sun specular multiplier" Value="1">
|
||||
<Spline Keys="0:1:36,0.25:1:36,0.5:1:36,0.75:1:36,1:1:36,"/>
|
||||
<Spline Keys="0:1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog color" Color="0.27049801,0.47353199,0.83076996">
|
||||
<Spline Keys="0:(0.00651209:0.00972122:0.0137021):36,0.229167:(0.00604883:0.00972122:0.0137021):36,0.25:(0.270498:0.473532:0.83077):36,0.5:(0.270498:0.473532:0.83077):458788,0.75:(0.270498:0.473532:0.83077):36,0.770833:(0.00604883:0.00972122:0.0137021):36,1:(0.00651209:0.00972122:0.0137021):36,"/>
|
||||
<Variable Name="Fog color" Color="0.0065120901,0.0097212195,0.0137021">
|
||||
<Spline Keys="0:(0.00651209:0.00972122:0.0137021):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog color multiplier" Value="1">
|
||||
<Spline Keys="0:0.5:36,0.229167:0.5:36,0.25:1:36,0.5:1:36,0.75:1:36,0.770833:0.5:36,1:0.5:65572,"/>
|
||||
<Variable Name="Fog color multiplier" Value="0.5">
|
||||
<Spline Keys="0:0.5:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog height (bottom)" Value="0">
|
||||
<Spline Keys="0:0:36,0.25:0:36,0.5:0:36,0.75:0:36,1:0:36,"/>
|
||||
<Spline Keys="0:0:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog layer density (bottom)" Value="1">
|
||||
<Spline Keys="0:1:36,0.25:1:36,0.5:1:36,0.75:1:36,1:1:36,"/>
|
||||
<Spline Keys="0:1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog color (top)" Color="0.597202,0.72305501,0.91309899">
|
||||
<Spline Keys="0:(0.00699541:0.00972122:0.0122865):36,0.229167:(0.00699541:0.00972122:0.0122865):36,0.25:(0.597202:0.723055:0.913099):36,0.5:(0.597202:0.723055:0.913099):458788,0.75:(0.597202:0.723055:0.913099):36,0.770833:(0.00699541:0.00972122:0.0122865):36,1:(0.00699541:0.00972122:0.0122865):36,"/>
|
||||
<Variable Name="Fog color (top)" Color="0.0069954102,0.0097212195,0.0122865">
|
||||
<Spline Keys="0:(0.00699541:0.00972122:0.0122865):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog color (top) multiplier" Value="0.88389361">
|
||||
<Spline Keys="-4.40702e-06:0.5:36,0.0297507:0.499195:36,0.229167:0.5:36,0.5:1:36,0.770833:0.5:36,1:0.5:36,"/>
|
||||
<Variable Name="Fog color (top) multiplier" Value="0.5">
|
||||
<Spline Keys="-4.40702e-06:0.5:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog height (top)" Value="100.00001">
|
||||
<Spline Keys="0:100:36,0.25:100:36,0.5:100:36,0.75:100:65572,1:100:36,"/>
|
||||
<Variable Name="Fog height (top)" Value="100">
|
||||
<Spline Keys="0:100:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog layer density (top)" Value="9.9999997e-05">
|
||||
<Spline Keys="0:0.0001:36,0.25:0.0001:36,0.5:0.0001:65572,0.75:0.0001:36,1:0.0001:36,"/>
|
||||
<Spline Keys="0:0.0001:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog color height offset" Value="0">
|
||||
<Spline Keys="0:0:36,0.25:0:36,0.5:0:36,0.75:0:36,1:0:65572,"/>
|
||||
<Spline Keys="0:0:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog color (radial)" Color="0.78592348,0.52744436,0.17234583">
|
||||
<Spline Keys="0:(0:0:0):36,0.229167:(0.00439144:0.00367651:0.00334654):36,0.25:(0.838799:0.564712:0.184475):36,0.5:(0.768151:0.514918:0.168269):458788,0.75:(0.838799:0.564712:0.184475):36,0.770833:(0.00402472:0.00334654:0.00303527):36,1:(0:0:0):36,"/>
|
||||
<Variable Name="Fog color (radial)" Color="0,0,0">
|
||||
<Spline Keys="0:(0:0:0):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog color (radial) multiplier" Value="6">
|
||||
<Spline Keys="0:0:36,0.25:6:36,0.5:6:36,0.75:6:36,1:0:36,"/>
|
||||
<Variable Name="Fog color (radial) multiplier" Value="0">
|
||||
<Spline Keys="0:0:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog radial size" Value="0.85000002">
|
||||
<Spline Keys="0:0:36,0.25:0.85:65572,0.5:0.85:36,0.75:0.85:36,1:0:36,"/>
|
||||
<Variable Name="Fog radial size" Value="0">
|
||||
<Spline Keys="0:0:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Fog radial lobe" Value="0.75">
|
||||
<Spline Keys="0:0:36,0.25:0.75:36,0.5:0.75:36,0.75:0.75:65572,1:0:36,"/>
|
||||
<Variable Name="Fog radial lobe" Value="0">
|
||||
<Spline Keys="0:0:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog: Final density clamp" Value="1">
|
||||
<Spline Keys="0:1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
|
||||
<Spline Keys="0:1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog: Global density" Value="1.5">
|
||||
<Spline Keys="0:1.5:36,0.25:1.5:36,0.5:1.5:65572,0.75:1.5:36,1:1.5:36,"/>
|
||||
<Spline Keys="0:1.5:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog: Ramp start" Value="25.000002">
|
||||
<Spline Keys="0:25:36,0.25:25:36,0.5:25:65572,0.75:25:36,1:25:36,"/>
|
||||
<Variable Name="Volumetric fog: Ramp start" Value="25">
|
||||
<Spline Keys="0:25:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog: Ramp end" Value="1000.0001">
|
||||
<Spline Keys="0:1000:36,0.25:1000:36,0.5:1000:65572,0.75:1000:36,1:1000:36,"/>
|
||||
<Variable Name="Volumetric fog: Ramp end" Value="1000">
|
||||
<Spline Keys="0:1000:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog: Ramp influence" Value="0.69999993">
|
||||
<Spline Keys="0:0.7:36,0.25:0.7:36,0.5:0.7:65572,0.75:0.7:36,1:0.7:36,"/>
|
||||
<Variable Name="Volumetric fog: Ramp influence" Value="0.69999999">
|
||||
<Spline Keys="0:0.7:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog: Shadow darkening" Value="0.20000002">
|
||||
<Spline Keys="0:0.2:36,0.25:0.2:36,0.5:0.2:65572,0.75:0.2:36,1:0.2:36,"/>
|
||||
<Variable Name="Volumetric fog: Shadow darkening" Value="0.2">
|
||||
<Spline Keys="0:0.2:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog: Shadow darkening sun" Value="0.5">
|
||||
<Spline Keys="0:0.5:36,0.25:0.5:36,0.5:0.5:65572,0.75:0.5:36,1:0.5:36,"/>
|
||||
<Spline Keys="0:0.5:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog: Shadow darkening ambient" Value="1">
|
||||
<Spline Keys="0:1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
|
||||
<Spline Keys="0:1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog: Shadow range" Value="0.10000001">
|
||||
<Spline Keys="0:0.1:36,0.25:0.1:36,0.5:0.1:65572,0.75:0.1:36,1:0.1:36,"/>
|
||||
<Variable Name="Volumetric fog: Shadow range" Value="0.1">
|
||||
<Spline Keys="0:0.1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Fog height (bottom)" Value="0">
|
||||
<Spline Keys="0:0:0,1:0:0,"/>
|
||||
<Spline Keys="0:0:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Fog layer density (bottom)" Value="1">
|
||||
<Spline Keys="0:1:0,1:1:0,"/>
|
||||
<Spline Keys="0:1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Fog height (top)" Value="4000">
|
||||
<Spline Keys="0:4000:0,1:4000:0,"/>
|
||||
<Spline Keys="0:4000:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Fog layer density (top)" Value="9.9999997e-05">
|
||||
<Spline Keys="0:0.0001:0,1:0.0001:0,"/>
|
||||
<Spline Keys="0:0.0001:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Global fog density" Value="0.1">
|
||||
<Spline Keys="0:0.1:0,1:0.1:0,"/>
|
||||
<Spline Keys="0:0.1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Ramp start" Value="0">
|
||||
<Spline Keys="0:0:0,1:0:0,"/>
|
||||
<Spline Keys="0:0:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Ramp end" Value="0">
|
||||
<Spline Keys="0:0:0,1:0:0,"/>
|
||||
<Spline Keys="0:0:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Fog albedo color (atmosphere)" Color="1,1,1">
|
||||
<Spline Keys="0:(1:1:1):0,1:(1:1:1):0,"/>
|
||||
<Spline Keys="0:(1:1:1):0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Anisotropy factor (atmosphere)" Value="0.60000002">
|
||||
<Spline Keys="0:0.6:0,1:0.6:0,"/>
|
||||
<Spline Keys="0:0.6:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Fog albedo color (sun radial)" Color="1,1,1">
|
||||
<Spline Keys="0:(1:1:1):0,1:(1:1:1):0,"/>
|
||||
<Spline Keys="0:(1:1:1):0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Anisotropy factor (sun radial)" Value="0.94999999">
|
||||
<Spline Keys="0:0.95:0,1:0.95:0,"/>
|
||||
<Spline Keys="0:0.95:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Blend factor for sun scattering" Value="1">
|
||||
<Spline Keys="0:1:0,1:1:0,"/>
|
||||
<Spline Keys="0:1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Blend mode for sun scattering" Value="0">
|
||||
<Spline Keys="0:0:0,1:0:0,"/>
|
||||
<Spline Keys="0:0:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Fog albedo color (entities)" Color="1,1,1">
|
||||
<Spline Keys="0:(1:1:1):0,1:(1:1:1):0,"/>
|
||||
<Spline Keys="0:(1:1:1):0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Anisotropy factor (entities)" Value="0.60000002">
|
||||
<Spline Keys="0:0.6:0,1:0.6:0,"/>
|
||||
<Spline Keys="0:0.6:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Maximum range of ray-marching" Value="64">
|
||||
<Spline Keys="0:64:0,1:64:0,"/>
|
||||
<Spline Keys="0:64:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: In-scattering factor" Value="1">
|
||||
<Spline Keys="0:1:0,1:1:0,"/>
|
||||
<Spline Keys="0:1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Extinction factor" Value="0.30000001">
|
||||
<Spline Keys="0:0.3:0,1:0.3:0,"/>
|
||||
<Spline Keys="0:0.3:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Analytical volumetric fog visibility" Value="0.5">
|
||||
<Spline Keys="0:0.5:0,1:0.5:0,"/>
|
||||
<Spline Keys="0:0.5:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Volumetric fog 2: Final density clamp" Value="1">
|
||||
<Spline Keys="0:1:0,0.5:1:36,1:1:0,"/>
|
||||
<Spline Keys="0:1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Sky light: Sun intensity" Color="1,1,1">
|
||||
<Spline Keys="0:(1:1:1):36,0.25:(1:1:1):36,0.494381:(1:1:1):65572,0.5:(1:1:1):36,0.75:(1:1:1):36,1:(1:1:1):36,"/>
|
||||
<Spline Keys="0:(1:1:1):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sky light: Sun intensity multiplier" Value="200.00002">
|
||||
<Spline Keys="0:200:36,0.25:200:36,0.5:200:36,0.75:200:36,1:200:36,"/>
|
||||
<Variable Name="Sky light: Sun intensity multiplier" Value="200">
|
||||
<Spline Keys="0:200:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sky light: Mie scattering" Value="6.779707">
|
||||
<Spline Keys="0:40:36,0.5:2:36,1:40:36,"/>
|
||||
<Variable Name="Sky light: Mie scattering" Value="40">
|
||||
<Spline Keys="0:40:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sky light: Rayleigh scattering" Value="0.20000002">
|
||||
<Spline Keys="0:0.2:36,0.229167:0.2:36,0.25:1:36,0.291667:0.2:36,0.5:0.2:36,0.729167:0.2:36,0.75:1:36,0.770833:0.2:36,1:0.2:36,"/>
|
||||
<Variable Name="Sky light: Rayleigh scattering" Value="0.2">
|
||||
<Spline Keys="0:0.2:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sky light: Sun anisotropy factor" Value="-0.99989998">
|
||||
<Spline Keys="0:-0.9999:36,0.25:-0.9999:36,0.5:-0.9999:65572,0.75:-0.9999:36,1:-0.9999:36,"/>
|
||||
<Spline Keys="0:-0.9999:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sky light: Wavelength (R)" Value="694">
|
||||
<Spline Keys="0:694:36,0.25:694:36,0.5:694:65572,0.75:694:36,1:694:36,"/>
|
||||
<Spline Keys="0:694:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sky light: Wavelength (G)" Value="596.99994">
|
||||
<Spline Keys="0:597:36,0.25:597:36,0.5:597:36,0.75:597:36,1:597:36,"/>
|
||||
<Variable Name="Sky light: Wavelength (G)" Value="597">
|
||||
<Spline Keys="0:597:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sky light: Wavelength (B)" Value="488">
|
||||
<Spline Keys="0:488:36,0.25:488:36,0.5:488:65572,0.75:488:36,1:488:36,"/>
|
||||
<Spline Keys="0:488:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Horizon color" Color="0.27049801,0.39157301,0.52711499">
|
||||
<Spline Keys="0:(0.270498:0.391573:0.520996):36,0.25:(0.270498:0.391573:0.527115):36,0.5:(0.270498:0.391573:0.527115):262180,0.75:(0.270498:0.391573:0.527115):36,1:(0.270498:0.391573:0.520996):36,"/>
|
||||
<Variable Name="Night sky: Horizon color" Color="0.27049801,0.39157301,0.52099597">
|
||||
<Spline Keys="0:(0.270498:0.391573:0.520996):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Horizon color multiplier" Value="0">
|
||||
<Spline Keys="0:0.1:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0.1:36,"/>
|
||||
<Variable Name="Night sky: Horizon color multiplier" Value="0.1">
|
||||
<Spline Keys="0:0.1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Zenith color" Color="0.36130697,0.434154,0.46778399">
|
||||
<Spline Keys="0:(0.361307:0.434154:0.467784):36,0.25:(0.361307:0.434154:0.467784):36,0.5:(0.361307:0.434154:0.467784):262180,0.75:(0.361307:0.434154:0.467784):36,1:(0.361307:0.434154:0.467784):36,"/>
|
||||
<Variable Name="Night sky: Zenith color" Color="0.361307,0.434154,0.46778399">
|
||||
<Spline Keys="0:(0.361307:0.434154:0.467784):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Zenith color multiplier" Value="0">
|
||||
<Spline Keys="0:0.02:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0.02:36,"/>
|
||||
<Variable Name="Night sky: Zenith color multiplier" Value="0.02">
|
||||
<Spline Keys="0:0.02:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Zenith shift" Value="0.5">
|
||||
<Spline Keys="0:0.5:36,0.25:0.5:36,0.5:0.5:65572,0.75:0.5:36,1:0.5:36,"/>
|
||||
<Spline Keys="0:0.5:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Star intensity" Value="0">
|
||||
<Spline Keys="0:3:36,0.25:0:36,0.5:0:65572,0.75:0:36,0.836647:1.03977:36,1:3:36,"/>
|
||||
<Variable Name="Night sky: Star intensity" Value="3">
|
||||
<Spline Keys="0:3:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Moon color" Color="1,1,1">
|
||||
<Spline Keys="0:(1:1:1):36,0.25:(1:1:1):36,0.5:(1:1:1):458788,0.75:(1:1:1):36,1:(1:1:1):36,"/>
|
||||
<Spline Keys="0:(1:1:1):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Moon color multiplier" Value="0">
|
||||
<Spline Keys="0:0.4:36,0.25:0:36,0.5:0:36,0.75:0:65572,1:0.4:36,"/>
|
||||
<Variable Name="Night sky: Moon color multiplier" Value="0.40000001">
|
||||
<Spline Keys="0:0.4:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Moon inner corona color" Color="0.904661,1,1">
|
||||
<Spline Keys="0:(0.89627:1:1):36,0.25:(0.904661:1:1):36,0.5:(0.904661:1:1):393252,0.75:(0.904661:1:1):36,0.836647:(0.89627:1:1):36,1:(0.89627:1:1):36,"/>
|
||||
<Variable Name="Night sky: Moon inner corona color" Color="0.89626998,1,1">
|
||||
<Spline Keys="0:(0.89627:1:1):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Moon inner corona color multiplier" Value="0">
|
||||
<Spline Keys="0:0.1:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0.1:36,"/>
|
||||
<Variable Name="Night sky: Moon inner corona color multiplier" Value="0.1">
|
||||
<Spline Keys="0:0.1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Moon inner corona scale" Value="0">
|
||||
<Spline Keys="0:2:36,0.25:0:36,0.5:0:65572,0.75:0:36,0.836647:0.693178:36,1:2:36,"/>
|
||||
<Variable Name="Night sky: Moon inner corona scale" Value="2">
|
||||
<Spline Keys="0:2:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Moon outer corona color" Color="0.201556,0.22696599,0.25415203">
|
||||
<Spline Keys="0:(0.198069:0.226966:0.250158):36,0.25:(0.201556:0.226966:0.254152):36,0.5:(0.201556:0.226966:0.254152):36,0.75:(0.201556:0.226966:0.254152):36,1:(0.198069:0.226966:0.250158):36,"/>
|
||||
<Variable Name="Night sky: Moon outer corona color" Color="0.19806901,0.22696599,0.25015801">
|
||||
<Spline Keys="0:(0.198069:0.226966:0.250158):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Moon outer corona color multiplier" Value="0">
|
||||
<Spline Keys="0:0.1:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0.1:36,"/>
|
||||
<Variable Name="Night sky: Moon outer corona color multiplier" Value="0.1">
|
||||
<Spline Keys="0:0.1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Night sky: Moon outer corona scale" Value="0">
|
||||
<Spline Keys="0:0.01:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0.01:36,"/>
|
||||
<Variable Name="Night sky: Moon outer corona scale" Value="0.0099999998">
|
||||
<Spline Keys="0:0.01:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cloud shading: Sun light multiplier" Value="1">
|
||||
<Spline Keys="0:1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
|
||||
<Spline Keys="0:1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cloud shading: Sun custom color" Color="0.83076996,0.76815104,0.65837508">
|
||||
<Spline Keys="0:(0.737911:0.737911:0.737911):36,0.25:(0.83077:0.768151:0.658375):36,0.5:(0.83077:0.768151:0.658375):458788,0.75:(0.83077:0.768151:0.658375):36,1:(0.737911:0.737911:0.737911):36,"/>
|
||||
<Variable Name="Cloud shading: Sun custom color" Color="0.73791099,0.73791099,0.73791099">
|
||||
<Spline Keys="0:(0.737911:0.737911:0.737911):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cloud shading: Sun custom color multiplier" Value="1">
|
||||
<Spline Keys="0:0.1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:0.1:36,"/>
|
||||
<Variable Name="Cloud shading: Sun custom color multiplier" Value="0.1">
|
||||
<Spline Keys="0:0.1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cloud shading: Sun custom color influence" Value="0">
|
||||
<Spline Keys="0:0.5:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0.5:36,"/>
|
||||
<Variable Name="Cloud shading: Sun custom color influence" Value="0.5">
|
||||
<Spline Keys="0:0.5:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sun shafts visibility" Value="0">
|
||||
<Spline Keys="0:0:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0:36,"/>
|
||||
<Spline Keys="0:0:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sun rays visibility" Value="1.5">
|
||||
<Spline Keys="0:1:36,0.25:1.5:36,0.5:1.5:65572,0.75:1.5:36,1:1:36,"/>
|
||||
<Variable Name="Sun rays visibility" Value="1">
|
||||
<Spline Keys="0:1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sun rays attenuation" Value="1.5">
|
||||
<Spline Keys="0:0.1:36,0.25:1.5:36,0.5:1.5:65572,0.75:1.5:36,1:0.1:36,"/>
|
||||
<Variable Name="Sun rays attenuation" Value="0.1">
|
||||
<Spline Keys="0:0.1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sun rays suncolor influence" Value="0.5">
|
||||
<Spline Keys="0:0.5:36,0.25:0.5:36,0.5:0.5:65572,0.75:0.5:36,1:0.5:36,"/>
|
||||
<Spline Keys="0:0.5:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sun rays custom color" Color="0.66538697,0.83879906,0.94730699">
|
||||
<Spline Keys="0:(0.665387:0.838799:0.947307):36,0.25:(0.665387:0.838799:0.947307):36,0.5:(0.665387:0.838799:0.947307):458788,0.75:(0.665387:0.838799:0.947307):36,1:(0.665387:0.838799:0.947307):36,"/>
|
||||
<Variable Name="Sun rays custom color" Color="0.66538697,0.838799,0.94730699">
|
||||
<Spline Keys="0:(0.665387:0.838799:0.947307):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Ocean fog color" Color="0.0012141101,0.0091340598,0.017642001">
|
||||
<Spline Keys="0:(0.00121411:0.00913406:0.017642):36,0.25:(0.00121411:0.00913406:0.017642):36,0.5:(0.00121411:0.00913406:0.017642):458788,0.75:(0.00121411:0.00913406:0.017642):36,1:(0.00121411:0.00913406:0.017642):36,"/>
|
||||
<Variable Name="Ocean fog color" Color="0.0012141099,0.0091340598,0.017642001">
|
||||
<Spline Keys="0:(0.00121411:0.00913406:0.017642):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Ocean fog color multiplier" Value="0.5">
|
||||
<Spline Keys="0:0.5:36,0.25:0.5:36,0.5:0.5:65572,0.75:0.5:36,1:0.5:36,"/>
|
||||
<Spline Keys="0:0.5:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Ocean fog density" Value="0.5">
|
||||
<Spline Keys="0:0.5:36,0.25:0.5:36,0.5:0.5:65572,0.75:0.5:36,1:0.5:36,"/>
|
||||
<Spline Keys="0:0.5:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Static skybox multiplier" Value="1">
|
||||
<Spline Keys="0:1:0,1:1:0,"/>
|
||||
<Spline Keys="0:1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Film curve shoulder scale" Value="2.232213">
|
||||
<Spline Keys="0:3:36,0.229167:3:36,0.5:2:36,0.770833:3:36,1:3:36,"/>
|
||||
<Variable Name="Film curve shoulder scale" Value="3">
|
||||
<Spline Keys="0:3:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Film curve midtones scale" Value="0.88389361">
|
||||
<Spline Keys="0:0.5:36,0.229167:0.5:36,0.5:1:36,0.770833:0.5:36,1:0.5:36,"/>
|
||||
<Variable Name="Film curve midtones scale" Value="0.5">
|
||||
<Spline Keys="0:0.5:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Film curve toe scale" Value="1">
|
||||
<Spline Keys="0:1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
|
||||
<Spline Keys="0:1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Film curve whitepoint" Value="4">
|
||||
<Spline Keys="0:4:36,0.25:4:36,0.5:4:65572,0.75:4:36,1:4:36,"/>
|
||||
<Spline Keys="0:4:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Saturation" Value="1">
|
||||
<Spline Keys="0:0.8:36,0.229167:0.8:36,0.5:1:36,0.751391:1:65572,0.770833:0.8:36,1:0.8:36,"/>
|
||||
<Variable Name="Saturation" Value="0.80000001">
|
||||
<Spline Keys="0:0.8:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Color balance" Color="1,1,1">
|
||||
<Spline Keys="0:(1:1:1):36,0.25:(1:1:1):36,0.5:(1:1:1):36,0.75:(1:1:1):36,1:(1:1:1):36,"/>
|
||||
<Spline Keys="0:(1:1:1):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Scene key" Value="0.18000002">
|
||||
<Spline Keys="0:0.18:36,0.25:0.18:36,0.5:0.18:65572,0.75:0.18:36,1:0.18:36,"/>
|
||||
<Variable Name="Scene key" Value="0.18000001">
|
||||
<Spline Keys="0:0.18:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Min exposure" Value="1">
|
||||
<Spline Keys="0:1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
|
||||
<Spline Keys="0:1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Max exposure" Value="2.6142297">
|
||||
<Spline Keys="0:2:36,0.229167:2:36,0.5:2.8:36,0.770833:2:36,1:2:36,"/>
|
||||
<Variable Name="Max exposure" Value="2">
|
||||
<Spline Keys="0:2:36"/>
|
||||
</Variable>
|
||||
<Variable Name="EV Min" Value="4.5">
|
||||
<Spline Keys="0:4.5:0,1:4.5:0,"/>
|
||||
<Spline Keys="0:4.5:0"/>
|
||||
</Variable>
|
||||
<Variable Name="EV Max" Value="17">
|
||||
<Spline Keys="0:17:0,1:17:0,"/>
|
||||
<Spline Keys="0:17:0"/>
|
||||
</Variable>
|
||||
<Variable Name="EV Auto compensation" Value="1.5">
|
||||
<Spline Keys="0:1.5:0,1:1.5:0,"/>
|
||||
<Spline Keys="0:1.5:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Bloom amount" Value="0.30899152">
|
||||
<Spline Keys="0:1:36,0.229167:1:36,0.5:0.1:36,0.770833:1:36,1:1:36,"/>
|
||||
<Variable Name="Bloom amount" Value="1">
|
||||
<Spline Keys="0:1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Filters: grain" Value="0">
|
||||
<Spline Keys="0:0.3:65572,0.229167:0.3:36,0.25:0:36,0.5:0:36,0.75:0:36,1:0.3:36,"/>
|
||||
<Variable Name="Filters: grain" Value="0.30000001">
|
||||
<Spline Keys="0:0.3:65572"/>
|
||||
</Variable>
|
||||
<Variable Name="Filters: photofilter color" Color="0,0,0">
|
||||
<Spline Keys="0:(0:0:0):36,0.25:(0:0:0):36,0.5:(0:0:0):458788,0.75:(0:0:0):36,1:(0:0:0):36,"/>
|
||||
<Spline Keys="0:(0:0:0):36"/>
|
||||
</Variable>
|
||||
<Variable Name="Filters: photofilter density" Value="0">
|
||||
<Spline Keys="0:0:36,0.25:0:36,0.5:0:36,0.75:0:36,1:0:36,"/>
|
||||
<Spline Keys="0:0:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Dof: focus range" Value="500.00003">
|
||||
<Spline Keys="0:500:36,0.25:500:36,0.5:500:65572,0.75:500:36,1:500:36,"/>
|
||||
<Variable Name="Dof: focus range" Value="500">
|
||||
<Spline Keys="0:500:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Dof: blur amount" Value="0.10000001">
|
||||
<Spline Keys="0:0.1:36,0.25:0.1:36,0.5:0.1:65572,0.75:0.1:36,1:0.1:36,"/>
|
||||
<Variable Name="Dof: blur amount" Value="0.1">
|
||||
<Spline Keys="0:0.1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 0: Bias" Value="0.10000001">
|
||||
<Spline Keys="0:0.1:36,0.25:0.1:36,0.5:0.1:65572,0.75:0.1:36,1:0.1:36,"/>
|
||||
<Variable Name="Cascade 0: Bias" Value="0.1">
|
||||
<Spline Keys="0:0.1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 0: Slope Bias" Value="64">
|
||||
<Spline Keys="0:64:36,0.25:64:36,0.5:64:65572,0.75:64:36,1:64:36,"/>
|
||||
<Spline Keys="0:64:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 1: Bias" Value="0.10000001">
|
||||
<Spline Keys="0:0.1:36,0.25:0.1:36,0.5:0.1:65572,0.75:0.1:36,1:0.1:36,"/>
|
||||
<Variable Name="Cascade 1: Bias" Value="0.1">
|
||||
<Spline Keys="0:0.1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 1: Slope Bias" Value="23">
|
||||
<Spline Keys="0:23:36,0.25:23:36,0.5:23:65572,0.75:23:36,1:23:36,"/>
|
||||
<Spline Keys="0:23:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 2: Bias" Value="0.10000001">
|
||||
<Spline Keys="0:0.1:36,0.25:0.1:36,0.5:0.1:65572,0.75:0.1:36,1:0.1:36,"/>
|
||||
<Variable Name="Cascade 2: Bias" Value="0.1">
|
||||
<Spline Keys="0:0.1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 2: Slope Bias" Value="4">
|
||||
<Spline Keys="0:4:36,0.25:4:36,0.5:4:65572,0.75:4:36,1:4:36,"/>
|
||||
<Spline Keys="0:4:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 3: Bias" Value="0.10000001">
|
||||
<Spline Keys="0:0.1:36,0.25:0.1:36,0.5:0.1:36,0.75:0.1:36,1:0.1:36,"/>
|
||||
<Variable Name="Cascade 3: Bias" Value="0.1">
|
||||
<Spline Keys="0:0.1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 3: Slope Bias" Value="1">
|
||||
<Spline Keys="0:1:36,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
|
||||
<Spline Keys="0:1:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 4: Bias" Value="0.10000001">
|
||||
<Spline Keys="0:0.1:0,0.25:0.1:36,0.5:0.1:65572,0.75:0.1:36,1:0.1:36,"/>
|
||||
<Variable Name="Cascade 4: Bias" Value="0.1">
|
||||
<Spline Keys="0:0.1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 4: Slope Bias" Value="1">
|
||||
<Spline Keys="0:1:0,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
|
||||
<Spline Keys="0:1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 5: Bias" Value="0.0099999998">
|
||||
<Spline Keys="0:0.01:0,0.25:0.01:36,0.5:0.01:65572,0.75:0.01:36,1:0.01:36,"/>
|
||||
<Spline Keys="0:0.01:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 5: Slope Bias" Value="1">
|
||||
<Spline Keys="0:1:0,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
|
||||
<Spline Keys="0:1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 6: Bias" Value="0.10000001">
|
||||
<Spline Keys="0:0.1:0,0.25:0.1:36,0.5:0.1:36,0.75:0.1:36,1:0.1:36,"/>
|
||||
<Variable Name="Cascade 6: Bias" Value="0.1">
|
||||
<Spline Keys="0:0.1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 6: Slope Bias" Value="1">
|
||||
<Spline Keys="0:1:0,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
|
||||
<Spline Keys="0:1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 7: Bias" Value="0.10000001">
|
||||
<Spline Keys="0:0.1:0,0.25:0.1:36,0.5:0.1:36,0.75:0.1:36,1:0.1:36,"/>
|
||||
<Variable Name="Cascade 7: Bias" Value="0.1">
|
||||
<Spline Keys="0:0.1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Cascade 7: Slope Bias" Value="1">
|
||||
<Spline Keys="0:1:0,0.25:1:36,0.5:1:65572,0.75:1:36,1:1:36,"/>
|
||||
<Spline Keys="0:1:0"/>
|
||||
</Variable>
|
||||
<Variable Name="Shadow jittering" Value="2.4999998">
|
||||
<Spline Keys="0:5:36,0.25:2.5:36,0.5:2.5:65572,0.75:2.5:36,1:5:0,"/>
|
||||
<Variable Name="Shadow jittering" Value="5">
|
||||
<Spline Keys="0:5:36"/>
|
||||
</Variable>
|
||||
<Variable Name="HDR dynamic power factor" Value="0">
|
||||
<Spline Keys="0:0:36,0.25:0:36,0.5:0:65572,0.75:0:36,1:0:36,"/>
|
||||
<Spline Keys="0:0:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sky brightening (terrain occlusion)" Value="0">
|
||||
<Spline Keys="0:0:36,0.25:0:36,0.5:0:36,0.75:0:36,1:0:36,"/>
|
||||
<Spline Keys="0:0:36"/>
|
||||
</Variable>
|
||||
<Variable Name="Sun color multiplier" Value="9.999999">
|
||||
<Spline Keys="0:0.1:36,0.25:10:36,0.5:10:36,0.75:10:36,1:0.1:36,"/>
|
||||
<Variable Name="Sun color multiplier" Value="0.1">
|
||||
<Spline Keys="0:0.1:36"/>
|
||||
</Variable>
|
||||
</TimeOfDay>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
sys_game_name = "AutomatedTesting"
|
||||
sys_localization_folder = Localization
|
||||
ca_useIMG_CAF = 0
|
||||
sys_asserts=2
|
||||
sys_asserts=1
|
||||
|
||||
-- Enable warnings when asset loads take longer than the given millisecond threshold
|
||||
cl_assetLoadWarningEnable=true
|
||||
|
||||
@@ -247,7 +247,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_EDITOR false // If you set this to true you must also set 'ed_useAtomNativeViewport' to false (see /Code/Sandbox/Editor/ViewManager.cpp)
|
||||
#define LOAD_LEGACY_RENDERER_FOR_LAUNCHER false
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -1294,7 +1294,7 @@ bool CSystem::OpenRenderLibrary(int type, const SSystemInitParams& initParams)
|
||||
const char* libname = "";
|
||||
if (AZ::Interface<AzFramework::AtomActiveInterface>::Get())
|
||||
{
|
||||
libname = "CryRenderOther";
|
||||
libname = DLL_RENDERER_NULL;
|
||||
}
|
||||
else if (type == R_DX9_RENDERER)
|
||||
{
|
||||
|
||||
@@ -131,78 +131,18 @@ void CTextureManager::LoadDefaultTextures()
|
||||
#endif
|
||||
};
|
||||
|
||||
// Reduced list of default textures to load.
|
||||
const TextureEntry texturesFromFileReduced[] =
|
||||
for (const TextureEntry& entry : texturesFromFile)
|
||||
{
|
||||
{"NoTextureCM", "EngineAssets/TextureMsg/ReplaceMeCM.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"White", "EngineAssets/Textures/White.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"Gray", "EngineAssets/Textures/Grey.dds", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"Black", "EngineAssets/Textures/Black.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"BlackAlpha", "EngineAssets/Textures/BlackAlpha.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"BlackCM", "EngineAssets/Textures/BlackCM.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"FlatBump", "EngineAssets/Textures/White_ddn.tif", FT_DONT_RELEASE | FT_DONT_STREAM | FT_TEX_NORMAL_MAP },
|
||||
{"AverageMemoryUsage", "EngineAssets/Icons/AverageMemoryUsage.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"LowMemoryUsage", "EngineAssets/Icons/LowMemoryUsage.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"HighMemoryUsage", "EngineAssets/Icons/HighMemoryUsage.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"LivePreview", "EngineAssets/Icons/LivePreview.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
#if !defined(_RELEASE)
|
||||
{"NoTexture", "EngineAssets/TextureMsg/ReplaceMe.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"IconTextureCompiling", "EngineAssets/TextureMsg/TextureCompiling.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"IconTextureCompiling_a", "EngineAssets/TextureMsg/TextureCompiling_a.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"IconTextureCompiling_cm", "EngineAssets/TextureMsg/TextureCompiling_cm.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"IconTextureCompiling_ddn", "EngineAssets/TextureMsg/TextureCompiling_ddn.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"IconTextureCompiling_ddna", "EngineAssets/TextureMsg/TextureCompiling_ddna.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"DefaultMergedDetail", "EngineAssets/Textures/GreyAlpha.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"MipMapDebug", "EngineAssets/TextureMsg/MipMapDebug.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorBlue", "EngineAssets/TextureMsg/color_Blue.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorCyan", "EngineAssets/TextureMsg/color_Cyan.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorGreen", "EngineAssets/TextureMsg/color_Green.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorPurple", "EngineAssets/TextureMsg/color_Purple.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorRed", "EngineAssets/TextureMsg/color_Red.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorWhite", "EngineAssets/TextureMsg/color_White.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorYellow", "EngineAssets/TextureMsg/color_Yellow.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorOrange", "EngineAssets/TextureMsg/color_Orange.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
{"ColorMagenta", "EngineAssets/TextureMsg/color_Magenta.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
#else
|
||||
{"NoTexture", "EngineAssets/TextureMsg/ReplaceMeRelease.tif", FT_DONT_RELEASE | FT_DONT_STREAM },
|
||||
#endif
|
||||
};
|
||||
|
||||
// Loop over the appropriate texture list and load the textures, storing them in a map keyed by texture name.
|
||||
// Use reduced subset of textures for Other.
|
||||
if (AZ::Interface<AzFramework::AtomActiveInterface>::Get())
|
||||
{
|
||||
for (const TextureEntry& entry : texturesFromFileReduced)
|
||||
CTexture* pNewTexture = CTexture::ForName(entry.szFileName, entry.flags, eTF_Unknown);
|
||||
if (pNewTexture)
|
||||
{
|
||||
// Use EF_LoadTexture rather than CTexture::ForName
|
||||
CTexture* pNewTexture = static_cast<CTexture*>(gEnv->pRenderer->EF_LoadTexture(entry.szFileName, entry.flags));
|
||||
if (pNewTexture)
|
||||
{
|
||||
CCryNameTSCRC texEntry(entry.szTextureName);
|
||||
m_DefaultTextures[texEntry] = pNewTexture;
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Assert(false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
|
||||
AZ_Warning("[Shaders System]", false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
|
||||
}
|
||||
CCryNameTSCRC texEntry(entry.szTextureName);
|
||||
m_DefaultTextures[texEntry] = pNewTexture;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (const TextureEntry& entry : texturesFromFile)
|
||||
else
|
||||
{
|
||||
CTexture* pNewTexture = CTexture::ForName(entry.szFileName, entry.flags, eTF_Unknown);
|
||||
if (pNewTexture)
|
||||
{
|
||||
CCryNameTSCRC texEntry(entry.szTextureName);
|
||||
m_DefaultTextures[texEntry] = pNewTexture;
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Assert(false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
|
||||
AZ_Warning("[Shaders System]", false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
|
||||
}
|
||||
AZ_Assert(false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
|
||||
AZ_Warning("[Shaders System]", false, "Error - CTextureManager failed to load default texture %s", entry.szFileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,22 @@ namespace Physics
|
||||
->Field("Scale", &ShapeConfiguration::m_scale)
|
||||
;
|
||||
}
|
||||
|
||||
if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
|
||||
{
|
||||
#define REFLECT_SHAPETYPE_ENUM_VALUE(EnumValue) \
|
||||
behaviorContext->EnumProperty<(int)Physics::ShapeType::EnumValue>("ShapeType_"#EnumValue) \
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation) \
|
||||
->Attribute(AZ::Script::Attributes::Module, "physics");
|
||||
|
||||
// Note: Here we only expose the types that are available to the user in the editor
|
||||
REFLECT_SHAPETYPE_ENUM_VALUE(Box);
|
||||
REFLECT_SHAPETYPE_ENUM_VALUE(Sphere);
|
||||
REFLECT_SHAPETYPE_ENUM_VALUE(Cylinder);
|
||||
REFLECT_SHAPETYPE_ENUM_VALUE(PhysicsAsset);
|
||||
|
||||
#undef REFLECT_SHAPETYPE_ENUM_VALUE
|
||||
}
|
||||
}
|
||||
|
||||
void SphereShapeConfiguration::Reflect(AZ::ReflectContext* context)
|
||||
|
||||
@@ -348,6 +348,11 @@ namespace AzToolsFramework
|
||||
*/
|
||||
virtual bool AreAnyEntitiesSelected() = 0;
|
||||
|
||||
/*!
|
||||
* Returns the number of selected entities.
|
||||
*/
|
||||
virtual int GetSelectedEntitiesCount() = 0;
|
||||
|
||||
/*!
|
||||
* Retrieves the set of selected entities.
|
||||
* \return a list of entity Ids.
|
||||
|
||||
@@ -395,6 +395,7 @@ namespace AzToolsFramework
|
||||
->Event("MarkEntityDeselected", &ToolsApplicationRequests::MarkEntityDeselected)
|
||||
->Event("IsSelected", &ToolsApplicationRequests::IsSelected)
|
||||
->Event("AreAnyEntitiesSelected", &ToolsApplicationRequests::AreAnyEntitiesSelected)
|
||||
->Event("GetSelectedEntitiesCount", &ToolsApplicationRequests::GetSelectedEntitiesCount)
|
||||
;
|
||||
|
||||
behaviorContext->EBus<ToolsApplicationNotificationBus>("ToolsApplicationNotificationBus")
|
||||
|
||||
@@ -101,6 +101,7 @@ namespace AzToolsFramework
|
||||
SourceControlFileInfo GetSceneSourceControlInfo() override;
|
||||
|
||||
bool AreAnyEntitiesSelected() override { return !m_selectedEntities.empty(); }
|
||||
int GetSelectedEntitiesCount() override { return m_selectedEntities.size(); }
|
||||
const EntityIdList& GetSelectedEntities() override { return m_selectedEntities; }
|
||||
const EntityIdList& GetHighlightedEntities() override { return m_highlightedEntities; }
|
||||
void SetSelectedEntities(const EntityIdList& selectedEntities) override;
|
||||
|
||||
@@ -81,12 +81,17 @@ namespace UnitTest
|
||||
ToolsApplicationRequestBus::BroadcastResult(
|
||||
anyEntitySelected, &ToolsApplicationRequests::AreAnyEntitiesSelected);
|
||||
|
||||
int selectedEntitiesCount = 0;
|
||||
ToolsApplicationRequestBus::BroadcastResult(
|
||||
selectedEntitiesCount, &ToolsApplicationRequests::GetSelectedEntitiesCount);
|
||||
|
||||
EntityIdList selectedEntityIds;
|
||||
ToolsApplicationRequestBus::BroadcastResult(
|
||||
selectedEntityIds, &ToolsApplicationRequests::GetSelectedEntities);
|
||||
|
||||
EXPECT_TRUE(testEntitySelected);
|
||||
EXPECT_TRUE(anyEntitySelected);
|
||||
EXPECT_EQ(selectedEntitiesCount, 1);
|
||||
EXPECT_EQ(selectedEntityIds.size(), 1);
|
||||
EXPECT_EQ(selectedEntityIds.front(), testEntityId);
|
||||
|
||||
@@ -100,11 +105,15 @@ namespace UnitTest
|
||||
ToolsApplicationRequestBus::BroadcastResult(
|
||||
anyEntitySelected, &ToolsApplicationRequests::AreAnyEntitiesSelected);
|
||||
|
||||
ToolsApplicationRequestBus::BroadcastResult(
|
||||
selectedEntitiesCount, &ToolsApplicationRequests::GetSelectedEntitiesCount);
|
||||
|
||||
ToolsApplicationRequestBus::BroadcastResult(
|
||||
selectedEntityIds, &ToolsApplicationRequests::GetSelectedEntities);
|
||||
|
||||
EXPECT_FALSE(testEntitySelected);
|
||||
EXPECT_FALSE(anyEntitySelected);
|
||||
EXPECT_EQ(selectedEntitiesCount, 0);
|
||||
EXPECT_TRUE(selectedEntityIds.empty());
|
||||
}
|
||||
|
||||
@@ -141,11 +150,16 @@ namespace UnitTest
|
||||
ToolsApplicationRequestBus::BroadcastResult(
|
||||
anyEntitySelected, &ToolsApplicationRequests::AreAnyEntitiesSelected);
|
||||
|
||||
int selectedEntitiesCount = 0;
|
||||
ToolsApplicationRequestBus::BroadcastResult(
|
||||
selectedEntitiesCount, &ToolsApplicationRequests::GetSelectedEntitiesCount);
|
||||
|
||||
EntityIdList actualSelectedEntityIds;
|
||||
ToolsApplicationRequestBus::BroadcastResult(
|
||||
actualSelectedEntityIds, &ToolsApplicationRequests::GetSelectedEntities);
|
||||
|
||||
EXPECT_TRUE(anyEntitySelected);
|
||||
EXPECT_EQ(selectedEntitiesCount, expectedSelectedEntityIds.size());
|
||||
EXPECT_EQ(actualSelectedEntityIds.size(), expectedSelectedEntityIds.size());
|
||||
for (auto& id : expectedSelectedEntityIds)
|
||||
{
|
||||
@@ -160,10 +174,14 @@ namespace UnitTest
|
||||
ToolsApplicationRequestBus::BroadcastResult(
|
||||
anyEntitySelected, &ToolsApplicationRequests::AreAnyEntitiesSelected);
|
||||
|
||||
ToolsApplicationRequestBus::BroadcastResult(
|
||||
selectedEntitiesCount, &ToolsApplicationRequests::GetSelectedEntitiesCount);
|
||||
|
||||
ToolsApplicationRequestBus::BroadcastResult(
|
||||
actualSelectedEntityIds, &ToolsApplicationRequests::GetSelectedEntities);
|
||||
|
||||
EXPECT_TRUE(anyEntitySelected);
|
||||
EXPECT_EQ(selectedEntitiesCount, expectedSelectedEntityIds.size());
|
||||
EXPECT_EQ(actualSelectedEntityIds.size(), expectedSelectedEntityIds.size());
|
||||
for (auto& id : expectedSelectedEntityIds)
|
||||
{
|
||||
|
||||
@@ -9,17 +9,10 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
if (LY_MONOLITHIC_GAME) # only Atom is supported in monolithic
|
||||
set(LY_BUILD_DEPENDENCIES
|
||||
PUBLIC
|
||||
Legacy::CryRenderOther
|
||||
)
|
||||
else()
|
||||
set(LY_BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
Legacy::CryRenderD3D11
|
||||
)
|
||||
endif()
|
||||
set(LY_BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
Legacy::CryRenderD3D11
|
||||
)
|
||||
|
||||
set(ICON_FILE ${project_real_path}/Gem/Resources/GameSDK.ico)
|
||||
if(NOT EXISTS ${ICON_FILE})
|
||||
|
||||
@@ -5232,6 +5232,13 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[])
|
||||
AzQtComponents::Utilities::HandleDpiAwareness(AzQtComponents::Utilities::SystemDpiAware);
|
||||
Editor::EditorQtApplication app(argc, argv);
|
||||
|
||||
if (app.arguments().contains("-autotest_mode"))
|
||||
{
|
||||
// Nullroute all stdout to null for automated tests, this way we make sure
|
||||
// that the test result output is not polluted with unrelated output data.
|
||||
theApp->RedirectStdoutToNull();
|
||||
}
|
||||
|
||||
// Hook the trace bus to catch errors, boot the AZ app after the QApplication is up
|
||||
int ret = 0;
|
||||
|
||||
@@ -5249,13 +5256,6 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (app.arguments().contains("-autotest_mode"))
|
||||
{
|
||||
// Nullroute all stdout to null for automated tests, this way we make sure
|
||||
// that the test result output is not polluted with unrelated output data.
|
||||
theApp->RedirectStdoutToNull();
|
||||
}
|
||||
|
||||
AzToolsFramework::EditorEvents::Bus::Broadcast(&AzToolsFramework::EditorEvents::NotifyQtApplicationAvailable, &app);
|
||||
|
||||
#if defined(AZ_PLATFORM_MAC)
|
||||
|
||||
@@ -232,7 +232,6 @@ int EditorViewportWidget::OnCreate()
|
||||
{
|
||||
m_renderer = GetIEditor()->GetRenderer();
|
||||
m_engine = GetIEditor()->Get3DEngine();
|
||||
assert(m_engine);
|
||||
|
||||
CreateRenderContext();
|
||||
|
||||
@@ -793,8 +792,14 @@ void EditorViewportWidget::OnRender()
|
||||
// This is necessary so that automated editor tests using the null renderer to test systems like dynamic vegetation
|
||||
// are still able to manipulate the current logical camera position, even if nothing is rendered.
|
||||
GetIEditor()->GetSystem()->SetViewCamera(m_Camera);
|
||||
GetIEditor()->GetRenderer()->SetCamera(gEnv->pSystem->GetViewCamera());
|
||||
m_engine->RenderWorld(0, SRenderingPassInfo::CreateGeneralPassRenderingInfo(m_Camera), __FUNCTION__);
|
||||
if (GetIEditor()->GetRenderer())
|
||||
{
|
||||
GetIEditor()->GetRenderer()->SetCamera(gEnv->pSystem->GetViewCamera());
|
||||
}
|
||||
if (m_engine)
|
||||
{
|
||||
m_engine->RenderWorld(0, SRenderingPassInfo::CreateGeneralPassRenderingInfo(m_Camera), __FUNCTION__);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -886,8 +891,7 @@ void EditorViewportWidget::OnBeginPrepareRender()
|
||||
fov = 2 * atanf((h * tan(fov / 2)) / maxTargetHeight);
|
||||
}
|
||||
}
|
||||
|
||||
m_Camera.SetFrustum(w, h, fov, fNearZ, gEnv->p3DEngine->GetMaxViewDistance());
|
||||
m_Camera.SetFrustum(w, h, fov, fNearZ);
|
||||
}
|
||||
|
||||
GetIEditor()->GetSystem()->SetViewCamera(m_Camera);
|
||||
@@ -2607,8 +2611,7 @@ bool EditorViewportWidget::GetActiveCameraPosition(AZ::Vector3& cameraPos)
|
||||
{
|
||||
if (GetIEditor()->IsInGameMode())
|
||||
{
|
||||
const Vec3 camPos = m_engine->GetRenderingCamera().GetPosition();
|
||||
cameraPos = LYVec3ToAZVec3(camPos);
|
||||
cameraPos = m_renderViewport->GetViewportContext()->GetCameraTransform().GetTranslation();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "Include/ITransformManipulator.h"
|
||||
#include "ActionManager.h"
|
||||
#include "Settings.h"
|
||||
#include "Objects/SelectionGroup.h"
|
||||
#include "Include/IObjectManager.h"
|
||||
#include "MathConversion.h"
|
||||
|
||||
@@ -191,10 +190,12 @@ void CInfoBar::IdleUpdate()
|
||||
|
||||
Vec3 marker = GetIEditor()->GetMarkerPosition();
|
||||
|
||||
CSelectionGroup* selection = GetIEditor()->GetSelection();
|
||||
if (selection->GetCount() != m_numSelected)
|
||||
int selectedEntitiesCount = 0;
|
||||
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(
|
||||
selectedEntitiesCount, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntitiesCount);
|
||||
if (selectedEntitiesCount != m_numSelected)
|
||||
{
|
||||
m_numSelected = selection->GetCount();
|
||||
m_numSelected = selectedEntitiesCount;
|
||||
updateUI = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -525,6 +525,11 @@ void CMaterialManager::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CMaterialManager::ReloadDirtyMaterials()
|
||||
{
|
||||
if (!GetIEditor()->Get3DEngine())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IMaterialManager* runtimeMaterialManager = GetIEditor()->Get3DEngine()->GetMaterialManager();
|
||||
|
||||
uint32 mtlCount = 0;
|
||||
@@ -550,7 +555,6 @@ void CMaterialManager::ReloadDirtyMaterials()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -744,12 +748,15 @@ int CMaterialManager::GetHighlightFlags(CMaterial* pMaterial) const
|
||||
result |= eHighlight_NoSurfaceType;
|
||||
}
|
||||
|
||||
if (ISurfaceTypeManager* pSurfaceManager = GetIEditor()->Get3DEngine()->GetMaterialManager()->GetSurfaceTypeManager())
|
||||
if (GetIEditor()->Get3DEngine())
|
||||
{
|
||||
const ISurfaceType* pSurfaceType = pSurfaceManager->GetSurfaceTypeByName(surfaceTypeName.toUtf8().data());
|
||||
if (pSurfaceType && pSurfaceType->GetBreakability() != 0)
|
||||
if (ISurfaceTypeManager* pSurfaceManager = GetIEditor()->Get3DEngine()->GetMaterialManager()->GetSurfaceTypeManager())
|
||||
{
|
||||
result |= eHighlight_Breakable;
|
||||
const ISurfaceType* pSurfaceType = pSurfaceManager->GetSurfaceTypeByName(surfaceTypeName.toUtf8().data());
|
||||
if (pSurfaceType && pSurfaceType->GetBreakability() != 0)
|
||||
{
|
||||
result |= eHighlight_Breakable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,5 +11,5 @@
|
||||
|
||||
set(LY_BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
Legacy::CryRenderD3D11
|
||||
)
|
||||
Legacy::CryRenderNULL
|
||||
)
|
||||
@@ -1,2 +0,0 @@
|
||||
#Ignore these directories
|
||||
SDKs
|
||||
@@ -1,22 +0,0 @@
|
||||
Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
|
||||
and Clark Cooper
|
||||
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1 +0,0 @@
|
||||
MotionBuilder support was removed in CL 88235, please back it out if this decision is reversed. This was for bug LMBR-9220
|
||||
@@ -97,6 +97,9 @@ namespace AZ
|
||||
};
|
||||
} // DataTypes
|
||||
} // SceneAPI
|
||||
|
||||
AZ_TYPE_INFO_SPECIALIZE(SceneAPI::DataTypes::Color, "{937E3BF8-5204-4D40-A8DA-C8F083C89F9F}");
|
||||
|
||||
} // AZ
|
||||
|
||||
namespace AZStd
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
*/
|
||||
|
||||
#include <SceneAPI/SceneData/GraphData/AnimationData.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -18,6 +20,31 @@ namespace AZ
|
||||
{
|
||||
namespace GraphData
|
||||
{
|
||||
void AnimationData::Reflect(ReflectContext* context)
|
||||
{
|
||||
SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context);
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->Class<AnimationData, SceneAPI::DataTypes::IAnimationData>()
|
||||
->Version(1);
|
||||
}
|
||||
|
||||
BehaviorContext* behaviorContext = azrtti_cast<BehaviorContext*>(context);
|
||||
if (behaviorContext)
|
||||
{
|
||||
behaviorContext->Class<SceneAPI::DataTypes::IAnimationData>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene")
|
||||
->Method("GetKeyFrameCount", &SceneAPI::DataTypes::IAnimationData::GetKeyFrameCount)
|
||||
->Method("GetKeyFrame", &SceneAPI::DataTypes::IAnimationData::GetKeyFrame)
|
||||
->Method("GetTimeStepBetweenFrames", &SceneAPI::DataTypes::IAnimationData::GetTimeStepBetweenFrames);
|
||||
|
||||
behaviorContext->Class<AnimationData>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene");
|
||||
}
|
||||
}
|
||||
|
||||
AnimationData::AnimationData()
|
||||
: m_timeStepBetweenFrames(1.0/30.0) // default value
|
||||
{
|
||||
@@ -61,6 +88,32 @@ namespace AZ
|
||||
}
|
||||
|
||||
|
||||
void BlendShapeAnimationData::Reflect(ReflectContext* context)
|
||||
{
|
||||
SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context);
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->Class<BlendShapeAnimationData, SceneAPI::DataTypes::IBlendShapeAnimationData>()
|
||||
->Version(1);
|
||||
}
|
||||
|
||||
BehaviorContext* behaviorContext = azrtti_cast<BehaviorContext*>(context);
|
||||
if (behaviorContext)
|
||||
{
|
||||
behaviorContext->Class<SceneAPI::DataTypes::IBlendShapeAnimationData>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene")
|
||||
->Method("GetBlendShapeName", &SceneAPI::DataTypes::IBlendShapeAnimationData::GetBlendShapeName)
|
||||
->Method("GetKeyFrameCount", &SceneAPI::DataTypes::IBlendShapeAnimationData::GetKeyFrameCount)
|
||||
->Method("GetKeyFrame", &SceneAPI::DataTypes::IBlendShapeAnimationData::GetKeyFrame)
|
||||
->Method("GetTimeStepBetweenFrames", &SceneAPI::DataTypes::IBlendShapeAnimationData::GetTimeStepBetweenFrames);
|
||||
|
||||
behaviorContext->Class<BlendShapeAnimationData>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene");
|
||||
}
|
||||
}
|
||||
|
||||
BlendShapeAnimationData::BlendShapeAnimationData()
|
||||
: m_timeStepBetweenFrames(1 / 30.0) // default value
|
||||
{
|
||||
|
||||
@@ -30,6 +30,8 @@ namespace AZ
|
||||
public:
|
||||
AZ_RTTI(AnimationData, "{D350732E-4727-41C8-95E0-FBAF5F2AC074}", SceneAPI::DataTypes::IAnimationData);
|
||||
|
||||
static void Reflect(ReflectContext* context);
|
||||
|
||||
SCENE_DATA_API AnimationData();
|
||||
SCENE_DATA_API ~AnimationData() override = default;
|
||||
SCENE_DATA_API virtual void AddKeyFrame(const SceneAPI::DataTypes::MatrixType& keyFrameTransform);
|
||||
@@ -53,6 +55,8 @@ namespace AZ
|
||||
public:
|
||||
AZ_RTTI(BlendShapeAnimationData, "{02766CCF-BDA7-46B6-9BB1-58A90C1AD6AA}", SceneAPI::DataTypes::IBlendShapeAnimationData);
|
||||
|
||||
static void Reflect(ReflectContext* context);
|
||||
|
||||
SCENE_DATA_API BlendShapeAnimationData();
|
||||
SCENE_DATA_API ~BlendShapeAnimationData() override = default;
|
||||
SCENE_DATA_API void CloneAttributesFrom(const IGraphObject* sourceObject) override;
|
||||
|
||||
@@ -12,9 +12,13 @@
|
||||
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
#include <SceneAPI/SceneData/GraphData/BlendShapeData.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
AZ_TYPE_INFO_SPECIALIZE(SceneAPI::DataTypes::IBlendShapeData::Face, "{C972EC9A-3A5C-47CD-9A92-ECB4C0C0451C}");
|
||||
|
||||
namespace SceneData
|
||||
{
|
||||
namespace GraphData
|
||||
@@ -23,6 +27,82 @@ namespace AZ
|
||||
|
||||
BlendShapeData::~BlendShapeData() = default;
|
||||
|
||||
void BlendShapeData::Reflect(ReflectContext* context)
|
||||
{
|
||||
SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context);
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->Class<BlendShapeData, SceneAPI::DataTypes::IBlendShapeData>()
|
||||
->Version(1);
|
||||
}
|
||||
|
||||
BehaviorContext* behaviorContext = azrtti_cast<BehaviorContext*>(context);
|
||||
if (behaviorContext)
|
||||
{
|
||||
behaviorContext->Class<SceneAPI::DataTypes::IBlendShapeData>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene")
|
||||
->Method("GetUsedControlPointCount", &SceneAPI::DataTypes::IBlendShapeData::GetUsedControlPointCount)
|
||||
->Method("GetControlPointIndex", &SceneAPI::DataTypes::IBlendShapeData::GetControlPointIndex)
|
||||
->Method("GetUsedPointIndexForControlPoint", &SceneAPI::DataTypes::IBlendShapeData::GetUsedPointIndexForControlPoint)
|
||||
->Method("GetVertexCount", &SceneAPI::DataTypes::IBlendShapeData::GetVertexCount)
|
||||
->Method("GetFaceCount", &SceneAPI::DataTypes::IBlendShapeData::GetFaceCount)
|
||||
->Method("GetFaceInfo", &SceneAPI::DataTypes::IBlendShapeData::GetFaceInfo)
|
||||
->Method("GetPosition", &SceneAPI::DataTypes::IBlendShapeData::GetPosition)
|
||||
->Method("GetNormal", &SceneAPI::DataTypes::IBlendShapeData::GetNormal)
|
||||
->Method("GetFaceVertexIndex", &SceneAPI::DataTypes::IBlendShapeData::GetFaceVertexIndex);
|
||||
|
||||
behaviorContext->Class<SceneAPI::DataTypes::IBlendShapeData::Face>("BlendShapeDataFace")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene")
|
||||
->Method("GetVertexIndex", [](const SceneAPI::DataTypes::IBlendShapeData::Face& self, int index)
|
||||
{
|
||||
if (index >= 0 && index < 3)
|
||||
{
|
||||
return self.vertexIndex[index];
|
||||
}
|
||||
return aznumeric_cast<unsigned int>(0);
|
||||
});
|
||||
|
||||
behaviorContext->Class<BlendShapeData>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene")
|
||||
->Method("GetUV", &BlendShapeData::GetUV)
|
||||
->Method("GetTangent", [](const BlendShapeData& self, size_t index)
|
||||
{
|
||||
if (index < self.GetTangents().size())
|
||||
{
|
||||
return self.GetTangents().at(index);
|
||||
}
|
||||
AZ_Error("SceneGraphData", false, "Cannot get to tangent at index(%zu)", index);
|
||||
return Vector4::CreateZero();
|
||||
})
|
||||
->Method("GetBitangent", [](const BlendShapeData& self, size_t index)
|
||||
{
|
||||
if (index < self.GetBitangents().size())
|
||||
{
|
||||
return self.GetBitangents().at(index);
|
||||
}
|
||||
AZ_Error("SceneGraphData", false, "Cannot get to bitangents at index(%zu)", index);
|
||||
return Vector3::CreateZero();
|
||||
})
|
||||
->Method("GetColor", [](const BlendShapeData& self, AZ::u8 colorSetIndex, AZ::u8 colorIndex)
|
||||
{
|
||||
SceneAPI::DataTypes::Color color(0,0,0,0);
|
||||
if (colorSetIndex < MaxNumColorSets)
|
||||
{
|
||||
const AZStd::vector<SceneAPI::DataTypes::Color>& colorChannel = self.GetColors(colorSetIndex);
|
||||
if (colorIndex < colorChannel.size())
|
||||
{
|
||||
return colorChannel[colorIndex];
|
||||
}
|
||||
}
|
||||
AZ_Error("SceneGraphData", false, "Cannot get to color setIndex(%d) at colorIndex(%d)", colorSetIndex, colorIndex);
|
||||
return color;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void BlendShapeData::AddPosition(const Vector3& position)
|
||||
{
|
||||
m_positions.push_back(position);
|
||||
|
||||
@@ -31,6 +31,8 @@ namespace AZ
|
||||
public:
|
||||
AZ_RTTI(BlendShapeData, "{FF875C22-2E4F-4CE3-BA49-09BF78C70A09}", SceneAPI::DataTypes::IBlendShapeData)
|
||||
|
||||
SCENE_DATA_API static void Reflect(ReflectContext* context);
|
||||
|
||||
// Maximum number of color sets matches limitation set in assImp (AI_MAX_NUMBER_OF_COLOR_SETS)
|
||||
static constexpr AZ::u8 MaxNumColorSets = 8;
|
||||
// Maximum number of uv sets matches limitation set in assImp (AI_MAX_NUMBER_OF_TEXTURECOORDS)
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
AZ_TYPE_INFO_SPECIALIZE(SceneAPI::DataTypes::Color, "{937E3BF8-5204-4D40-A8DA-C8F083C89F9F}");
|
||||
|
||||
namespace SceneData
|
||||
{
|
||||
namespace GraphData
|
||||
@@ -40,7 +38,7 @@ namespace AZ
|
||||
->Method("GetCount", &MeshVertexColorData::GetCount )
|
||||
->Method("GetColor", &MeshVertexColorData::GetColor);
|
||||
|
||||
behaviorContext->Class<AZ::SceneAPI::DataTypes::Color>("MeshVertexColor")
|
||||
behaviorContext->Class<AZ::SceneAPI::DataTypes::Color>("VertexColor")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene")
|
||||
->Property("red", BehaviorValueGetter(&AZ::SceneAPI::DataTypes::Color::red), nullptr)
|
||||
|
||||
@@ -81,8 +81,9 @@ namespace AZ
|
||||
SceneData::SceneNodeSelectionList::Reflect(context);
|
||||
|
||||
// Graph objects
|
||||
context->Class<AZ::SceneData::GraphData::AnimationData>()->Version(1);
|
||||
context->Class<AZ::SceneData::GraphData::BlendShapeData>()->Version(1);
|
||||
AZ::SceneData::GraphData::AnimationData::Reflect(context);
|
||||
AZ::SceneData::GraphData::BlendShapeAnimationData::Reflect(context);
|
||||
AZ::SceneData::GraphData::BlendShapeData::Reflect(context);
|
||||
AZ::SceneData::GraphData::BoneData::Reflect(context);
|
||||
AZ::SceneData::GraphData::MaterialData::Reflect(context);
|
||||
AZ::SceneData::GraphData::MeshData::Reflect(context);
|
||||
@@ -107,6 +108,9 @@ namespace AZ
|
||||
AZ::SceneData::GraphData::MeshVertexUVData::Reflect(context);
|
||||
AZ::SceneData::GraphData::MeshVertexTangentData::Reflect(context);
|
||||
AZ::SceneData::GraphData::MeshVertexBitangentData::Reflect(context);
|
||||
AZ::SceneData::GraphData::AnimationData::Reflect(context);
|
||||
AZ::SceneData::GraphData::BlendShapeAnimationData::Reflect(context);
|
||||
AZ::SceneData::GraphData::BlendShapeData::Reflect(context);
|
||||
}
|
||||
} // namespace SceneAPI
|
||||
} // namespace AZ
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#include <SceneAPI/SceneData/GraphData/MeshVertexColorData.h>
|
||||
#include <SceneAPI/SceneData/GraphData/MeshVertexTangentData.h>
|
||||
#include <SceneAPI/SceneData/GraphData/MeshVertexUVData.h>
|
||||
#include <SceneAPI/SceneData/GraphData/AnimationData.h>
|
||||
#include <SceneAPI/SceneData/GraphData/BlendShapeData.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -101,6 +103,53 @@ namespace AZ
|
||||
tangentData->SetTangentSetIndex(2);
|
||||
return true;
|
||||
}
|
||||
else if (data.get_type_info().m_id == azrtti_typeid<AZ::SceneData::GraphData::AnimationData>())
|
||||
{
|
||||
auto* animationData = AZStd::any_cast<AZ::SceneData::GraphData::AnimationData>(&data);
|
||||
animationData->ReserveKeyFrames(3);
|
||||
animationData->AddKeyFrame(DataTypes::MatrixType::CreateFromValue(1.0));
|
||||
animationData->AddKeyFrame(DataTypes::MatrixType::CreateFromValue(2.0));
|
||||
animationData->AddKeyFrame(DataTypes::MatrixType::CreateFromValue(3.0));
|
||||
animationData->SetTimeStepBetweenFrames(4.0);
|
||||
return true;
|
||||
}
|
||||
else if (data.get_type_info().m_id == azrtti_typeid<AZ::SceneData::GraphData::BlendShapeAnimationData>())
|
||||
{
|
||||
auto* blendShapeAnimationData = AZStd::any_cast<AZ::SceneData::GraphData::BlendShapeAnimationData>(&data);
|
||||
blendShapeAnimationData->SetBlendShapeName("mockBlendShapeName");
|
||||
blendShapeAnimationData->ReserveKeyFrames(3);
|
||||
blendShapeAnimationData->AddKeyFrame(1.0);
|
||||
blendShapeAnimationData->AddKeyFrame(2.0);
|
||||
blendShapeAnimationData->AddKeyFrame(3.0);
|
||||
blendShapeAnimationData->SetTimeStepBetweenFrames(4.0);
|
||||
return true;
|
||||
}
|
||||
else if (data.get_type_info().m_id == azrtti_typeid<AZ::SceneData::GraphData::BlendShapeData>())
|
||||
{
|
||||
auto* blendShapeData = AZStd::any_cast<AZ::SceneData::GraphData::BlendShapeData>(&data);
|
||||
blendShapeData->AddPosition({ 1.0, 2.0, 3.0 });
|
||||
blendShapeData->AddPosition({ 2.0, 3.0, 4.0 });
|
||||
blendShapeData->AddPosition({ 3.0, 4.0, 5.0 });
|
||||
blendShapeData->AddNormal({ 0.1, 0.2, 0.3 });
|
||||
blendShapeData->AddNormal({ 0.2, 0.3, 0.4 });
|
||||
blendShapeData->AddNormal({ 0.3, 0.4, 0.5 });
|
||||
blendShapeData->AddTangentAndBitangent(Vector4{ 0.1f, 0.2f, 0.3f, 0.4f }, { 0.0, 0.1, 0.2 });
|
||||
blendShapeData->AddTangentAndBitangent(Vector4{ 0.2f, 0.3f, 0.4f, 0.5f }, { 0.1, 0.2, 0.3 });
|
||||
blendShapeData->AddTangentAndBitangent(Vector4{ 0.3f, 0.4f, 0.5f, 0.6f }, { 0.2, 0.3, 0.4 });
|
||||
blendShapeData->AddUV(Vector2{ 0.9, 0.8 }, 0);
|
||||
blendShapeData->AddUV(Vector2{ 0.7, 0.7 }, 1);
|
||||
blendShapeData->AddUV(Vector2{ 0.6, 0.6 }, 2);
|
||||
blendShapeData->AddColor(DataTypes::Color{ 0.1, 0.2, 0.3, 0.4 }, 0);
|
||||
blendShapeData->AddColor(DataTypes::Color{ 0.2, 0.3, 0.4, 0.5 }, 1);
|
||||
blendShapeData->AddColor(DataTypes::Color{ 0.3, 0.4, 0.5, 0.6 }, 2);
|
||||
blendShapeData->AddFace({ 0, 1, 2 });
|
||||
blendShapeData->AddFace({ 1, 2, 0 });
|
||||
blendShapeData->AddFace({ 2, 0, 1 });
|
||||
blendShapeData->SetVertexIndexToControlPointIndexMap(0, 1);
|
||||
blendShapeData->SetVertexIndexToControlPointIndexMap(1, 2);
|
||||
blendShapeData->SetVertexIndexToControlPointIndexMap(2, 0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -296,6 +345,116 @@ namespace AZ
|
||||
ExpectExecute("TestExpectIntegerEquals(meshVertexTangentData:GetTangentSetIndex(), 2)");
|
||||
ExpectExecute("TestExpectTrue(meshVertexTangentData:GetTangentSpace(), MeshVertexTangentData.EMotionFX)");
|
||||
}
|
||||
|
||||
TEST_F(GrapDatahBehaviorScriptTest, SceneGraph_AnimationData_AccessWorks)
|
||||
{
|
||||
ExpectExecute("animationData = AnimationData()");
|
||||
ExpectExecute("TestExpectTrue(animationData ~= nil)");
|
||||
ExpectExecute("MockGraphData.FillData(animationData)");
|
||||
ExpectExecute("TestExpectIntegerEquals(animationData:GetKeyFrameCount(), 3)");
|
||||
ExpectExecute("TestExpectFloatEquals(animationData:GetTimeStepBetweenFrames(), 4.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(animationData:GetKeyFrame(0).basisX.x, 1.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(animationData:GetKeyFrame(1).basisX.y, 2.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(animationData:GetKeyFrame(2).basisX.z, 3.0)");
|
||||
}
|
||||
|
||||
TEST_F(GrapDatahBehaviorScriptTest, SceneGraph_BlendShapeAnimationData_AccessWorks)
|
||||
{
|
||||
ExpectExecute("blendShapeAnimationData = BlendShapeAnimationData()");
|
||||
ExpectExecute("TestExpectTrue(blendShapeAnimationData ~= nil)");
|
||||
ExpectExecute("MockGraphData.FillData(blendShapeAnimationData)");
|
||||
ExpectExecute("TestExpectTrue(blendShapeAnimationData:GetBlendShapeName() == 'mockBlendShapeName')");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeAnimationData:GetKeyFrameCount(), 3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeAnimationData:GetKeyFrame(0), 1.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeAnimationData:GetKeyFrame(1), 2.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeAnimationData:GetKeyFrame(2), 3.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeAnimationData:GetTimeStepBetweenFrames(), 4.0)");
|
||||
}
|
||||
|
||||
TEST_F(GrapDatahBehaviorScriptTest, SceneGraph_BlendShapeData_AccessWorks)
|
||||
{
|
||||
ExpectExecute("blendShapeData = BlendShapeData()");
|
||||
ExpectExecute("TestExpectTrue(blendShapeData ~= nil)");
|
||||
ExpectExecute("MockGraphData.FillData(blendShapeData)");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetUsedControlPointCount(), 3)");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetVertexCount(), 3)");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetFaceCount(), 3)");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetFaceVertexIndex(0, 2), 2)");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetFaceVertexIndex(1, 0), 1)");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetFaceVertexIndex(2, 1), 0)");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetControlPointIndex(0), 1)");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetControlPointIndex(1), 2)");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetControlPointIndex(2), 0)");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetUsedPointIndexForControlPoint(0), 2)");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetUsedPointIndexForControlPoint(1), 0)");
|
||||
ExpectExecute("TestExpectIntegerEquals(blendShapeData:GetUsedPointIndexForControlPoint(2), 1)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(0).x, 1.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(0).y, 2.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(0).z, 3.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(1).x, 2.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(1).y, 3.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(1).z, 4.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(2).x, 3.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(2).y, 4.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetPosition(2).z, 5.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(0).x, 0.1)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(0).y, 0.2)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(0).z, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(1).x, 0.2)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(1).y, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(1).z, 0.4)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(2).x, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(2).y, 0.4)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetNormal(2).z, 0.5)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(0):GetVertexIndex(0), 0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(0):GetVertexIndex(1), 1)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(0):GetVertexIndex(2), 2)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(1):GetVertexIndex(0), 1)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(1):GetVertexIndex(1), 2)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(1):GetVertexIndex(2), 0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(2):GetVertexIndex(0), 2)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(2):GetVertexIndex(1), 0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetFaceInfo(2):GetVertexIndex(2), 1)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetUV(0, 0).x, 0.9)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetUV(0, 0).y, 0.8)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetUV(0, 1).x, 0.7)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetUV(0, 1).y, 0.7)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetUV(0, 2).x, 0.6)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetUV(0, 2).y, 0.6)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(0, 0).red, 0.1)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(0, 0).green, 0.2)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(0, 0).blue, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(0, 0).alpha, 0.4)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(1, 0).red, 0.2)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(1, 0).green, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(1, 0).blue, 0.4)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(1, 0).alpha, 0.5)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(2, 0).red, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(2, 0).green, 0.4)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(2, 0).blue, 0.5)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetColor(2, 0).alpha, 0.6)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(0).x, 0.1)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(0).y, 0.2)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(0).z, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(0).w, 0.4)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(1).x, 0.2)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(1).y, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(1).z, 0.4)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(1).w, 0.5)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(2).x, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(2).y, 0.4)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(2).z, 0.5)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetTangent(2).w, 0.6)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(0).x, 0.0)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(0).y, 0.1)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(0).z, 0.2)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(1).x, 0.1)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(1).y, 0.2)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(1).z, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(2).x, 0.2)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(2).y, 0.3)");
|
||||
ExpectExecute("TestExpectFloatEquals(blendShapeData:GetBitangent(2).z, 0.4)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -9,7 +9,6 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(LY_COMPILE_OPTIONS
|
||||
PRIVATE
|
||||
-xobjective-c++
|
||||
set(GLAD_VULKAN_COMPILE_DEFINITIONS
|
||||
VK_USE_PLATFORM_XCB_KHR
|
||||
)
|
||||
@@ -188,11 +188,11 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
AZ::AzCore
|
||||
Gem::Atom_RHI.Edit
|
||||
Gem::Atom_RHI.Reflect
|
||||
Gem::Atom_RHI.Public
|
||||
Gem::Atom_RHI_Vulkan.Reflect
|
||||
Gem::Atom_RHI_Vulkan.Builders.Static
|
||||
Gem::Atom_RHI.Edit
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
+3
@@ -10,3 +10,6 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
#include <xcb/xcbext.h>
|
||||
|
||||
+10
-11
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or
|
||||
* a third party where indicated.
|
||||
* 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,
|
||||
@@ -9,14 +9,13 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
|
||||
namespace Platform
|
||||
{
|
||||
WIN_HWND GetNativeWindowHandle()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/base.h>
|
||||
#include <AzCore/PlatformIncl.h>
|
||||
#include <AzCore/std/algorithm.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <limits.h>
|
||||
#include <RHI/Vulkan.h>
|
||||
|
||||
#define AZ_VULKAN_SURFACE_EXTENSION_NAME VK_KHR_XCB_SURFACE_EXTENSION_NAME
|
||||
+1
@@ -11,4 +11,5 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Atom_RHI_Vulkan_precompiled_Linux.h>
|
||||
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
set(PAL_TRAIT_ATOM_RHI_VULKAN_SUPPORTED FALSE)
|
||||
set(PAL_TRAIT_ATOM_RHI_VULKAN_SUPPORTED TRUE)
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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 <Atom/RHI.Reflect/Vulkan/ReflectSystemComponent.h>
|
||||
#include <Atom/RHI.Reflect/ReflectSystemComponent.h>
|
||||
#include <AzCore/Module/Module.h>
|
||||
#include <RHI.Builders/ShaderPlatformInterfaceSystemComponent.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace Vulkan
|
||||
{
|
||||
|
||||
//! Exposes Vulkan RHI Building components to the Asset Processor.
|
||||
class BuilderModule final
|
||||
: public AZ::Module
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(BuilderModule, "{C22CF1CB-59AA-4247-A983-BC371A7B0513}", AZ::Module);
|
||||
|
||||
BuilderModule()
|
||||
{
|
||||
m_descriptors.insert(m_descriptors.end(), {
|
||||
ShaderPlatformInterfaceSystemComponent::CreateDescriptor()
|
||||
});
|
||||
}
|
||||
|
||||
AZ::ComponentTypeList GetRequiredSystemComponents() const override
|
||||
{
|
||||
return
|
||||
{
|
||||
azrtti_typeid<ShaderPlatformInterfaceSystemComponent>(),
|
||||
};
|
||||
}
|
||||
};
|
||||
} // namespace Vulkan
|
||||
} // namespace AZ
|
||||
|
||||
// DO NOT MODIFY THIS LINE UNLESS YOU RENAME THE GEM
|
||||
// The first parameter should be GemName_GemIdLower
|
||||
// The second should be the fully qualified name of the class above
|
||||
AZ_DECLARE_MODULE_CLASS(Gem_Atom_RHI_Vulkan_Builders, AZ::Vulkan::BuilderModule);
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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 "Atom_RHI_Vulkan_precompiled.h"
|
||||
#include <RHI/Conversion.h>
|
||||
#include <RHI/Instance.h>
|
||||
#include <RHI/WSISurface.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace Vulkan
|
||||
{
|
||||
RHI::ResultCode WSISurface::BuildNativeSurface()
|
||||
{
|
||||
Instance& instance = Instance::GetInstance();
|
||||
|
||||
VkXcbSurfaceCreateInfoKHR createInfo{};
|
||||
createInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR;
|
||||
createInfo.pNext = nullptr;
|
||||
createInfo.flags = 0;
|
||||
createInfo.window = static_cast<xcb_window_t>(m_descriptor.m_windowHandle.GetIndex());
|
||||
const VkResult result = vkCreateXcbSurfaceKHR(instance.GetNativeInstance(), &createInfo, nullptr, &m_nativeSurface);
|
||||
AssertSuccess(result);
|
||||
|
||||
return ConvertResult(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#define AZ_TRAIT_ATOM_SHADERBUILDER_DXC "Builders/DirectXShaderCompilerAz/dxc.exe"
|
||||
#define AZ_TRAIT_ATOM_SHADERBUILDER_DXC "Builders/DirectXShaderCompilerAz/bin/dxc"
|
||||
#define AZ_TRAIT_ATOM_VULKAN_DISABLE_DUAL_SOURCE_BLENDING 0
|
||||
#define AZ_TRAIT_ATOM_VULKAN_DLL ""
|
||||
#define AZ_TRAIT_ATOM_VULKAN_DLL_1 ""
|
||||
|
||||
@@ -10,4 +10,5 @@
|
||||
#
|
||||
|
||||
set(FILES
|
||||
RHI.Builders/BuilderModule_Linux.cpp
|
||||
)
|
||||
|
||||
@@ -10,5 +10,4 @@
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/Unimplemented/Empty_Unimplemented.cpp
|
||||
)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/Unimplemented/ModuleStub_Unimplemented.cpp
|
||||
RHI/WSISurface_Linux.cpp
|
||||
Vulkan_Traits_Linux.h
|
||||
Vulkan_Traits_Platform.h
|
||||
)
|
||||
|
||||
@@ -10,5 +10,4 @@
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/Unimplemented/Empty_Unimplemented.cpp
|
||||
)
|
||||
|
||||
@@ -163,21 +163,23 @@ namespace AZ
|
||||
uint32_t minorVersion = VK_VERSION_MINOR(physicalProperties.apiVersion);
|
||||
|
||||
// unbounded array functionality
|
||||
VkPhysicalDeviceDescriptorIndexingFeatures descriptorIndexingFeatures = {};
|
||||
VkPhysicalDeviceDescriptorIndexingFeaturesEXT descriptorIndexingFeatures = {};
|
||||
descriptorIndexingFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES;
|
||||
descriptorIndexingFeatures.shaderInputAttachmentArrayDynamicIndexing = VK_TRUE;
|
||||
descriptorIndexingFeatures.shaderUniformTexelBufferArrayDynamicIndexing = VK_TRUE;
|
||||
descriptorIndexingFeatures.shaderStorageTexelBufferArrayDynamicIndexing = VK_TRUE;
|
||||
descriptorIndexingFeatures.shaderUniformBufferArrayNonUniformIndexing = VK_TRUE;
|
||||
descriptorIndexingFeatures.shaderSampledImageArrayNonUniformIndexing = VK_TRUE;
|
||||
descriptorIndexingFeatures.shaderStorageBufferArrayNonUniformIndexing = VK_TRUE;
|
||||
descriptorIndexingFeatures.shaderStorageImageArrayNonUniformIndexing = VK_TRUE;
|
||||
descriptorIndexingFeatures.shaderInputAttachmentArrayNonUniformIndexing = VK_TRUE;
|
||||
descriptorIndexingFeatures.shaderUniformTexelBufferArrayNonUniformIndexing = VK_TRUE;
|
||||
descriptorIndexingFeatures.shaderStorageTexelBufferArrayNonUniformIndexing = VK_TRUE;
|
||||
descriptorIndexingFeatures.descriptorBindingPartiallyBound = VK_TRUE;
|
||||
descriptorIndexingFeatures.descriptorBindingVariableDescriptorCount = VK_TRUE;
|
||||
descriptorIndexingFeatures.runtimeDescriptorArray = VK_TRUE;
|
||||
const VkPhysicalDeviceDescriptorIndexingFeaturesEXT& physicalDeviceDescriptorIndexingFeatures =
|
||||
physicalDevice.GetPhysicalDeviceDescriptorIndexingFeatures();
|
||||
descriptorIndexingFeatures.shaderInputAttachmentArrayDynamicIndexing = physicalDeviceDescriptorIndexingFeatures.shaderInputAttachmentArrayDynamicIndexing;
|
||||
descriptorIndexingFeatures.shaderUniformTexelBufferArrayDynamicIndexing = physicalDeviceDescriptorIndexingFeatures.shaderUniformTexelBufferArrayDynamicIndexing;
|
||||
descriptorIndexingFeatures.shaderStorageTexelBufferArrayDynamicIndexing = physicalDeviceDescriptorIndexingFeatures.shaderStorageTexelBufferArrayDynamicIndexing;
|
||||
descriptorIndexingFeatures.shaderUniformBufferArrayNonUniformIndexing = physicalDeviceDescriptorIndexingFeatures.shaderUniformBufferArrayNonUniformIndexing;
|
||||
descriptorIndexingFeatures.shaderSampledImageArrayNonUniformIndexing = physicalDeviceDescriptorIndexingFeatures.shaderSampledImageArrayNonUniformIndexing;
|
||||
descriptorIndexingFeatures.shaderStorageBufferArrayNonUniformIndexing = physicalDeviceDescriptorIndexingFeatures.shaderStorageBufferArrayNonUniformIndexing;
|
||||
descriptorIndexingFeatures.shaderStorageImageArrayNonUniformIndexing = physicalDeviceDescriptorIndexingFeatures.shaderStorageImageArrayNonUniformIndexing;
|
||||
descriptorIndexingFeatures.shaderInputAttachmentArrayNonUniformIndexing = physicalDeviceDescriptorIndexingFeatures.shaderInputAttachmentArrayNonUniformIndexing;
|
||||
descriptorIndexingFeatures.shaderUniformTexelBufferArrayNonUniformIndexing = physicalDeviceDescriptorIndexingFeatures.shaderUniformTexelBufferArrayNonUniformIndexing;
|
||||
descriptorIndexingFeatures.shaderStorageTexelBufferArrayNonUniformIndexing = physicalDeviceDescriptorIndexingFeatures.shaderStorageTexelBufferArrayNonUniformIndexing;
|
||||
descriptorIndexingFeatures.descriptorBindingPartiallyBound = physicalDeviceDescriptorIndexingFeatures.shaderStorageTexelBufferArrayNonUniformIndexing;
|
||||
descriptorIndexingFeatures.descriptorBindingVariableDescriptorCount = physicalDeviceDescriptorIndexingFeatures.descriptorBindingVariableDescriptorCount;
|
||||
descriptorIndexingFeatures.runtimeDescriptorArray = physicalDeviceDescriptorIndexingFeatures.runtimeDescriptorArray;
|
||||
|
||||
VkPhysicalDeviceDepthClipEnableFeaturesEXT depthClipEnabled = {};
|
||||
depthClipEnabled.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT;
|
||||
@@ -196,7 +198,7 @@ namespace AZ
|
||||
// If we are running Vulkan >= 1.2, then we must use VkPhysicalDeviceVulkan12Features instead
|
||||
// of VkPhysicalDeviceShaderFloat16Int8FeaturesKHR or VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR.
|
||||
if (majorVersion >= 1 && minorVersion >= 2)
|
||||
{
|
||||
{
|
||||
vulkan12Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES;
|
||||
vulkan12Features.drawIndirectCount = physicalDevice.GetPhysicalDeviceVulkan12Features().drawIndirectCount;
|
||||
vulkan12Features.shaderFloat16 = physicalDevice.GetPhysicalDeviceVulkan12Features().shaderFloat16;
|
||||
@@ -205,7 +207,7 @@ namespace AZ
|
||||
robustness2.pNext = &vulkan12Features;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
float16Int8.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES_KHR;
|
||||
float16Int8.shaderFloat16 = physicalDevice.GetPhysicalDeviceFloat16Int8Features().shaderFloat16;
|
||||
|
||||
|
||||
@@ -133,6 +133,11 @@ namespace AZ
|
||||
return m_float16Int8Features;
|
||||
}
|
||||
|
||||
const VkPhysicalDeviceDescriptorIndexingFeaturesEXT& PhysicalDevice::GetPhysicalDeviceDescriptorIndexingFeatures() const
|
||||
{
|
||||
return m_descriptorIndexingFeatures;
|
||||
}
|
||||
|
||||
const VkPhysicalDeviceVulkan12Features& PhysicalDevice::GetPhysicalDeviceVulkan12Features() const
|
||||
{
|
||||
return m_vulkan12Features;
|
||||
@@ -233,6 +238,7 @@ namespace AZ
|
||||
m_features.set(static_cast<size_t>(DeviceFeature::SeparateDepthStencil),
|
||||
(m_separateDepthStencilFeatures.separateDepthStencilLayouts && VK_DEVICE_EXTENSION_SUPPORTED(KHR_separate_depth_stencil_layouts)) ||
|
||||
(m_vulkan12Features.separateDepthStencilLayouts));
|
||||
m_features.set(static_cast<size_t>(DeviceFeature::DescriptorIndexing), VK_DEVICE_EXTENSION_SUPPORTED(EXT_descriptor_indexing));
|
||||
}
|
||||
|
||||
void PhysicalDevice::CompileMemoryStatistics(RHI::MemoryStatisticsBuilder& builder) const
|
||||
@@ -266,9 +272,14 @@ namespace AZ
|
||||
if (VK_INSTANCE_EXTENSION_SUPPORTED(KHR_get_physical_device_properties2))
|
||||
{
|
||||
// features
|
||||
VkPhysicalDeviceDescriptorIndexingFeaturesEXT& descriptorIndexingFeatures = m_descriptorIndexingFeatures;
|
||||
descriptorIndexingFeatures = {};
|
||||
descriptorIndexingFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT;
|
||||
|
||||
VkPhysicalDeviceDepthClipEnableFeaturesEXT& dephClipEnableFeatures = m_dephClipEnableFeatures;
|
||||
dephClipEnableFeatures = {};
|
||||
dephClipEnableFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT;
|
||||
descriptorIndexingFeatures.pNext = &dephClipEnableFeatures;
|
||||
|
||||
VkPhysicalDeviceRobustness2FeaturesEXT& robustness2Feature = m_robutness2Features;
|
||||
robustness2Feature = {};
|
||||
@@ -292,7 +303,7 @@ namespace AZ
|
||||
|
||||
VkPhysicalDeviceFeatures2 deviceFeatures2 = {};
|
||||
deviceFeatures2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
|
||||
deviceFeatures2.pNext = &dephClipEnableFeatures;
|
||||
deviceFeatures2.pNext = &descriptorIndexingFeatures;
|
||||
|
||||
vkGetPhysicalDeviceFeatures2KHR(vkPhysicalDevice, &deviceFeatures2);
|
||||
m_deviceFeatures = deviceFeatures2.features;
|
||||
@@ -302,7 +313,7 @@ namespace AZ
|
||||
m_conservativeRasterProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT;
|
||||
deviceProps2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
|
||||
deviceProps2.pNext = &m_conservativeRasterProperties;
|
||||
|
||||
|
||||
m_rayTracingPipelineProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR;
|
||||
m_conservativeRasterProperties.pNext = &m_rayTracingPipelineProperties;
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace AZ
|
||||
DrawIndirectCount,
|
||||
NullDescriptor,
|
||||
SeparateDepthStencil,
|
||||
DescriptorIndexing,
|
||||
Count // Must be last
|
||||
};
|
||||
|
||||
@@ -57,6 +58,7 @@ namespace AZ
|
||||
const VkPhysicalDeviceDepthClipEnableFeaturesEXT& GetPhysicalDeviceDepthClipEnableFeatures() const;
|
||||
const VkPhysicalDeviceRobustness2FeaturesEXT& GetPhysicalDeviceRobutness2Features() const;
|
||||
const VkPhysicalDeviceShaderFloat16Int8FeaturesKHR& GetPhysicalDeviceFloat16Int8Features() const;
|
||||
const VkPhysicalDeviceDescriptorIndexingFeaturesEXT& GetPhysicalDeviceDescriptorIndexingFeatures() const;
|
||||
const VkPhysicalDeviceVulkan12Features& GetPhysicalDeviceVulkan12Features() const;
|
||||
const VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR& GetPhysicalDeviceSeparateDepthStencilFeatures() const;
|
||||
const VkPhysicalDeviceAccelerationStructurePropertiesKHR& GetPhysicalDeviceAccelerationStructureProperties() const;
|
||||
@@ -70,7 +72,6 @@ namespace AZ
|
||||
|
||||
private:
|
||||
PhysicalDevice() = default;
|
||||
|
||||
void Init(VkPhysicalDevice vkPhysicalDevice);
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
@@ -88,6 +89,7 @@ namespace AZ
|
||||
VkPhysicalDeviceDepthClipEnableFeaturesEXT m_dephClipEnableFeatures{};
|
||||
VkPhysicalDeviceRobustness2FeaturesEXT m_robutness2Features{};
|
||||
VkPhysicalDeviceShaderFloat16Int8FeaturesKHR m_float16Int8Features{};
|
||||
VkPhysicalDeviceDescriptorIndexingFeaturesEXT m_descriptorIndexingFeatures{};
|
||||
VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR m_separateDepthStencilFeatures{};
|
||||
VkPhysicalDeviceAccelerationStructurePropertiesKHR m_accelerationStructureProperties{};
|
||||
VkPhysicalDeviceRayTracingPipelinePropertiesKHR m_rayTracingPipelineProperties{};
|
||||
|
||||
@@ -15,5 +15,4 @@ add_subdirectory(AtomImGuiTools)
|
||||
add_subdirectory(EMotionFXAtom)
|
||||
add_subdirectory(AtomFont)
|
||||
add_subdirectory(TechnicalArt)
|
||||
add_subdirectory(CryRenderAtomShim)
|
||||
add_subdirectory(AtomBridge)
|
||||
|
||||
@@ -1,29 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "../Common/RendElements/CRELensOptics.h"
|
||||
|
||||
|
||||
CRELensOptics::CRELensOptics(void)
|
||||
{
|
||||
mfSetType(eDATA_LensOptics);
|
||||
mfUpdateFlags(FCEF_TRANSFORM);
|
||||
}
|
||||
CRELensOptics::~CRELensOptics(void) {}
|
||||
|
||||
bool CRELensOptics::mfCompile([[maybe_unused]] CParserBin& Parser, [[maybe_unused]] SParserFrame& Frame){ return true; }
|
||||
|
||||
void CRELensOptics::mfPrepare([[maybe_unused]] bool bCheckOverflow) {}
|
||||
|
||||
bool CRELensOptics::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm) { return true; }
|
||||
@@ -1,192 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
buffer_handle_t CDeviceBufferManager::Create_Locked(BUFFER_BIND_TYPE, BUFFER_USAGE, size_t)
|
||||
{
|
||||
return buffer_handle_t();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::Destroy_Locked(buffer_handle_t)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void* CDeviceBufferManager::BeginRead_Locked([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void* CDeviceBufferManager::BeginWrite_Locked([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::EndReadWrite_Locked([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CDeviceBufferManager::UpdateBuffer_Locked([[maybe_unused]] buffer_handle_t handle, const void*, size_t)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
size_t CDeviceBufferManager::Size_Locked(buffer_handle_t)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CDeviceBufferManager::CDeviceBufferManager()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CDeviceBufferManager::~CDeviceBufferManager()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::LockDevMan()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::UnlockDevMan()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CDeviceBufferManager::Init()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CDeviceBufferManager::Shutdown()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::Sync([[maybe_unused]] uint32 framdid)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::Update(uint32, [[maybe_unused]] bool called_during_loading)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
buffer_handle_t CDeviceBufferManager::Create(
|
||||
[[maybe_unused]] BUFFER_BIND_TYPE type
|
||||
, [[maybe_unused]] BUFFER_USAGE usage
|
||||
, [[maybe_unused]] size_t size)
|
||||
{
|
||||
return ~0u;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::Destroy([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void* CDeviceBufferManager::BeginRead([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void* CDeviceBufferManager::BeginWrite([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::EndReadWrite([[maybe_unused]] buffer_handle_t handle)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CDeviceBufferManager::UpdateBuffer([[maybe_unused]] buffer_handle_t handle, [[maybe_unused]] const void* src, [[maybe_unused]] size_t size)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// Legacy interface
|
||||
//
|
||||
// Use with care, can be removed at any point!
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::ReleaseVBuffer(CVertexBuffer* pVB)
|
||||
{
|
||||
SAFE_DELETE(pVB);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void CDeviceBufferManager::ReleaseIBuffer(CIndexBuffer* pIB)
|
||||
{
|
||||
SAFE_DELETE(pIB);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CVertexBuffer* CDeviceBufferManager::CreateVBuffer([[maybe_unused]] size_t nVerts, const AZ::Vertex::Format& vertexFormat, [[maybe_unused]] const char* szName, [[maybe_unused]] BUFFER_USAGE usage)
|
||||
{
|
||||
CVertexBuffer* pVB = new CVertexBuffer(NULL, vertexFormat);
|
||||
return pVB;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CIndexBuffer* CDeviceBufferManager::CreateIBuffer([[maybe_unused]] size_t nInds, [[maybe_unused]] const char* szNam, [[maybe_unused]] BUFFER_USAGE usage)
|
||||
{
|
||||
CIndexBuffer* pIB = new CIndexBuffer(NULL);
|
||||
return pIB;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CDeviceBufferManager::UpdateVBuffer([[maybe_unused]] CVertexBuffer* pVB, [[maybe_unused]] void* pVerts, [[maybe_unused]] size_t nVerts)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CDeviceBufferManager::UpdateIBuffer([[maybe_unused]] CIndexBuffer* pIB, [[maybe_unused]] void* pInds, [[maybe_unused]] size_t nInds)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CVertexBuffer::~CVertexBuffer()
|
||||
{
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
CIndexBuffer::~CIndexBuffer()
|
||||
{
|
||||
}
|
||||
|
||||
namespace AzRHI
|
||||
{
|
||||
ConstantBuffer::~ConstantBuffer()
|
||||
{}
|
||||
|
||||
void ConstantBuffer::AddRef()
|
||||
{}
|
||||
|
||||
AZ::u32 ConstantBuffer::Release()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1,258 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
/*
|
||||
Todo:
|
||||
* Erradicate StretchRect usage
|
||||
* Cleanup code
|
||||
* When we have a proper static branching support use it instead of shader switches inside code
|
||||
*/
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "I3DEngine.h"
|
||||
#include "../Common/PostProcess/PostEffects.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AZStd::unique_ptr<CMotionBlur::ObjectMap> CMotionBlur::m_Objects[3];
|
||||
CThreadSafeRendererContainer<CMotionBlur::ObjectMap::value_type> CMotionBlur::m_FillData[RT_COMMAND_BUF_COUNT];
|
||||
|
||||
bool CPostAA::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPostAA::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CMotionBlur::InsertNewElements()
|
||||
{
|
||||
}
|
||||
|
||||
void CMotionBlur::FreeData()
|
||||
{
|
||||
}
|
||||
|
||||
bool CMotionBlur::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CMotionBlur::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CMotionBlur::GetPrevObjToWorldMat([[maybe_unused]] CRenderObject* pObj, Matrix44A& res)
|
||||
{
|
||||
res = Matrix44(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
||||
}
|
||||
|
||||
void CMotionBlur::OnBeginFrame()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool CSunShafts::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CSunShafts::Render()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void CFilterSharpening::Render()
|
||||
{
|
||||
}
|
||||
void CFilterBlurring::Render()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void CUnderwaterGodRays::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CVolumetricScattering::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CWaterDroplets::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CWaterFlow::Render()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void CWaterRipples::AddHit([[maybe_unused]] const Vec3& vPos, [[maybe_unused]] const float scale, [[maybe_unused]] const float strength)
|
||||
{
|
||||
}
|
||||
|
||||
void CWaterRipples::DEBUG_DrawWaterHits()
|
||||
{
|
||||
}
|
||||
|
||||
bool CWaterRipples::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CWaterRipples::Reset([[maybe_unused]] bool bOnSpecChange)
|
||||
{
|
||||
}
|
||||
|
||||
void CWaterRipples::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CScreenFrost::Render()
|
||||
{
|
||||
}
|
||||
|
||||
bool CRainDrops::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void CRainDrops::Render()
|
||||
{
|
||||
}
|
||||
|
||||
bool CFlashBang::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CFlashBang::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CAlienInterference::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CGhostVision::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CHudSilhouettes::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CColorGrading::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CWaterVolume::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CSceneRain::CreateBuffers([[maybe_unused]] uint16 nVerts, [[maybe_unused]] void*& pINpVB, [[maybe_unused]] SVF_P3F_C4B_T2F* pVtxList)
|
||||
{
|
||||
}
|
||||
|
||||
int CSceneRain::CreateResources()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void CSceneRain::Release()
|
||||
{
|
||||
}
|
||||
|
||||
void CSceneRain::Render()
|
||||
{
|
||||
}
|
||||
|
||||
bool CSceneSnow::Preprocess()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void CSceneSnow::Render()
|
||||
{
|
||||
}
|
||||
|
||||
int CSceneSnow::CreateResources()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void CSceneSnow::Release()
|
||||
{
|
||||
}
|
||||
|
||||
void CImageGhosting::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CFilterKillCamera::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CUberGamePostProcess::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CSoftAlphaTest::Render()
|
||||
{
|
||||
}
|
||||
|
||||
void CScreenBlood::Render() { }
|
||||
|
||||
void CPost3DRenderer::Render()
|
||||
{
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
namespace WaterVolumeStaticData
|
||||
{
|
||||
void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer){}
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool CSceneRain::Preprocess() { return true; }
|
||||
//void CSceneRain::Render() {}
|
||||
void CSceneRain::Reset([[maybe_unused]] bool bOnSpecChange) {}
|
||||
void CSceneRain::OnLostDevice() {}
|
||||
|
||||
const char* CSceneRain::GetName() const {return 0; }
|
||||
const char* CRainDrops::GetName() const {return 0; }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CSceneSnow::Reset([[maybe_unused]] bool bOnSpecChange) {}
|
||||
|
||||
|
||||
const char* CSceneSnow::GetName() const {return 0; }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool CREPostProcess::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ScreenFader::Render()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1,164 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "I3DEngine.h"
|
||||
|
||||
//=======================================================================
|
||||
|
||||
bool CRESky::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREHDRSky::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREFogVolume::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREWaterVolume::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CREWaterOcean::FrameUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
void CREWaterOcean::Create([[maybe_unused]] uint32 nVerticesCount, [[maybe_unused]] SVF_P3F_C4B_T2F* pVertices, [[maybe_unused]] uint32 nIndicesCount, [[maybe_unused]] const void* pIndices, [[maybe_unused]] uint32 nIndexSizeof)
|
||||
{
|
||||
}
|
||||
|
||||
void CREWaterOcean::ReleaseOcean()
|
||||
{
|
||||
}
|
||||
|
||||
bool CREWaterOcean::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CREOcclusionQuery::~CREOcclusionQuery()
|
||||
{
|
||||
mfReset();
|
||||
}
|
||||
|
||||
void CREOcclusionQuery::mfReset()
|
||||
{
|
||||
m_nOcclusionID = 0;
|
||||
}
|
||||
|
||||
uint32 CREOcclusionQuery::m_nQueriesPerFrameCounter = 0;
|
||||
uint32 CREOcclusionQuery::m_nReadResultNowCounter = 0;
|
||||
uint32 CREOcclusionQuery::m_nReadResultTryCounter = 0;
|
||||
|
||||
bool CREOcclusionQuery::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool CREOcclusionQuery::mfReadResult_Now(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool CREOcclusionQuery::mfReadResult_Try([[maybe_unused]] uint32 nDefaultNumSamples)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool CREOcclusionQuery::RT_ReadResult_Try([[maybe_unused]] uint32 nDefaultNumSamples)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREMeshImpl::mfPreDraw([[maybe_unused]] SShaderPass* sl)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREMeshImpl::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sl)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREHDRProcess::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREDeferredShading::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREBeam::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sl)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREImposter::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* pPass)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CRECloud::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* pPass)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CRECloud::UpdateImposter([[maybe_unused]] CRenderObject* pObj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CRECloud::GenerateCloudImposter([[maybe_unused]] CShader* pShader, [[maybe_unused]] CShaderResources* pRes, [[maybe_unused]] CRenderObject* pObject)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREImposter::UpdateImposter()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CREVolumeObject::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#if !defined(EXCLUDE_DOCUMENTATION_PURPOSE)
|
||||
bool CREPrismObject::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif // EXCLUDE_DOCUMENTATION_PURPOSE
|
||||
|
||||
bool CREGameEffect::mfDraw([[maybe_unused]] CShader* ef, [[maybe_unused]] SShaderPass* sfm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CRELensOptics::ClearResources()
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(USE_GEOM_CACHES)
|
||||
bool CREGeomCache::mfDraw([[maybe_unused]] CShader* pShader, [[maybe_unused]] SShaderPass* pShaderPass)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@@ -1,192 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : NULL device specific implementation using shaders pipeline.
|
||||
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "Common/RenderView.h"
|
||||
#include "RenderBus.h"
|
||||
|
||||
//============================================================================================
|
||||
// Init Shaders rendering
|
||||
|
||||
void CAtomShimRenderer::EF_Init()
|
||||
{
|
||||
m_RP.m_MaxVerts = 600;
|
||||
m_RP.m_MaxTris = 300;
|
||||
|
||||
//==================================================
|
||||
// Init RenderObjects
|
||||
{
|
||||
m_RP.m_nNumObjectsInPool = 384; // magic number set by Cry. The regular pipe uses a constant set to 1024
|
||||
|
||||
if (m_RP.m_ObjectsPool != nullptr)
|
||||
{
|
||||
for (int j = 0; j < (int)(m_RP.m_nNumObjectsInPool * RT_COMMAND_BUF_COUNT); j++)
|
||||
{
|
||||
CRenderObject* pRendObj = &m_RP.m_ObjectsPool[j];
|
||||
pRendObj->~CRenderObject();
|
||||
}
|
||||
CryModuleMemalignFree(m_RP.m_ObjectsPool);
|
||||
}
|
||||
|
||||
// we use a plain allocation and placement new here to garantee the alignment, when using array new, the compiler can store it's size and break the alignment
|
||||
m_RP.m_ObjectsPool = (CRenderObject*)CryModuleMemalign(sizeof(CRenderObject) * (m_RP.m_nNumObjectsInPool * RT_COMMAND_BUF_COUNT), 16);
|
||||
for (int j = 0; j < (int)(m_RP.m_nNumObjectsInPool * RT_COMMAND_BUF_COUNT); j++)
|
||||
{
|
||||
new(&m_RP.m_ObjectsPool[j])CRenderObject();
|
||||
}
|
||||
|
||||
|
||||
CRenderObject** arrPrefill = (CRenderObject**)(alloca(m_RP.m_nNumObjectsInPool * sizeof(CRenderObject*)));
|
||||
for (int j = 0; j < RT_COMMAND_BUF_COUNT; j++)
|
||||
{
|
||||
for (int k = 0; k < m_RP.m_nNumObjectsInPool; ++k)
|
||||
{
|
||||
arrPrefill[k] = &m_RP.m_ObjectsPool[j * m_RP.m_nNumObjectsInPool + k];
|
||||
}
|
||||
|
||||
m_RP.m_TempObjects[j].PrefillContainer(arrPrefill, m_RP.m_nNumObjectsInPool);
|
||||
m_RP.m_TempObjects[j].resize(0);
|
||||
}
|
||||
}
|
||||
// Init identity RenderObject
|
||||
SAFE_DELETE(m_RP.m_pIdendityRenderObject);
|
||||
m_RP.m_pIdendityRenderObject = aznew CRenderObject();
|
||||
m_RP.m_pIdendityRenderObject->Init();
|
||||
m_RP.m_pIdendityRenderObject->m_II.m_AmbColor = Col_White;
|
||||
m_RP.m_pIdendityRenderObject->m_II.m_Matrix.SetIdentity();
|
||||
m_RP.m_pIdendityRenderObject->m_RState = 0;
|
||||
m_RP.m_pIdendityRenderObject->m_ObjFlags |= FOB_RENDERER_IDENDITY_OBJECT;
|
||||
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::FX_SetClipPlane ([[maybe_unused]] bool bEnable, [[maybe_unused]] float* pPlane, [[maybe_unused]] bool bRefract)
|
||||
{
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::FX_PipelineShutdown([[maybe_unused]] bool bFastShutdown)
|
||||
{
|
||||
uint32 i, j;
|
||||
|
||||
for (int n = 0; n < 2; n++)
|
||||
{
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
for (i = 0; i < CREClientPoly::m_PolysStorage[n][j].Num(); i++)
|
||||
{
|
||||
CREClientPoly::m_PolysStorage[n][j][i]->Release(false);
|
||||
}
|
||||
CREClientPoly::m_PolysStorage[n][j].Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::EF_Release([[maybe_unused]] int nFlags)
|
||||
{
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
||||
void CAtomShimRenderer::FX_SetState(int st, int AlphaRef, [[maybe_unused]] int RestoreState)
|
||||
{
|
||||
m_RP.m_CurState = st;
|
||||
m_RP.m_CurAlphaRef = AlphaRef;
|
||||
}
|
||||
void CRenderer::FX_SetStencilState([[maybe_unused]] int st, [[maybe_unused]] uint32 nStencRef, [[maybe_unused]] uint32 nStencMask, [[maybe_unused]] uint32 nStencWriteMask, [[maybe_unused]] bool bForceFullReadMask)
|
||||
{
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
|
||||
// Initialize of the new shader pipeline (only 2d)
|
||||
void CRenderer::FX_Start([[maybe_unused]] CShader* ef, [[maybe_unused]] int nTech, [[maybe_unused]] CShaderResources* Res, [[maybe_unused]] IRenderElement* re)
|
||||
{
|
||||
m_RP.m_Frame++;
|
||||
}
|
||||
|
||||
void CRenderer::FX_CheckOverflow([[maybe_unused]] int nVerts, [[maybe_unused]] int nInds, [[maybe_unused]] IRenderElement* re, [[maybe_unused]] int* nNewVerts, [[maybe_unused]] int* nNewInds)
|
||||
{
|
||||
}
|
||||
|
||||
uint32 CRenderer::EF_GetDeferredLightsNum([[maybe_unused]] const eDeferredLightType eLightType)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CRenderer::EF_AddDeferredLight([[maybe_unused]] const CDLight& pLight, float, [[maybe_unused]] const SRenderingPassInfo& passInfo, [[maybe_unused]] const SRendItemSorter& rendItemSorter)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CRenderer::EF_ClearDeferredLightsList()
|
||||
{
|
||||
}
|
||||
|
||||
void CRenderer::EF_ReleaseDeferredData()
|
||||
{
|
||||
}
|
||||
|
||||
uint8 CRenderer::EF_AddDeferredClipVolume([[maybe_unused]] const IClipVolume* pClipVolume)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool CRenderer::EF_SetDeferredClipVolumeBlendData([[maybe_unused]] const IClipVolume* pClipVolume, [[maybe_unused]] const SClipVolumeBlendInfo& blendInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CRenderer::EF_ClearDeferredClipVolumesList()
|
||||
{
|
||||
}
|
||||
|
||||
//========================================================================================
|
||||
|
||||
void CAtomShimRenderer::EF_EndEf3D([[maybe_unused]] const int nFlags, [[maybe_unused]] const int nPrecacheUpdateId, [[maybe_unused]] const int nNearPrecacheUpdateId, [[maybe_unused]] const SRenderingPassInfo& passInfo)
|
||||
{
|
||||
//m_RP.m_TI[m_RP.m_nFillThreadID].m_RealTime = iTimer->GetCurrTime();
|
||||
EF_RemovePolysFromScene();
|
||||
|
||||
// Only render the UI Canvas and the Console on the main window
|
||||
// If we're not in the editor, don't bother to check viewport.
|
||||
if (!gEnv->IsEditor() || m_currContext == nullptr || m_currContext->m_isMainViewport)
|
||||
{
|
||||
EBUS_EVENT(AZ::RenderNotificationsBus, OnScene3DEnd);
|
||||
}
|
||||
|
||||
int nThreadID = m_pRT->GetThreadList();
|
||||
SRendItem::m_RecurseLevel[nThreadID]--;
|
||||
}
|
||||
|
||||
//double timeFtoI, timeFtoL, timeQRound;
|
||||
//int sSome;
|
||||
void CAtomShimRenderer::EF_EndEf2D([[maybe_unused]] const bool bSort)
|
||||
{
|
||||
}
|
||||
|
||||
void CRenderView::PrepareForRendering() {}
|
||||
|
||||
void CRenderView::PrepareForWriting() {}
|
||||
|
||||
void CRenderView::ClearRenderItems() {}
|
||||
|
||||
void CRenderView::FreeRenderItems() {}
|
||||
|
||||
CRenderView::CRenderView() {}
|
||||
|
||||
CRenderView::~CRenderView() {}
|
||||
|
||||
@@ -1,688 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "AtomShim_RenderAuxGeom.h"
|
||||
|
||||
#include <Atom/RPI.Public/AuxGeom/AuxGeomFeatureProcessorInterface.h>
|
||||
#include <Atom/RPI.Public/RPISystemInterface.h>
|
||||
#include <MathConversion.h>
|
||||
|
||||
CAtomShimRenderAuxGeom* CAtomShimRenderAuxGeom::s_pThis = NULL;
|
||||
|
||||
namespace
|
||||
{
|
||||
using DrawFunction = AZStd::function<void(const uint32* indices)>;
|
||||
void Handle16BitIndices(const vtx_idx* ind, uint32_t numIndices, DrawFunction drawFunc)
|
||||
{
|
||||
constexpr bool copyIndicesToUint32 = sizeof(vtx_idx) != sizeof(uint32_t); // mobile platforms use 16 bit vtx_idx
|
||||
if constexpr(copyIndicesToUint32)
|
||||
{
|
||||
uint32_t* indices = new uint32_t[numIndices];
|
||||
for (int i = 0; i < numIndices; ++i)
|
||||
{
|
||||
indices[i] = ind[i];
|
||||
}
|
||||
drawFunc(indices);
|
||||
delete[] indices;
|
||||
}
|
||||
else
|
||||
{
|
||||
// re-interpret because on mobile vtx_idx is a uint16
|
||||
// Additionally the else case should not be taken on mobile
|
||||
// because sizeof(uint16) < sizeof(uint32).
|
||||
const uint32_t* indices = reinterpret_cast<const uint32_t*>(ind);
|
||||
drawFunc(indices);
|
||||
}
|
||||
}
|
||||
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle LyDrawStyleToAZDrawStyle(bool bSolid, EBoundingBoxDrawStyle bbDrawStyle)
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle drawStyle = AZ::RPI::AuxGeomDraw::DrawStyle::Solid;
|
||||
if (!bSolid)
|
||||
{
|
||||
drawStyle = AZ::RPI::AuxGeomDraw::DrawStyle::Line;
|
||||
}
|
||||
else if (bbDrawStyle == eBBD_Extremes_Color_Encoded)
|
||||
{
|
||||
drawStyle = AZ::RPI::AuxGeomDraw::DrawStyle::Shaded; // Not the same but shows a difference
|
||||
}
|
||||
return drawStyle;
|
||||
}
|
||||
|
||||
AZ::Aabb LyAABBToAZAabbWithFixup(const AABB& source)
|
||||
{
|
||||
AABB fixed;
|
||||
fixed.min.x = AZStd::min(source.min.x, source.max.x);
|
||||
fixed.min.y = AZStd::min(source.min.y, source.max.y);
|
||||
fixed.min.z = AZStd::min(source.min.z, source.max.z);
|
||||
fixed.max.x = AZStd::max(source.min.x, source.max.x);
|
||||
fixed.max.y = AZStd::max(source.min.y, source.max.y);
|
||||
fixed.max.z = AZStd::max(source.min.z, source.max.z);
|
||||
return LyAABBToAZAabb(fixed);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CAtomShimRenderAuxGeom::CAtomShimRenderAuxGeom(CAtomShimRenderer& renderer)
|
||||
: m_renderer(&renderer)
|
||||
{
|
||||
}
|
||||
|
||||
CAtomShimRenderAuxGeom::~CAtomShimRenderAuxGeom()
|
||||
{
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::BeginFrame()
|
||||
{
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::EndFrame()
|
||||
{
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::SetViewProjOverride(const AZ::Matrix4x4& viewProj)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
m_viewProjOverrideIndex = auxGeom->AddViewProjOverride(viewProj);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::UnsetViewProjOverride()
|
||||
{
|
||||
m_viewProjOverrideIndex = -1;
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::SetRenderFlags(const SAuxGeomRenderFlags& renderFlags)
|
||||
{
|
||||
m_cryRenderFlags = renderFlags;
|
||||
m_drawArgs.m_depthTest = renderFlags.GetDepthTestFlag() == EAuxGeomPublicRenderflags_DepthTest::e_DepthTestOff ?
|
||||
AZ::RPI::AuxGeomDraw::DepthTest::Off : AZ::RPI::AuxGeomDraw::DepthTest::On;
|
||||
}
|
||||
|
||||
SAuxGeomRenderFlags CAtomShimRenderAuxGeom::GetRenderFlags()
|
||||
{
|
||||
return m_cryRenderFlags;
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawPoint(const Vec3& v, const ColorB& col, uint8 size /* = 1 */)
|
||||
{
|
||||
DrawPoints(&v, 1, col, size);
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawPoints(const Vec3* v, uint32 numPoints, const ColorB* col, uint8 size /* = 1 */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
AZ::Color* colors = new AZ::Color[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
colors[i] = LYColorBToAZColor(col[i]);
|
||||
}
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = numPoints;
|
||||
drawArgs.m_size = size;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawPoints(drawArgs);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawPoints(const Vec3* v, uint32 numPoints, const ColorB& col, uint8 size /* = 1 */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
}
|
||||
AZ::Color color = LYColorBToAZColor(col);
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = &color;
|
||||
drawArgs.m_colorCount = 1;
|
||||
drawArgs.m_size = size;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawPoints(drawArgs);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawLine(const Vec3& v0, const ColorB& colV0, const Vec3& v1, const ColorB& colV1, float thickness /* = 1.0f */)
|
||||
{
|
||||
const Vec3 verts[2] = {v0, v1};
|
||||
const ColorB colors[2] = {colV0, colV1};
|
||||
DrawLines(verts, 2, colors, thickness);
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawLines(const Vec3* v, uint32 numPoints, const ColorB& col, float thickness /* = 1.0f */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
}
|
||||
|
||||
AZ::Color color = LYColorBToAZColor(col);
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = &color;
|
||||
drawArgs.m_colorCount = 1;
|
||||
drawArgs.m_size = thickness;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
auxGeom->DrawLines(drawArgs);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawLines(const Vec3* v, uint32 numPoints, const ColorB* col, float thickness /* = 1.0f */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
AZ::Color* colors = new AZ::Color[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
colors[i] = LYColorBToAZColor(col[i]);
|
||||
}
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = numPoints;
|
||||
drawArgs.m_size = thickness;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawLines(drawArgs);
|
||||
|
||||
delete[] points;
|
||||
delete[] colors;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawLines(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB& col, float thickness /* = 1.0f */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
}
|
||||
|
||||
AZ::Color color = LYColorBToAZColor(col);
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicIndexedDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_indexCount = numIndices;
|
||||
drawArgs.m_colors = &color;
|
||||
drawArgs.m_colorCount = 1;
|
||||
drawArgs.m_size = thickness;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
Handle16BitIndices(
|
||||
ind, numIndices,
|
||||
[&drawArgs, auxGeom](const uint32_t* indices)
|
||||
{
|
||||
drawArgs.m_indices = indices;
|
||||
auxGeom->DrawLines(drawArgs);
|
||||
}
|
||||
);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawLines(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB* col, float thickness /* = 1.0f */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
AZ::Color* colors = new AZ::Color[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
colors[i] = LYColorBToAZColor(col[i]);
|
||||
}
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicIndexedDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_indexCount = numIndices;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = numPoints;
|
||||
drawArgs.m_size = thickness;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
Handle16BitIndices(
|
||||
ind, numIndices,
|
||||
[&drawArgs, auxGeom](const uint32_t* indices)
|
||||
{
|
||||
drawArgs.m_indices = indices;
|
||||
auxGeom->DrawLines(drawArgs);
|
||||
}
|
||||
);
|
||||
|
||||
delete[] points;
|
||||
delete[] colors;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawPolyline(const Vec3* v, uint32 numPoints, bool closed, const ColorB& col, float thickness /* = 1.0f */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
}
|
||||
|
||||
AZ::Color color = LYColorBToAZColor(col);
|
||||
AZ::RPI::AuxGeomDraw::PolylineEnd polylineClosed = closed ? AZ::RPI::AuxGeomDraw::PolylineEnd::Closed : AZ::RPI::AuxGeomDraw::PolylineEnd::Open;
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = &color;
|
||||
drawArgs.m_colorCount = 1;
|
||||
drawArgs.m_size = thickness;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawPolylines(drawArgs, polylineClosed);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawPolyline(const Vec3* v, uint32 numPoints, bool closed, const ColorB* col, float thickness /* = 1.0f */)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
AZ::Color* colors = new AZ::Color[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
colors[i] = LYColorBToAZColor(col[i]);
|
||||
}
|
||||
|
||||
AZ::RPI::AuxGeomDraw::PolylineEnd polylineClosed = closed ? AZ::RPI::AuxGeomDraw::PolylineEnd::Closed : AZ::RPI::AuxGeomDraw::PolylineEnd::Open;
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = numPoints;
|
||||
drawArgs.m_size = thickness;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
auxGeom->DrawPolylines(drawArgs, polylineClosed);
|
||||
|
||||
delete[] points;
|
||||
delete[] colors;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawTriangle(const Vec3& v0, const ColorB& colV0, const Vec3& v1, const ColorB& colV1, const Vec3& v2, const ColorB& colV2)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3 points[3] =
|
||||
{
|
||||
LYVec3ToAZVec3(v0),
|
||||
LYVec3ToAZVec3(v1),
|
||||
LYVec3ToAZVec3(v2),
|
||||
};
|
||||
|
||||
AZ::Color colors[3] =
|
||||
{
|
||||
LYColorBToAZColor(colV0),
|
||||
LYColorBToAZColor(colV1),
|
||||
LYColorBToAZColor(colV2),
|
||||
};
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = 3;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = 3;
|
||||
drawArgs.m_opacityType = (colV0.a == 0xFF && colV1.a == 0xFF && colV2.a == 0xFF) ? AZ::RPI::AuxGeomDraw::OpacityType::Opaque : AZ::RPI::AuxGeomDraw::OpacityType::Translucent;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawTriangles(drawArgs);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawTriangles(const Vec3* v, uint32 numPoints, const ColorB& col)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
}
|
||||
AZ::Color color = LYColorBToAZColor(col);
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_colors = &color;
|
||||
drawArgs.m_colorCount = 1;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawTriangles(drawArgs);
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawTriangles(const Vec3* v, uint32 numPoints, const ColorB* col)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
AZ::Color* colors = new AZ::Color[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
colors[i] = LYColorBToAZColor(col[i]);
|
||||
}
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArgs;
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = 3;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = numPoints;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
auxGeom->DrawTriangles(drawArgs);
|
||||
delete[] points;
|
||||
delete[] colors;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawTriangles(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB& col)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
}
|
||||
AZ::Color color = LYColorBToAZColor(col);
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicIndexedDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_indexCount = numIndices;
|
||||
drawArgs.m_colors = &color;
|
||||
drawArgs.m_colorCount = 1;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
Handle16BitIndices(
|
||||
ind, numIndices,
|
||||
[&drawArgs, auxGeom](const uint32_t* indices)
|
||||
{
|
||||
drawArgs.m_indices = indices;
|
||||
auxGeom->DrawTriangles(drawArgs);
|
||||
}
|
||||
);
|
||||
|
||||
delete[] points;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawTriangles(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB* col)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Vector3* points = new AZ::Vector3[numPoints];
|
||||
AZ::Color* colors = new AZ::Color[numPoints];
|
||||
for (int i = 0; i < numPoints; ++i)
|
||||
{
|
||||
points[i] = LYVec3ToAZVec3(v[i]);
|
||||
colors[i] = LYColorBToAZColor(col[i]);
|
||||
}
|
||||
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicIndexedDrawArguments drawArgs(m_drawArgs);
|
||||
drawArgs.m_verts = points;
|
||||
drawArgs.m_vertCount = numPoints;
|
||||
drawArgs.m_indexCount = numIndices;
|
||||
drawArgs.m_colors = colors;
|
||||
drawArgs.m_colorCount = numPoints;
|
||||
drawArgs.m_viewProjectionOverrideIndex = m_viewProjOverrideIndex;
|
||||
|
||||
Handle16BitIndices(
|
||||
ind, numIndices,
|
||||
[&drawArgs, auxGeom](const uint32_t* indices)
|
||||
{
|
||||
drawArgs.m_indices = indices;
|
||||
auxGeom->DrawTriangles(drawArgs);
|
||||
}
|
||||
);
|
||||
|
||||
delete[] points;
|
||||
delete[] colors;
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawQuad(float width, float height, const Matrix34& matWorld, const ColorB& col, bool drawShaded)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle drawStyle = drawShaded ? AZ::RPI::AuxGeomDraw::DrawStyle::Shaded : AZ::RPI::AuxGeomDraw::DrawStyle::Solid;
|
||||
AZ::Matrix3x4 local2World = LYTransformToAZMatrix3x4(matWorld);
|
||||
auxGeom->DrawQuad(width, height, local2World, LYColorBToAZColor(col), drawStyle, m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawAABB(const AABB& aabb, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
auxGeom->DrawAabb(LyAABBToAZAabbWithFixup(aabb), LYColorBToAZColor(col), LyDrawStyleToAZDrawStyle(bSolid, bbDrawStyle), m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawAABBs(const AABB* aabb, uint32 aabbCount, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
for (int i = 0; i < aabbCount; ++aabbCount)
|
||||
{
|
||||
auxGeom->DrawAabb(
|
||||
LyAABBToAZAabbWithFixup(aabb[i]),
|
||||
LYColorBToAZColor(col),
|
||||
LyDrawStyleToAZDrawStyle(bSolid, bbDrawStyle),
|
||||
m_drawArgs.m_depthTest,
|
||||
AZ::RPI::AuxGeomDraw::DepthWrite::On,
|
||||
AZ::RPI::AuxGeomDraw::FaceCullMode::Back,
|
||||
m_viewProjOverrideIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawAABB(const AABB& aabb, const Matrix34& matWorld, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Matrix3x4 transform = LYTransformToAZMatrix3x4(matWorld);
|
||||
auxGeom->DrawAabb(
|
||||
LyAABBToAZAabbWithFixup(aabb),
|
||||
transform,
|
||||
LYColorBToAZColor(col),
|
||||
LyDrawStyleToAZDrawStyle(bSolid, bbDrawStyle),
|
||||
m_drawArgs.m_depthTest,
|
||||
AZ::RPI::AuxGeomDraw::DepthWrite::On,
|
||||
AZ::RPI::AuxGeomDraw::FaceCullMode::Back,
|
||||
m_viewProjOverrideIndex);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawOBB(const OBB& obb, const Vec3& pos, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
auxGeom->DrawObb(LyOBBtoAZObb(obb), LYVec3ToAZVec3(pos), LYColorBToAZColor(col), LyDrawStyleToAZDrawStyle(bSolid, bbDrawStyle), m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawOBB(const OBB& obb, const Matrix34& matWorld, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::Matrix3x4 transform = LYTransformToAZMatrix3x4(matWorld);
|
||||
auxGeom->DrawObb(LyOBBtoAZObb(obb), transform, LYColorBToAZColor(col), LyDrawStyleToAZDrawStyle(bSolid, bbDrawStyle), m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawSphere(const Vec3& pos, float radius, const ColorB& col, bool drawShaded)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle drawStyle = drawShaded ? AZ::RPI::AuxGeomDraw::DrawStyle::Shaded : AZ::RPI::AuxGeomDraw::DrawStyle::Solid;
|
||||
auxGeom->DrawSphere(LYVec3ToAZVec3(pos), radius, LYColorBToAZColor(col), drawStyle, m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawDisk(const Vec3& pos, const Vec3& dir, float radius, const ColorB& col, bool drawShaded)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle drawStyle = drawShaded ? AZ::RPI::AuxGeomDraw::DrawStyle::Shaded : AZ::RPI::AuxGeomDraw::DrawStyle::Solid;
|
||||
auxGeom->DrawDisk(LYVec3ToAZVec3(pos), LYVec3ToAZVec3(dir), radius, LYColorBToAZColor(col), drawStyle, m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawCone(const Vec3& pos, const Vec3& dir, float radius, float height, const ColorB& col, bool drawShaded)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle drawStyle = drawShaded ? AZ::RPI::AuxGeomDraw::DrawStyle::Shaded : AZ::RPI::AuxGeomDraw::DrawStyle::Solid;
|
||||
auxGeom->DrawCone(LYVec3ToAZVec3(pos), LYVec3ToAZVec3(dir), radius, height, LYColorBToAZColor(col), drawStyle, m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawCylinder(const Vec3& pos, const Vec3& dir, float radius, float height, const ColorB& col, bool drawShaded)
|
||||
{
|
||||
auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
if (auto auxGeom = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene))
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::DrawStyle drawStyle = drawShaded ? AZ::RPI::AuxGeomDraw::DrawStyle::Shaded : AZ::RPI::AuxGeomDraw::DrawStyle::Solid;
|
||||
auxGeom->DrawCylinder(LYVec3ToAZVec3(pos), LYVec3ToAZVec3(dir), radius, height, LYColorBToAZColor(col), drawStyle, m_drawArgs.m_depthTest);
|
||||
}
|
||||
}
|
||||
|
||||
void CAtomShimRenderAuxGeom::DrawBone(const Vec3& p, const Vec3& c, ColorB col)
|
||||
{
|
||||
Vec3 vBoneVec = c - p;
|
||||
float fBoneLength = vBoneVec.GetLength();
|
||||
|
||||
if (fBoneLength < 1e-4)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Matrix33 m33 = Matrix33::CreateRotationV0V1(Vec3(1, 0, 0), vBoneVec / fBoneLength);
|
||||
Matrix34 m34 = Matrix34(m33, p);
|
||||
|
||||
f32 t = min(0.01f, fBoneLength * 0.05f);
|
||||
|
||||
//bone points in x-direction
|
||||
Vec3 s = Vec3(ZERO);
|
||||
Vec3 m0 = Vec3(t, +t, +t);
|
||||
Vec3 m1 = Vec3(t, -t, +t);
|
||||
Vec3 m2 = Vec3(t, -t, -t);
|
||||
Vec3 m3 = Vec3(t, +t, -t);
|
||||
Vec3 e = Vec3(fBoneLength, 0, 0);
|
||||
|
||||
Vec3 VBuffer[6];
|
||||
ColorB CBuffer[6];
|
||||
|
||||
VBuffer[0] = m34 * s;
|
||||
CBuffer[0] = RGBA8(0xff, 0x1f, 0x1f, 0x00); //start of bone (joint)
|
||||
|
||||
VBuffer[1] = m34 * m0;
|
||||
CBuffer[1] = col;
|
||||
VBuffer[2] = m34 * m1;
|
||||
CBuffer[2] = col;
|
||||
VBuffer[3] = m34 * m2;
|
||||
CBuffer[3] = col;
|
||||
VBuffer[4] = m34 * m3;
|
||||
CBuffer[4] = col;
|
||||
|
||||
VBuffer[5] = m34 * e;
|
||||
CBuffer[5] = RGBA8(0x07, 0x0f, 0x1f, 0x00); //end of bone
|
||||
|
||||
|
||||
DrawLine(VBuffer[0], CBuffer[0], VBuffer[1], CBuffer[1]);
|
||||
DrawLine(VBuffer[0], CBuffer[0], VBuffer[2], CBuffer[2]);
|
||||
DrawLine(VBuffer[0], CBuffer[0], VBuffer[3], CBuffer[3]);
|
||||
DrawLine(VBuffer[0], CBuffer[0], VBuffer[4], CBuffer[4]);
|
||||
|
||||
DrawLine(VBuffer[1], CBuffer[1], VBuffer[2], CBuffer[2]);
|
||||
DrawLine(VBuffer[2], CBuffer[2], VBuffer[3], CBuffer[3]);
|
||||
DrawLine(VBuffer[3], CBuffer[3], VBuffer[4], CBuffer[4]);
|
||||
DrawLine(VBuffer[4], CBuffer[4], VBuffer[1], CBuffer[1]);
|
||||
|
||||
DrawLine(VBuffer[5], CBuffer[5], VBuffer[1], CBuffer[1]);
|
||||
DrawLine(VBuffer[5], CBuffer[5], VBuffer[2], CBuffer[2]);
|
||||
DrawLine(VBuffer[5], CBuffer[5], VBuffer[3], CBuffer[3]);
|
||||
DrawLine(VBuffer[5], CBuffer[5], VBuffer[4], CBuffer[4]);
|
||||
}
|
||||
@@ -1,105 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#ifndef CRYINCLUDE_CRYENGINE_RENDERDLL_XRENDERATOMSHIM_ATOMSHIMRENDERAUXGEOM_H
|
||||
#define CRYINCLUDE_CRYENGINE_RENDERDLL_XRENDERATOMSHIM_ATOMSHIMRENDERAUXGEOM_H
|
||||
#pragma once
|
||||
#include "../Common/RenderAuxGeom.h"
|
||||
#include <AzCore/Math/Matrix4x4.h>
|
||||
#include <Atom/RPI.Public/AuxGeom/AuxGeomDraw.h>
|
||||
|
||||
class CAtomShimRenderer;
|
||||
class ICrySizer;
|
||||
|
||||
class CAtomShimRenderAuxGeom
|
||||
: public IRenderAuxGeom
|
||||
{
|
||||
public:
|
||||
// interface
|
||||
virtual void SetRenderFlags(const SAuxGeomRenderFlags& renderFlags);
|
||||
virtual SAuxGeomRenderFlags GetRenderFlags();
|
||||
|
||||
virtual void Flush() {}
|
||||
virtual void Commit([[maybe_unused]] uint frames = 0) {}
|
||||
virtual void Process() {}
|
||||
|
||||
virtual void DrawPoint(const Vec3& v, const ColorB& col, uint8 size = 1);
|
||||
virtual void DrawPoints(const Vec3* v, uint32 numPoints, const ColorB& col, uint8 size = 1);
|
||||
virtual void DrawPoints(const Vec3* v, uint32 numPoints, const ColorB* col, uint8 size = 1);
|
||||
|
||||
virtual void DrawLine(const Vec3& v0, const ColorB& colV0, const Vec3& v1, const ColorB& colV1, float thickness = 1.0f);
|
||||
virtual void DrawLines(const Vec3* v, uint32 numPoints, const ColorB& col, float thickness = 1.0f);
|
||||
virtual void DrawLines(const Vec3* v, uint32 numPoints, const ColorB* col, float thickness = 1.0f);
|
||||
virtual void DrawLines(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB& col, float thickness = 1.0f);
|
||||
virtual void DrawLines(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB* col, float thickness = 1.0f);
|
||||
virtual void DrawPolyline(const Vec3* v, uint32 numPoints, bool closed, const ColorB& col, float thickness = 1.0f);
|
||||
virtual void DrawPolyline(const Vec3* v, uint32 numPoints, bool closed, const ColorB* col, float thickness = 1.0f);
|
||||
|
||||
virtual void DrawTriangle(const Vec3& v0, const ColorB& colV0, const Vec3& v1, const ColorB& colV1, const Vec3& v2, const ColorB& colV2);
|
||||
virtual void DrawTriangles(const Vec3* v, uint32 numPoints, const ColorB& col);
|
||||
virtual void DrawTriangles(const Vec3* v, uint32 numPoints, const ColorB* col);
|
||||
virtual void DrawTriangles(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB& col);
|
||||
virtual void DrawTriangles(const Vec3* v, uint32 numPoints, const vtx_idx* ind, uint32 numIndices, const ColorB* col);
|
||||
|
||||
virtual void DrawQuad(float width, float height, const Matrix34& matWorld, const ColorB& col, bool drawShaded = true);
|
||||
|
||||
virtual void DrawAABB(const AABB& aabb, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle);
|
||||
virtual void DrawAABBs(const AABB* aabb, uint32 aabbCount, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle);
|
||||
virtual void DrawAABB(const AABB& aabb, const Matrix34& matWorld, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle);
|
||||
|
||||
virtual void DrawOBB(const OBB& obb, const Vec3& pos, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle);
|
||||
virtual void DrawOBB(const OBB& obb, const Matrix34& matWorld, bool bSolid, const ColorB& col, const EBoundingBoxDrawStyle& bbDrawStyle);
|
||||
|
||||
virtual void DrawSphere(const Vec3& pos, float radius, const ColorB& col, bool drawShaded = true);
|
||||
virtual void DrawDisk(const Vec3& pos, const Vec3& dir, float radius, const ColorB& col, bool drawShaded = true);
|
||||
virtual void DrawCone(const Vec3& pos, const Vec3& dir, float radius, float height, const ColorB& col, bool drawShaded = true);
|
||||
virtual void DrawCylinder(const Vec3& pos, const Vec3& dir, float radius, float height, const ColorB& col, bool drawShaded = true);
|
||||
|
||||
virtual void DrawBone(const Vec3& rParent, const Vec3& rBone, ColorB col);
|
||||
|
||||
virtual void RenderText([[maybe_unused]] Vec3 pos, [[maybe_unused]] SDrawTextInfo& ti, [[maybe_unused]] const char* forma, [[maybe_unused]] va_list args) {}
|
||||
virtual void RenderText_NoArgs([[maybe_unused]] Vec3 pos, [[maybe_unused]] SDrawTextInfo& ti, [[maybe_unused]] const char* text) {}
|
||||
|
||||
public:
|
||||
static CAtomShimRenderAuxGeom* Create(CAtomShimRenderer& renderer)
|
||||
{
|
||||
if (s_pThis == NULL)
|
||||
{
|
||||
s_pThis = new CAtomShimRenderAuxGeom(renderer);
|
||||
}
|
||||
return s_pThis;
|
||||
}
|
||||
|
||||
public:
|
||||
~CAtomShimRenderAuxGeom();
|
||||
|
||||
void BeginFrame();
|
||||
void EndFrame();
|
||||
|
||||
void SetViewProjOverride(const AZ::Matrix4x4& viewProj);
|
||||
void UnsetViewProjOverride();
|
||||
|
||||
private:
|
||||
CAtomShimRenderAuxGeom(CAtomShimRenderer& renderer);
|
||||
|
||||
int32_t m_viewProjOverrideIndex = -1;
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicIndexedDrawArguments m_drawArgs;
|
||||
|
||||
CAtomShimRenderer* m_renderer;
|
||||
|
||||
static CAtomShimRenderAuxGeom* s_pThis;
|
||||
|
||||
SAuxGeomRenderFlags m_cryRenderFlags;
|
||||
};
|
||||
|
||||
#endif // NULL_RENDER_AUX_GEOM_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,617 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#ifndef NULL_RENDERER_H
|
||||
#define NULL_RENDERER_H
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
/*
|
||||
===========================================
|
||||
The NULLRenderer interface Class
|
||||
===========================================
|
||||
*/
|
||||
|
||||
#define MAX_TEXTURE_STAGES 4
|
||||
|
||||
#include "CryArray.h"
|
||||
#include "AtomShim_RenderAuxGeom.h"
|
||||
|
||||
#include <AzCore/Module/Module.h>
|
||||
|
||||
#include <AtomCore/Instance/Instance.h>
|
||||
|
||||
#include <Atom/RHI.Reflect/Base.h>
|
||||
#include <Atom/RHI/ImageView.h>
|
||||
#include <Atom/RPI.Public/DynamicDraw/DynamicDrawInterface.h>
|
||||
#include <Atom/RPI.Public/Image/StreamingImage.h>
|
||||
|
||||
#include <AzFramework/Components/CameraBus.h>
|
||||
|
||||
// Forward declaration.
|
||||
namespace AZ
|
||||
{
|
||||
namespace RHI
|
||||
{
|
||||
class Image;
|
||||
}
|
||||
|
||||
namespace RPI
|
||||
{
|
||||
class Scene;
|
||||
class RenderPipeline;
|
||||
class WindowContext;
|
||||
class View;
|
||||
class ViewportContext;
|
||||
}
|
||||
}
|
||||
|
||||
//! A vector of these structs is used to keep track of the different viewports using Atom to render.
|
||||
//! Each viewport currently has its own scene and pipeline.
|
||||
struct AtomShimViewContext
|
||||
{
|
||||
HWND m_hWnd;
|
||||
bool m_isMainViewport;
|
||||
|
||||
// width and height of the viewport.
|
||||
// These are not fully used currently since each viewport window sends OnWindowResized messages to the WindowContext
|
||||
// these could instead be sent via the AtomShim in future if desired.
|
||||
int m_width;
|
||||
int m_height;
|
||||
|
||||
AZ::RPI::Scene* m_scene = nullptr;
|
||||
AZStd::shared_ptr<AZ::RPI::RenderPipeline> m_renderPipeline;
|
||||
AZStd::shared_ptr<AZ::RPI::View> m_view;
|
||||
};
|
||||
|
||||
#define ATOM_SHIM_TEXTURE_TYPE eTT_MaxTexType
|
||||
|
||||
struct AtomShimTexture
|
||||
: public CTexture
|
||||
, public AZ::Data::AssetBus::Handler
|
||||
{
|
||||
AtomShimTexture(uint32 nFlags) : CTexture(nFlags)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~AtomShimTexture();
|
||||
|
||||
void QueueForHotReload(const AZ::Data::AssetId& assetId);
|
||||
|
||||
void OnAssetReady(AZ::Data::Asset<AZ::Data::AssetData> asset) override;
|
||||
|
||||
void CreateFromStreamingImageAsset(const AZ::Data::Asset<AZ::RPI::StreamingImageAsset>& streamingImageAsset);
|
||||
void CreateFromImage(const AZ::Data::Instance<AZ::RPI::Image>& image);
|
||||
|
||||
virtual void SetClamp(bool bEnable)
|
||||
{
|
||||
uint32 flags = GetFlags();
|
||||
if (bEnable)
|
||||
{
|
||||
flags |= FT_STATE_CLAMP;
|
||||
}
|
||||
else
|
||||
{
|
||||
flags &= ~FT_STATE_CLAMP;
|
||||
}
|
||||
SetFlags(flags);
|
||||
}
|
||||
|
||||
AZ::Data::Instance<AZ::RPI::Image> m_instance; // This is only set for textures loaded from an asset
|
||||
AZ::RHI::Ptr<AZ::RHI::Image> m_image; // This is only set for textures created dynamically (e.g. font images)
|
||||
AZ::RHI::Ptr<AZ::RHI::ImageView> m_imageView;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
class CAtomShimRenderer
|
||||
: public CRenderer
|
||||
, public AZ::Module // This is a base class so that StaticNames in the NameDictionary work in this DLL
|
||||
, Camera::ActiveCameraRequestBus::Handler
|
||||
{
|
||||
public:
|
||||
|
||||
////---------------------------------------------------------------------------------------------------------------------
|
||||
virtual SRenderPipeline* GetRenderPipeline() override { return nullptr; }
|
||||
virtual SRenderThread* GetRenderThread() override { return nullptr; }
|
||||
virtual void FX_SetState(int st, int AlphaRef = -1, int RestoreState = 0) override;
|
||||
void SetCull([[maybe_unused]] ECull eCull, [[maybe_unused]] bool bSkipMirrorCull = false) override {}
|
||||
virtual SDepthTexture* GetDepthBufferOrig() override { return nullptr; }
|
||||
virtual uint32 GetBackBufferWidth() override { return 0; }
|
||||
virtual uint32 GetBackBufferHeight() override { return 0; };
|
||||
virtual const SRenderTileInfo* GetRenderTileInfo() const override { return nullptr; }
|
||||
|
||||
virtual void FX_CommitStates([[maybe_unused]] const SShaderTechnique* pTech, [[maybe_unused]] const SShaderPass* pPass, [[maybe_unused]] bool bUseMaterialState) override {}
|
||||
virtual void FX_Commit([[maybe_unused]] bool bAllowDIP = false) override {}
|
||||
virtual long FX_SetVertexDeclaration([[maybe_unused]] int StreamMask, [[maybe_unused]] const AZ::Vertex::Format& vertexFormat) override { return 0; }
|
||||
virtual void FX_DrawIndexedPrimitive([[maybe_unused]] const eRenderPrimitiveType eType, [[maybe_unused]] const int nVBOffset, [[maybe_unused]] const int nMinVertexIndex, [[maybe_unused]] const int nVerticesCount, [[maybe_unused]] const int nStartIndex, [[maybe_unused]] const int nNumIndices, [[maybe_unused]] bool bInstanced = false) override {}
|
||||
virtual SDepthTexture* FX_GetDepthSurface([[maybe_unused]] int nWidth, [[maybe_unused]] int nHeight, [[maybe_unused]] bool bAA, [[maybe_unused]] bool shaderResourceView = false) override { return nullptr; }
|
||||
virtual long FX_SetIStream([[maybe_unused]] const void* pB, [[maybe_unused]] uint32 nOffs, [[maybe_unused]] RenderIndexType idxType) override { return -1; }
|
||||
virtual long FX_SetVStream([[maybe_unused]] int nID, [[maybe_unused]] const void* pB, [[maybe_unused]] uint32 nOffs, [[maybe_unused]] uint32 nStride, [[maybe_unused]] uint32 nFreq = 1) override { return -1; }
|
||||
virtual void FX_DrawPrimitive([[maybe_unused]] eRenderPrimitiveType eType, [[maybe_unused]] int nStartVertex, [[maybe_unused]] int nVerticesCount, [[maybe_unused]] int nInstanceVertices = 0) {}
|
||||
virtual void DrawQuad3D([[maybe_unused]] const Vec3& v0, [[maybe_unused]] const Vec3& v1, [[maybe_unused]] const Vec3& v2, [[maybe_unused]] const Vec3& v3, [[maybe_unused]] const ColorF& color, [[maybe_unused]] float ftx0, [[maybe_unused]] float fty0, [[maybe_unused]] float ftx1, [[maybe_unused]] float fty1) override {}
|
||||
virtual void DrawQuad([[maybe_unused]] float x0, [[maybe_unused]] float y0, [[maybe_unused]] float x1, [[maybe_unused]] float y1, [[maybe_unused]] const ColorF& color, [[maybe_unused]] float z = 1.0f, [[maybe_unused]] float s0 = 0.0f, [[maybe_unused]] float t0 = 0.0f, [[maybe_unused]] float s1 = 1.0f, [[maybe_unused]] float t1 = 1.0f) override {};
|
||||
virtual void FX_ClearTarget(ITexture* pTex) override;
|
||||
virtual void FX_ClearTarget(SDepthTexture* pTex) override;
|
||||
|
||||
virtual bool FX_SetRenderTarget(int nTarget, void* pTargetSurf, SDepthTexture* pDepthTarget, uint32 nTileCount = 1) override;
|
||||
virtual bool FX_PushRenderTarget(int nTarget, void* pTargetSurf, SDepthTexture* pDepthTarget, uint32 nTileCount = 1) override;
|
||||
virtual bool FX_SetRenderTarget(int nTarget, CTexture* pTarget, SDepthTexture* pDepthTarget, bool bPush = false, int nCMSide = -1, bool bScreenVP = false, uint32 nTileCount = 1) override;
|
||||
virtual bool FX_PushRenderTarget(int nTarget, CTexture* pTarget, SDepthTexture* pDepthTarget, int nCMSide = -1, bool bScreenVP = false, uint32 nTileCount = 1) override;
|
||||
virtual bool FX_RestoreRenderTarget(int nTarget) override;
|
||||
virtual bool FX_PopRenderTarget(int nTarget) override;
|
||||
virtual void FX_SetActiveRenderTargets([[maybe_unused]] bool bAllowDIP = false) override {}
|
||||
virtual void EF_Scissor([[maybe_unused]] bool bEnable, [[maybe_unused]] int sX, [[maybe_unused]] int sY, [[maybe_unused]] int sWdt, [[maybe_unused]] int sHgt) override {};
|
||||
virtual void FX_ResetPipe() override {};
|
||||
|
||||
////---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
CAtomShimRenderer();
|
||||
virtual ~CAtomShimRenderer();
|
||||
|
||||
virtual WIN_HWND Init(int x, int y, int width, int height, unsigned int cbpp, int zbpp, int sbits, bool fullscreen, bool isEditor, WIN_HINSTANCE hinst, WIN_HWND Glhwnd = 0, bool bReInit = false, const SCustomRenderInitArgs* pCustomArgs = 0, bool bShaderCacheGen = false);
|
||||
virtual WIN_HWND GetHWND();
|
||||
virtual bool SetWindowIcon(const char* path);
|
||||
|
||||
virtual ERenderType GetRenderType() const override;
|
||||
|
||||
virtual const char* GetRenderDescription() const override;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
// Render-context management
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
virtual bool SetCurrentContext(WIN_HWND hWnd);
|
||||
virtual bool CreateContext(WIN_HWND hWnd, bool bAllowMSAA, int SSX, int SSY);
|
||||
virtual bool DeleteContext(WIN_HWND hWnd);
|
||||
virtual void MakeMainContextActive();
|
||||
virtual WIN_HWND GetCurrentContextHWND() { return m_currContext ? m_currContext->m_hWnd : m_hWnd; }
|
||||
virtual bool IsCurrentContextMainVP() { return m_currContext ? m_currContext->m_isMainViewport : true; }
|
||||
|
||||
virtual int GetCurrentContextViewportWidth() const { return -1; }
|
||||
virtual int GetCurrentContextViewportHeight() const { return -1; }
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual int CreateRenderTarget(const char* name, int nWidth, int nHeight, const ColorF& cClear, ETEX_Format eTF = eTF_R8G8B8A8);
|
||||
virtual bool ResizeRenderTarget(int nHandle, int nWidth, int nHeight);
|
||||
virtual bool DestroyRenderTarget(int nHandle);
|
||||
virtual bool SetRenderTarget(int nHandle, SDepthTexture* pDepthSurf = nullptr);
|
||||
virtual SDepthTexture* CreateDepthSurface(int nWidth, int nHeight, bool shaderResourceView = false);
|
||||
virtual void DestroyDepthSurface(SDepthTexture* pDepthSurf);
|
||||
|
||||
virtual int GetOcclusionBuffer(uint16* pOutOcclBuffer, Matrix44* pmCamBuffe);
|
||||
virtual void WaitForParticleBuffer(threadID nThreadId);
|
||||
|
||||
virtual void GetVideoMemoryUsageStats([[maybe_unused]] size_t& vidMemUsedThisFrame, [[maybe_unused]] size_t& vidMemUsedRecently, [[maybe_unused]] bool bGetPoolsSizes = false) {}
|
||||
|
||||
virtual void SetRenderTile([[maybe_unused]] f32 nTilesPosX, [[maybe_unused]] f32 nTilesPosY, [[maybe_unused]] f32 nTilesGridSizeX, [[maybe_unused]] f32 nTilesGridSizeY) {}
|
||||
|
||||
virtual void EF_InvokeShadowMapRenderJobs([[maybe_unused]] int nFlags){}
|
||||
//! Fills array of all supported video formats (except low resolution formats)
|
||||
//! Returns number of formats, also when called with NULL
|
||||
virtual int EnumDisplayFormats(SDispFormat* Formats);
|
||||
|
||||
//! Return all supported by video card video AA formats
|
||||
virtual int EnumAAFormats([[maybe_unused]] SAAFormat* Formats) { return 0; }
|
||||
|
||||
//! Changes resolution of the window/device (doen't require to reload the level
|
||||
virtual bool ChangeResolution(int nNewWidth, int nNewHeight, int nNewColDepth, int nNewRefreshHZ, bool bFullScreen, bool bForce);
|
||||
|
||||
virtual Vec2 SetViewportDownscale([[maybe_unused]] float xscale, [[maybe_unused]] float yscale) { return Vec2(0, 0); }
|
||||
virtual void SetCurDownscaleFactor([[maybe_unused]] Vec2 sf) {};
|
||||
|
||||
virtual EScreenAspectRatio GetScreenAspect([[maybe_unused]] int nWidth, [[maybe_unused]] int nHeight) { return eAspect_4_3; }
|
||||
|
||||
virtual void SwitchToNativeResolutionBackbuffer() {}
|
||||
|
||||
virtual void ShutDown(bool bReInit = false);
|
||||
virtual void ShutDownFast();
|
||||
|
||||
virtual void BeginFrame();
|
||||
virtual void RenderDebug(bool bRernderStats = true);
|
||||
virtual void EndFrame();
|
||||
virtual void LimitFramerate([[maybe_unused]] const int maxFPS, [[maybe_unused]] const bool bUseSleep) {}
|
||||
|
||||
virtual void TryFlush();
|
||||
|
||||
virtual void Reset (void) {};
|
||||
virtual void RT_ReleaseCB(void*){}
|
||||
|
||||
virtual void InitSystemResources(int nFlags);
|
||||
virtual void ForceGC() {}
|
||||
virtual void FlushPendingTextureTasks() {}
|
||||
|
||||
virtual void SetTexture(int tnum);
|
||||
virtual void SetTexture(int tnum, int nUnit);
|
||||
virtual void SetState(int State, int AlphaRef);
|
||||
|
||||
virtual void DrawStringU(IFFont_RenderProxy* pFont, float x, float y, float z, const char* pStr, bool asciiMultiLine, const STextDrawContext& ctx) const;
|
||||
virtual void DrawDynVB(SVF_P3F_C4B_T2F* pBuf, uint16* pInds, int nVerts, int nInds, PublicRenderPrimitiveType nPrimType);
|
||||
virtual void DrawDynUiPrimitiveList(DynUiPrimitiveList& primitives, int totalNumVertices, int totalNumIndices);
|
||||
|
||||
virtual void DrawBuffer(CVertexBuffer* pVBuf, CIndexBuffer* pIBuf, int nNumIndices, int nOffsIndex, const PublicRenderPrimitiveType nPrmode, int nVertStart = 0, int nVertStop = 0);
|
||||
|
||||
virtual void CheckError(const char* comment);
|
||||
|
||||
virtual void DrawLine([[maybe_unused]] const Vec3& vPos1, [[maybe_unused]] const Vec3& vPos2) {};
|
||||
virtual void Graph([[maybe_unused]] byte* g, [[maybe_unused]] int x, [[maybe_unused]] int y, [[maybe_unused]] int wdt, [[maybe_unused]] int hgt, [[maybe_unused]] int nC, [[maybe_unused]] int type, [[maybe_unused]] const char* text, [[maybe_unused]] ColorF& color, [[maybe_unused]] float fScale) {};
|
||||
|
||||
virtual void SetCamera(const CCamera& cam);
|
||||
virtual void SetViewport(int x, int y, int width, int height, int id = 0);
|
||||
virtual void SetScissor(int x = 0, int y = 0, int width = 0, int height = 0);
|
||||
virtual void GetViewport(int* x, int* y, int* width, int* height) const;
|
||||
|
||||
virtual void SetCullMode (int mode = R_CULL_BACK);
|
||||
virtual bool EnableFog (bool enable);
|
||||
virtual void SetFogColor(const ColorF& color);
|
||||
virtual void EnableVSync(bool enable);
|
||||
|
||||
virtual void DrawPrimitivesInternal(CVertexBuffer* src, int vert_num, const eRenderPrimitiveType prim_type);
|
||||
|
||||
virtual void PushMatrix();
|
||||
virtual void RotateMatrix(float a, float x, float y, float z);
|
||||
virtual void RotateMatrix(const Vec3& angels);
|
||||
virtual void TranslateMatrix(float x, float y, float z);
|
||||
virtual void ScaleMatrix(float x, float y, float z);
|
||||
virtual void TranslateMatrix(const Vec3& pos);
|
||||
virtual void MultMatrix(const float* mat);
|
||||
virtual void LoadMatrix(const Matrix34* src = 0);
|
||||
virtual void PopMatrix();
|
||||
|
||||
virtual void EnableTMU(bool enable);
|
||||
virtual void SelectTMU(int tnum);
|
||||
|
||||
virtual bool ChangeDisplay(unsigned int width, unsigned int height, unsigned int cbpp);
|
||||
virtual void ChangeViewport(unsigned int x, unsigned int y, unsigned int width, unsigned int height, bool bMainViewport = false, float scaleWidth = 1.0f, float scaleHeight = 1.0f);
|
||||
|
||||
virtual bool SaveTga([[maybe_unused]] unsigned char* sourcedata, [[maybe_unused]] int sourceformat, [[maybe_unused]] int w, [[maybe_unused]] int h, [[maybe_unused]] const char* filename, [[maybe_unused]] bool flip) const { return false; }
|
||||
|
||||
//download an image to video memory. 0 in case of failure
|
||||
virtual void CreateResourceAsync([[maybe_unused]] SResourceAsync* Resource) {};
|
||||
virtual void ReleaseResourceAsync([[maybe_unused]] SResourceAsync* Resource) {};
|
||||
void ReleaseResourceAsync(AZStd::unique_ptr<SResourceAsync> Resource) override {};
|
||||
virtual unsigned int DownLoadToVideoMemory([[maybe_unused]] const byte* data, [[maybe_unused]] int w, [[maybe_unused]] int h, [[maybe_unused]] int d, [[maybe_unused]] ETEX_Format eTFSrc, [[maybe_unused]] ETEX_Format eTFDst, [[maybe_unused]] int nummipmap, [[maybe_unused]] ETEX_Type eTT, [[maybe_unused]] bool repeat = true, [[maybe_unused]] int filter = FILTER_BILINEAR, [[maybe_unused]] int Id = 0, [[maybe_unused]] const char* szCacheName = NULL, [[maybe_unused]] int flags = 0, [[maybe_unused]] EEndian eEndian = eLittleEndian, [[maybe_unused]] RectI* pRegion = NULL, [[maybe_unused]] bool bAsynDevTexCreation = false) { return 0; }
|
||||
virtual unsigned int DownLoadToVideoMemory([[maybe_unused]] const byte* data, [[maybe_unused]] int w, [[maybe_unused]] int h, [[maybe_unused]] ETEX_Format eTFSrc, [[maybe_unused]] ETEX_Format eTFDst, [[maybe_unused]] int nummipmap, [[maybe_unused]] bool repeat = true, [[maybe_unused]] int filter = FILTER_BILINEAR, [[maybe_unused]] int Id = 0, [[maybe_unused]] const char* szCacheName = NULL, [[maybe_unused]] int flags = 0, [[maybe_unused]] EEndian eEndian = eLittleEndian, [[maybe_unused]] RectI* pRegion = NULL, [[maybe_unused]] bool bAsynDevTexCreation = false) { return 0; }
|
||||
virtual unsigned int DownLoadToVideoMemoryCube([[maybe_unused]] const byte* data, [[maybe_unused]] int w, [[maybe_unused]] int h, [[maybe_unused]] ETEX_Format eTFSrc, [[maybe_unused]] ETEX_Format eTFDst, [[maybe_unused]] int nummipmap, [[maybe_unused]] bool repeat = true, [[maybe_unused]] int filter = FILTER_BILINEAR, [[maybe_unused]] int Id = 0, [[maybe_unused]] const char* szCacheName = NULL, [[maybe_unused]] int flags = 0, [[maybe_unused]] EEndian eEndian = eLittleEndian, [[maybe_unused]] RectI* pRegion = NULL, [[maybe_unused]] bool bAsynDevTexCreation = false) { return 0; }
|
||||
virtual unsigned int DownLoadToVideoMemory3D([[maybe_unused]] const byte* data, [[maybe_unused]] int w, [[maybe_unused]] int h, [[maybe_unused]] int d, [[maybe_unused]] ETEX_Format eTFSrc, [[maybe_unused]] ETEX_Format eTFDst, [[maybe_unused]] int nummipmap, [[maybe_unused]] bool repeat = true, [[maybe_unused]] int filter = FILTER_BILINEAR, [[maybe_unused]] int Id = 0, [[maybe_unused]] const char* szCacheName = NULL, [[maybe_unused]] int flags = 0, [[maybe_unused]] EEndian eEndian = eLittleEndian, [[maybe_unused]] RectI* pRegion = NULL, [[maybe_unused]] bool bAsynDevTexCreation = false) { return 0; }
|
||||
virtual void UpdateTextureInVideoMemory([[maybe_unused]] uint32 tnum, [[maybe_unused]] const byte* newdata, [[maybe_unused]] int posx, [[maybe_unused]] int posy, [[maybe_unused]] int w, [[maybe_unused]] int h, [[maybe_unused]] ETEX_Format eTFSrc = eTF_R8G8B8A8, [[maybe_unused]] int posz = 0, [[maybe_unused]] int sizez = 1){}
|
||||
|
||||
virtual bool SetGammaDelta(float fGamma);
|
||||
virtual void RestoreGamma(void) {};
|
||||
|
||||
virtual void RemoveTexture([[maybe_unused]] unsigned int TextureId) {}
|
||||
virtual void DeleteFont([[maybe_unused]] IFFont* font) {}
|
||||
|
||||
virtual void Draw2dImage(float xpos, float ypos, float w, float h, int texture_id, float s0 = 0, float t0 = 0, float s1 = 1, float t1 = 1, float angle = 0, float r = 1, float g = 1, float b = 1, float a = 1, float z = 1);
|
||||
virtual void Push2dImage(float xpos, float ypos, float w, float h, int texture_id, float s0 = 0, float t0 = 0, float s1 = 1, float t1 = 1, float angle = 0, float r = 1, float g = 1, float b = 1, float a = 1, float z = 1, float stereoDepth = 0);
|
||||
virtual void Draw2dImageList();
|
||||
virtual void Draw2dImageStretchMode([[maybe_unused]] bool stretch) {};
|
||||
virtual void DrawImage(float xpos, float ypos, float w, float h, int texture_id, float s0, float t0, float s1, float t1, float r, float g, float b, float a, bool filtered = true);
|
||||
virtual void DrawImageWithUV(float xpos, float ypos, float z, float w, float h, int texture_id, float s[4], float t[4], float r, float g, float b, float a, bool filtered = true);
|
||||
|
||||
virtual void PushWireframeMode(int mode);
|
||||
virtual void PopWireframeMode();
|
||||
virtual void FX_PushWireframeMode(int mode);
|
||||
virtual void FX_PopWireframeMode();
|
||||
virtual void FX_SetWireframeMode(int mode);
|
||||
|
||||
virtual void FX_PreRender([[maybe_unused]] int Stage) override {}
|
||||
virtual void FX_PostRender() override {}
|
||||
|
||||
virtual void ResetToDefault();
|
||||
virtual void SetDefaultRenderStates() {}
|
||||
|
||||
virtual int GenerateAlphaGlowTexture(float k);
|
||||
|
||||
virtual void ApplyViewParameters(const CameraViewParameters&) override;
|
||||
virtual void SetMaterialColor(float r, float g, float b, float a);
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* Sizer);
|
||||
|
||||
// Project/UnProject. Returns true if successful.
|
||||
virtual bool ProjectToScreen(float ptx, float pty, float ptz,
|
||||
float* sx, float* sy, float* sz);
|
||||
virtual int UnProject(float sx, float sy, float sz,
|
||||
float* px, float* py, float* pz,
|
||||
const float modelMatrix[16],
|
||||
const float projMatrix[16],
|
||||
const int viewport[4]);
|
||||
virtual int UnProjectFromScreen(float sx, float sy, float sz,
|
||||
float* px, float* py, float* pz);
|
||||
|
||||
// Shadow Mapping
|
||||
virtual bool PrepareDepthMap(ShadowMapFrustum* SMSource, int nFrustumLOD = 0, bool bClearPool = false);
|
||||
virtual void DrawAllShadowsOnTheScreen();
|
||||
virtual void OnEntityDeleted([[maybe_unused]] IRenderNode* pRenderNode) {};
|
||||
|
||||
virtual void FX_SetClipPlane (bool bEnable, float* pPlane, bool bRefract);
|
||||
|
||||
virtual void SetColorOp(byte eCo, byte eAo, byte eCa, byte eAa);
|
||||
virtual void EF_SetColorOp([[maybe_unused]] byte eCo, [[maybe_unused]] byte eAo, [[maybe_unused]] byte eCa, [[maybe_unused]] byte eAa) {};
|
||||
|
||||
virtual void SetSrgbWrite([[maybe_unused]] bool srgbWrite) {};
|
||||
virtual void EF_SetSrgbWrite([[maybe_unused]] bool sRGBWrite) {};
|
||||
|
||||
//for editor
|
||||
virtual void GetModelViewMatrix(float* mat);
|
||||
virtual void GetProjectionMatrix(float* mat);
|
||||
|
||||
//for texture
|
||||
virtual ITexture* EF_LoadTexture(const char* nameTex, uint32 flags = 0);
|
||||
virtual ITexture* EF_LoadDefaultTexture(const char* nameTex);
|
||||
|
||||
virtual void DrawQuad(const Vec3& right, const Vec3& up, const Vec3& origin, int nFlipMode = 0);
|
||||
virtual void DrawQuad(float dy, float dx, float dz, float x, float y, float z);
|
||||
// NOTE: deprecated
|
||||
virtual void ClearTargetsImmediately(uint32 nFlags);
|
||||
virtual void ClearTargetsImmediately(uint32 nFlags, const ColorF& Colors, float fDepth);
|
||||
virtual void ClearTargetsImmediately(uint32 nFlags, const ColorF& Colors);
|
||||
virtual void ClearTargetsImmediately(uint32 nFlags, float fDepth);
|
||||
|
||||
virtual void ClearTargetsLater(uint32 nFlags);
|
||||
virtual void ClearTargetsLater(uint32 nFlags, const ColorF& Colors, float fDepth);
|
||||
virtual void ClearTargetsLater(uint32 nFlags, const ColorF& Colors);
|
||||
virtual void ClearTargetsLater(uint32 nFlags, float fDepth);
|
||||
|
||||
virtual void ReadFrameBuffer(unsigned char* pRGB, int nImageX, int nSizeX, int nSizeY, ERB_Type eRBType, bool bRGBA, int nScaledX = -1, int nScaledY = -1);
|
||||
virtual void ReadFrameBufferFast(uint32* pDstARGBA8, int dstWidth, int dstHeight, bool BGRA = true);
|
||||
|
||||
virtual bool CaptureFrameBufferFast(unsigned char* pDstRGBA8, int destinationWidth, int destinationHeight);
|
||||
virtual bool CopyFrameBufferFast(unsigned char* pDstRGBA8, int destinationWidth, int destinationHeight);
|
||||
virtual bool RegisterCaptureFrame(ICaptureFrameListener* pCapture);
|
||||
virtual bool UnRegisterCaptureFrame(ICaptureFrameListener* pCapture);
|
||||
virtual bool InitCaptureFrameBufferFast(uint32 bufferWidth, uint32 bufferHeight);
|
||||
virtual void CloseCaptureFrameBufferFast(void);
|
||||
virtual void CaptureFrameBufferCallBack(void);
|
||||
|
||||
|
||||
virtual void ReleaseHWShaders() {}
|
||||
virtual void PrintResourcesLeaks() {}
|
||||
|
||||
//misc
|
||||
virtual bool ScreenShot(const char* filename = NULL, int width = 0);
|
||||
|
||||
virtual void Set2DMode(uint32 orthoWidth, uint32 orthoHeight, TransformationMatrices& backupMatrices, float znear = -1e10f, float zfar = 1e10f);
|
||||
virtual void Unset2DMode(const TransformationMatrices& restoringMatrices);
|
||||
virtual void Set2DModeNonZeroTopLeft(float orthoLeft, float orthoTop, float orthoWidth, float orthoHeight, TransformationMatrices& backupMatrices, float znear = -1e10f, float zfar = 1e10f);
|
||||
|
||||
virtual int ScreenToTexture(int nTexID);
|
||||
|
||||
virtual void DrawPoints([[maybe_unused]] Vec3 v[], [[maybe_unused]] int nump, [[maybe_unused]] ColorF& col, [[maybe_unused]] int flags) {};
|
||||
virtual void DrawLines([[maybe_unused]] Vec3 v[], [[maybe_unused]] int nump, [[maybe_unused]] ColorF& col, [[maybe_unused]] int flags, [[maybe_unused]] float fGround) {};
|
||||
|
||||
virtual void RefreshSystemShaders() {}
|
||||
|
||||
// Shaders/Shaders support
|
||||
// RE - RenderElement
|
||||
|
||||
virtual void EF_Release(int nFlags);
|
||||
virtual void FX_PipelineShutdown(bool bFastShutdown = false);
|
||||
|
||||
//==========================================================
|
||||
// external interface for shaders
|
||||
//==========================================================
|
||||
|
||||
virtual bool EF_SetLightHole(Vec3 vPos, Vec3 vNormal, int idTex, float fScale = 1.0f, bool bAdditive = true);
|
||||
|
||||
// Draw all shaded REs in the list
|
||||
virtual void EF_EndEf3D (int nFlags, int nPrecacheUpdateId, int nNearPrecacheUpdateId, const SRenderingPassInfo& passInfo);
|
||||
|
||||
// 2d interface for shaders
|
||||
virtual void EF_EndEf2D(bool bSort);
|
||||
virtual bool EF_PrecacheResource(SShaderItem* pSI, float fMipFactor, float fTimeToReady, int Flags, int nUpdateId, int nCounter);
|
||||
virtual bool EF_PrecacheResource(ITexture* pTP, float fDist, float fTimeToReady, int Flags, int nUpdateId, int nCounter);
|
||||
virtual void PrecacheResources();
|
||||
virtual void PostLevelLoading() {}
|
||||
virtual void PostLevelUnload() {}
|
||||
|
||||
virtual ITexture* EF_CreateCompositeTexture(int type, const char* szName, int nWidth, int nHeight, int nDepth, int nMips, int nFlags, ETEX_Format eTF, const STexComposition* pCompositions, size_t nCompositions, int8 nPriority = -1);
|
||||
|
||||
void EF_Init();
|
||||
|
||||
virtual IDynTexture* MakeDynTextureFromShadowBuffer(int nSize, IDynTexture* pDynTexture);
|
||||
virtual void MakeSprite(IDynTexture*& rTexturePtr, float _fSpriteDistance, int nTexSize, float angle, float angle2, IStatObj* pStatObj, const float fBrightnessMultiplier, SRendParams& rParms);
|
||||
virtual uint32 RenderOccludersIntoBuffer([[maybe_unused]] const CCamera& viewCam, [[maybe_unused]] int nTexSize, [[maybe_unused]] PodArray<IRenderNode*>& lstOccluders, [[maybe_unused]] float* pBuffer) { return 0; }
|
||||
|
||||
virtual IRenderAuxGeom* GetIRenderAuxGeom([[maybe_unused]] void* jobID = 0)
|
||||
{
|
||||
return m_pAtomShimRenderAuxGeom;
|
||||
}
|
||||
|
||||
virtual IColorGradingController* GetIColorGradingController();
|
||||
virtual IStereoRenderer* GetIStereoRenderer();
|
||||
|
||||
virtual ITexture* Create2DTexture(const char* name, int width, int height, int numMips, int flags, unsigned char* data, ETEX_Format format);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// All font functions are not implemented since the font is rendered by AtomFont
|
||||
int FontCreateTexture(
|
||||
[[maybe_unused]] int Width, [[maybe_unused]] int Height, [[maybe_unused]] byte* pData,
|
||||
[[maybe_unused]] ETEX_Format eTF = eTF_R8G8B8A8, [[maybe_unused]] bool genMips = false,
|
||||
[[maybe_unused]] const char* textureName = nullptr) override
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
bool FontUpdateTexture(
|
||||
[[maybe_unused]] int nTexId, [[maybe_unused]] int X, [[maybe_unused]] int Y, [[maybe_unused]] int USize, [[maybe_unused]] int VSize,
|
||||
[[maybe_unused]] byte* pData) override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void FontSetTexture([[maybe_unused]] int nTexId, [[maybe_unused]] int nFilterMode) override { }
|
||||
void FontSetRenderingState([[maybe_unused]] bool overrideViewProjMatrices, [[maybe_unused]] TransformationMatrices& backupMatrices) override { }
|
||||
void FontSetBlending([[maybe_unused]] int src, [[maybe_unused]] int dst, [[maybe_unused]] int baseState) override { }
|
||||
void FontRestoreRenderingState([[maybe_unused]] bool overrideViewProjMatrices, [[maybe_unused]] const TransformationMatrices& restoringMatrices) override { }
|
||||
|
||||
virtual void GetLogVBuffers(void) {}
|
||||
|
||||
virtual void RT_PresentFast() {}
|
||||
|
||||
virtual void RT_ForceSwapBuffers() {}
|
||||
virtual void RT_SwitchToNativeResolutionBackbuffer([[maybe_unused]] bool resolveBackBuffer) {}
|
||||
|
||||
virtual void RT_BeginFrame() {}
|
||||
virtual void RT_EndFrame() {}
|
||||
virtual void RT_Init() {}
|
||||
virtual void RT_ShutDown([[maybe_unused]] uint32 nFlags) {}
|
||||
virtual bool RT_CreateDevice() { return true; }
|
||||
virtual void RT_Reset() {}
|
||||
virtual void RT_SetCull([[maybe_unused]] int nMode) {}
|
||||
virtual void RT_SetScissor([[maybe_unused]] bool bEnable, [[maybe_unused]] int x, [[maybe_unused]] int y, [[maybe_unused]] int width, [[maybe_unused]] int height){}
|
||||
virtual void RT_RenderScene([[maybe_unused]] int nFlags, [[maybe_unused]] SThreadInfo& TI, [[maybe_unused]] RenderFunc pRenderFunc) {}
|
||||
virtual void RT_PrepareStereo([[maybe_unused]] int mode, [[maybe_unused]] int output) {}
|
||||
virtual void RT_CopyToStereoTex([[maybe_unused]] int channel) {}
|
||||
virtual void RT_UpdateTrackingStates() {}
|
||||
virtual void RT_DisplayStereo() {}
|
||||
virtual void RT_SetCameraInfo() {}
|
||||
virtual void RT_SetStereoCamera() {}
|
||||
virtual void RT_ReadFrameBuffer([[maybe_unused]] unsigned char* pRGB, [[maybe_unused]] int nImageX, [[maybe_unused]] int nSizeX, [[maybe_unused]] int nSizeY, [[maybe_unused]] ERB_Type eRBType, [[maybe_unused]] bool bRGBA, [[maybe_unused]] int nScaledX, [[maybe_unused]] int nScaledY) {}
|
||||
virtual void RT_RenderScene([[maybe_unused]] int nFlags, [[maybe_unused]] SThreadInfo& TI, [[maybe_unused]] int nR, [[maybe_unused]] RenderFunc pRenderFunc) {};
|
||||
virtual void RT_CreateResource([[maybe_unused]] SResourceAsync* Res) {};
|
||||
virtual void RT_ReleaseResource([[maybe_unused]] SResourceAsync* Res) {};
|
||||
virtual void RT_ReleaseRenderResources() {};
|
||||
virtual void RT_UnbindResources() {};
|
||||
virtual void RT_UnbindTMUs() {};
|
||||
virtual void RT_PrecacheDefaultShaders() {};
|
||||
virtual void RT_CreateRenderResources() {};
|
||||
virtual void RT_ClearTarget([[maybe_unused]] ITexture* pTex, [[maybe_unused]] const ColorF& color) {};
|
||||
virtual void RT_RenderDebug([[maybe_unused]] bool bRenderStats = true) {};
|
||||
|
||||
virtual HRESULT RT_CreateVertexBuffer([[maybe_unused]] UINT Length, [[maybe_unused]] DWORD Usage, [[maybe_unused]] DWORD FVF, [[maybe_unused]] UINT Pool, [[maybe_unused]] void** ppVertexBuffer, [[maybe_unused]] HANDLE* pSharedHandle) { return S_OK; }
|
||||
virtual HRESULT RT_CreateIndexBuffer([[maybe_unused]] UINT Length, [[maybe_unused]] DWORD Usage, [[maybe_unused]] DWORD Format, [[maybe_unused]] UINT Pool, [[maybe_unused]] void** ppVertexBuffer, [[maybe_unused]] HANDLE* pSharedHandle) { return S_OK; };
|
||||
virtual HRESULT RT_CreateVertexShader([[maybe_unused]] DWORD* pBuf, [[maybe_unused]] void** pShader, [[maybe_unused]] void* pInst) { return S_OK; };
|
||||
virtual HRESULT RT_CreatePixelShader([[maybe_unused]] DWORD* pBuf, [[maybe_unused]] void** pShader) { return S_OK; };
|
||||
virtual void RT_ReleaseVBStream([[maybe_unused]] void* pVB, [[maybe_unused]] int nStream) {};
|
||||
virtual void RT_DrawDynVB([[maybe_unused]] int Pool, [[maybe_unused]] uint32 nVerts) {}
|
||||
virtual void RT_DrawDynVB([[maybe_unused]] SVF_P3F_C4B_T2F* pBuf, [[maybe_unused]] uint16* pInds, [[maybe_unused]] uint32 nVerts, [[maybe_unused]] uint32 nInds, [[maybe_unused]] const PublicRenderPrimitiveType nPrimType) {}
|
||||
virtual void RT_DrawDynVBUI([[maybe_unused]] SVF_P2F_C4B_T2F_F4B* pBuf, [[maybe_unused]] uint16* pInds, [[maybe_unused]] uint32 nVerts, [[maybe_unused]] uint32 nInds, [[maybe_unused]] const PublicRenderPrimitiveType nPrimType) {}
|
||||
virtual void RT_DrawStringU([[maybe_unused]] IFFont_RenderProxy* pFont, [[maybe_unused]] float x, [[maybe_unused]] float y, [[maybe_unused]] float z, [[maybe_unused]] const char* pStr, [[maybe_unused]] bool asciiMultiLine, [[maybe_unused]] const STextDrawContext& ctx) const {}
|
||||
virtual void RT_DrawLines([[maybe_unused]] Vec3 v[], [[maybe_unused]] int nump, [[maybe_unused]] ColorF& col, [[maybe_unused]] int flags, [[maybe_unused]] float fGround) {}
|
||||
virtual void RT_Draw2dImage([[maybe_unused]] float xpos, [[maybe_unused]] float ypos, [[maybe_unused]] float w, [[maybe_unused]] float h, [[maybe_unused]] CTexture* pTexture, [[maybe_unused]] float s0, [[maybe_unused]] float t0, [[maybe_unused]] float s1, [[maybe_unused]] float t1, [[maybe_unused]] float angle, [[maybe_unused]] DWORD col, [[maybe_unused]] float z) {}
|
||||
virtual void RT_Push2dImage([[maybe_unused]] float xpos, [[maybe_unused]] float ypos, [[maybe_unused]] float w, [[maybe_unused]] float h, [[maybe_unused]] CTexture* pTexture, [[maybe_unused]] float s0, [[maybe_unused]] float t0, [[maybe_unused]] float s1, [[maybe_unused]] float t1, [[maybe_unused]] float angle, [[maybe_unused]] DWORD col, [[maybe_unused]] float z, [[maybe_unused]] float stereoDepth) {}
|
||||
virtual void RT_Draw2dImageList() {}
|
||||
virtual void RT_Draw2dImageStretchMode([[maybe_unused]] bool bStretch) {}
|
||||
virtual void RT_DrawImageWithUV([[maybe_unused]] float xpos, [[maybe_unused]] float ypos, [[maybe_unused]] float z, [[maybe_unused]] float w, [[maybe_unused]] float h, [[maybe_unused]] int texture_id, [[maybe_unused]] float* s, [[maybe_unused]] float* t, [[maybe_unused]] DWORD col, [[maybe_unused]] bool filtered = true) {}
|
||||
virtual void EF_ClearTargetsImmediately([[maybe_unused]] uint32 nFlags) {}
|
||||
virtual void EF_ClearTargetsImmediately([[maybe_unused]] uint32 nFlags, [[maybe_unused]] const ColorF& Colors, [[maybe_unused]] float fDepth, [[maybe_unused]] uint8 nStencil) {}
|
||||
virtual void EF_ClearTargetsImmediately([[maybe_unused]] uint32 nFlags, [[maybe_unused]] const ColorF& Colors) {}
|
||||
virtual void EF_ClearTargetsImmediately([[maybe_unused]] uint32 nFlags, [[maybe_unused]] float fDepth, [[maybe_unused]] uint8 nStencil) {}
|
||||
|
||||
virtual void EF_ClearTargetsLater([[maybe_unused]] uint32 nFlags) {}
|
||||
virtual void EF_ClearTargetsLater([[maybe_unused]] uint32 nFlags, [[maybe_unused]] const ColorF& Colors, [[maybe_unused]] float fDepth, [[maybe_unused]] uint8 nStencil) {}
|
||||
virtual void EF_ClearTargetsLater([[maybe_unused]] uint32 nFlags, [[maybe_unused]] const ColorF& Colors) {}
|
||||
virtual void EF_ClearTargetsLater([[maybe_unused]] uint32 nFlags, [[maybe_unused]] float fDepth, [[maybe_unused]] uint8 nStencil) {}
|
||||
|
||||
virtual void RT_PushRenderTarget([[maybe_unused]] int nTarget, [[maybe_unused]] CTexture* pTex, [[maybe_unused]] SDepthTexture* pDS, [[maybe_unused]] int nS) {};
|
||||
virtual void RT_PopRenderTarget([[maybe_unused]] int nTarget) {};
|
||||
virtual void RT_SetViewport([[maybe_unused]] int x, [[maybe_unused]] int y, [[maybe_unused]] int width, [[maybe_unused]] int height, [[maybe_unused]] int id) {}
|
||||
|
||||
virtual void RT_SetRendererCVar([[maybe_unused]] ICVar* pCVar, [[maybe_unused]] const char* pArgText, [[maybe_unused]] const bool bSilentMode = false) {};
|
||||
virtual void SetRendererCVar([[maybe_unused]] ICVar* pCVar, [[maybe_unused]] const char* pArgText, [[maybe_unused]] bool bSilentMode = false) {};
|
||||
|
||||
virtual void SetMatrices(float* pProjMat, float* pViewMat);
|
||||
|
||||
virtual void PushProfileMarker([[maybe_unused]] const char* label) {}
|
||||
virtual void PopProfileMarker([[maybe_unused]] const char* label) {}
|
||||
|
||||
virtual void RT_InsertGpuCallback([[maybe_unused]] uint32 context, [[maybe_unused]] GpuCallbackFunc callback) {}
|
||||
virtual void EnablePipelineProfiler([[maybe_unused]] bool bEnable) {}
|
||||
|
||||
virtual IOpticsElementBase* CreateOptics([[maybe_unused]] EFlareType type) const { return NULL; }
|
||||
|
||||
virtual bool BakeMesh([[maybe_unused]] const SMeshBakingInputParams* pInputParams, [[maybe_unused]] SMeshBakingOutput* pReturnValues) { return false; }
|
||||
virtual PerInstanceConstantBufferPool* GetPerInstanceConstantBufferPoolPointer() override { return nullptr; }
|
||||
|
||||
IDynTexture* CreateDynTexture2(uint32 nWidth, uint32 nHeight, uint32 nTexFlags, const char* szSource, ETexPool eTexPool) override;
|
||||
|
||||
virtual void BeginProfilerSection([[maybe_unused]] const char* name, [[maybe_unused]] uint32 eProfileLabelFlags = 0) override {}
|
||||
virtual void EndProfilerSection([[maybe_unused]] const char* name) override {}
|
||||
virtual void AddProfilerLabel([[maybe_unused]] const char* name) override {}
|
||||
|
||||
#ifdef SUPPORT_HW_MOUSE_CURSOR
|
||||
virtual IHWMouseCursor* GetIHWMouseCursor() { return NULL; }
|
||||
#endif
|
||||
|
||||
virtual void StartLoadtimePlayback([[maybe_unused]] ILoadtimeCallback* pCallback) {}
|
||||
virtual void StopLoadtimePlayback() {}
|
||||
|
||||
// used to track current textures
|
||||
void SetTextureForUnit(int unit, int textureId);
|
||||
|
||||
void RT_DrawVideoRenderer([[maybe_unused]] AZ::VideoRenderer::IVideoRenderer* pVideoRenderer, [[maybe_unused]] const AZ::VideoRenderer::DrawArguments& drawArguments) override {}
|
||||
|
||||
private:
|
||||
static constexpr char LogName[] = "CAtomShimRenderer";
|
||||
|
||||
//! Camera::ActiveCameraSystemRequestBus::Handler overrides...
|
||||
const AZ::Transform& GetActiveCameraTransform() override;
|
||||
const Camera::Configuration& GetActiveCameraConfiguration() override;
|
||||
|
||||
void CacheCameraTransform(const CCamera& camera);
|
||||
void CacheCameraConfiguration(const CCamera& camamera);
|
||||
|
||||
HWND m_hWnd = nullptr; // The main app window
|
||||
|
||||
AZStd::string m_rendererDescription;
|
||||
|
||||
CAtomShimRenderAuxGeom* m_pAtomShimRenderAuxGeom;
|
||||
IColorGradingController* m_pAtomShimColorGradingController;
|
||||
IStereoRenderer* m_pAtomShimStereoRenderer;
|
||||
|
||||
AZ::RHI::Ptr<AZ::RPI::DynamicDrawContext> m_dynamicDraw;
|
||||
|
||||
AZ::RPI::ShaderVariantId m_shaderVariantWrap;
|
||||
AZ::RPI::ShaderVariantId m_shaderVariantClamp;
|
||||
|
||||
// cached input indices for dynamic draw's draw srg
|
||||
AZ::RHI::ShaderInputNameIndex m_imageInputIndex = "m_texture";
|
||||
AZ::RHI::ShaderInputNameIndex m_viewProjInputIndex = "m_worldToProj";
|
||||
|
||||
AZStd::unordered_map<WIN_HWND, AtomShimViewContext*> m_viewContexts;
|
||||
AtomShimViewContext* m_currContext = nullptr;
|
||||
|
||||
int m_renderPipelineNameSuffix = 1;
|
||||
|
||||
AtomShimTexture* m_currentTextureForUnit[32];
|
||||
bool m_clampFlagPerTextureUnit[32];
|
||||
|
||||
int m_currentFontTextureId = -1;
|
||||
|
||||
bool m_isFinalInitializationDone = false;
|
||||
bool m_isInFrame = false; // True when between calls to BeginFrame and EndFrame
|
||||
|
||||
int m_isIn2dModeCounter = 0;
|
||||
|
||||
AZ::Transform m_cameraTransform = AZ::Transform::CreateIdentity();
|
||||
Camera::Configuration m_cameraConfiguration;
|
||||
AZStd::shared_ptr<AZ::RPI::ViewportContext> m_viewportContext;
|
||||
|
||||
static AtomShimTexture* CastITextureToAtomShimTexture(ITexture* texture)
|
||||
{
|
||||
// If GetDevTexture returns a non-null value then this is not an AtomShim texture
|
||||
if (!(texture && !texture->GetDevTexture()))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return static_cast<AtomShimTexture*>(texture);
|
||||
}
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
|
||||
extern CAtomShimRenderer* gcpAtomShim;
|
||||
|
||||
|
||||
|
||||
#endif //NULL_RENDERER
|
||||
@@ -1,162 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "I3DEngine.h"
|
||||
|
||||
//============================================================================
|
||||
|
||||
bool CShader::FXSetTechnique([[maybe_unused]] const CCryNameTSCRC& szName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetPSFloat([[maybe_unused]] const CCryNameR& NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetPSFloat([[maybe_unused]] const char* NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetVSFloat([[maybe_unused]] const CCryNameR& NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetVSFloat([[maybe_unused]] const char* NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetGSFloat([[maybe_unused]] const CCryNameR& NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetGSFloat([[maybe_unused]] const char* NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetCSFloat([[maybe_unused]] const CCryNameR& NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXSetCSFloat([[maybe_unused]] const char* NameParam, [[maybe_unused]] const Vec4* fParams, [[maybe_unused]] int nParams)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool CShader::FXBegin([[maybe_unused]] uint32* uiPassCount, [[maybe_unused]] uint32 nFlags)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXBeginPass([[maybe_unused]] uint32 uiPass)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXEndPass()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXEnd()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CShader::FXCommit([[maybe_unused]] const uint32 nFlags)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//===================================================================================
|
||||
|
||||
FXShaderCache CHWShader::m_ShaderCache;
|
||||
FXShaderCacheNames CHWShader::m_ShaderCacheList;
|
||||
|
||||
void CRenderer::RefreshSystemShaders()
|
||||
{
|
||||
}
|
||||
|
||||
SShaderCache::~SShaderCache()
|
||||
{
|
||||
CHWShader::m_ShaderCache.erase(m_Name);
|
||||
SAFE_DELETE(m_pRes[CACHE_USER]);
|
||||
SAFE_DELETE(m_pRes[CACHE_READONLY]);
|
||||
}
|
||||
|
||||
SShaderCache* CHWShader::mfInitCache([[maybe_unused]] const char* name, [[maybe_unused]] CHWShader* pSH, [[maybe_unused]] bool bCheckValid, [[maybe_unused]] uint32 CRC32, [[maybe_unused]] bool bReadOnly, [[maybe_unused]] bool bAsync)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if !defined(CONSOLE)
|
||||
bool CHWShader::mfOptimiseCacheFile([[maybe_unused]] SShaderCache* pCache, [[maybe_unused]] bool bForce, [[maybe_unused]] SOptimiseStats* Stats)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool CHWShader::PreactivateShaders()
|
||||
{
|
||||
bool bRes = true;
|
||||
return bRes;
|
||||
}
|
||||
void CHWShader::RT_PreactivateShaders()
|
||||
{
|
||||
}
|
||||
|
||||
const char* CHWShader::GetCurrentShaderCombinations([[maybe_unused]] bool bLevel)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
void CHWShader::mfFlushPendedShadersWait([[maybe_unused]] int nMaxAllowed)
|
||||
{
|
||||
}
|
||||
|
||||
void CShaderResources::Rebuild([[maybe_unused]] IShader* pSH, [[maybe_unused]] AzRHI::ConstantBufferUsage usage)
|
||||
{
|
||||
}
|
||||
|
||||
void CShaderResources::CloneConstants([[maybe_unused]] const IRenderShaderResources* pSrc)
|
||||
{
|
||||
}
|
||||
|
||||
void CShaderResources::ReleaseConstants()
|
||||
{
|
||||
}
|
||||
|
||||
void CShaderResources::UpdateConstants([[maybe_unused]] IShader* pSH)
|
||||
{
|
||||
}
|
||||
|
||||
void CShader::mfFlushPendedShaders()
|
||||
{
|
||||
}
|
||||
|
||||
void SShaderCache::Cleanup(void)
|
||||
{
|
||||
}
|
||||
|
||||
void CShaderResources::AdjustForSpec()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,36 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : Implementation of the shadow maps using NULL device specific implementation
|
||||
// shadow map calculations
|
||||
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "../Common/Shadow_Renderer.h"
|
||||
|
||||
#include "I3DEngine.h"
|
||||
|
||||
IDynTexture* CAtomShimRenderer::MakeDynTextureFromShadowBuffer([[maybe_unused]] int nSize, [[maybe_unused]] IDynTexture* pDynTexture)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool CAtomShimRenderer::PrepareDepthMap([[maybe_unused]] ShadowMapFrustum* SMSource, [[maybe_unused]] int nFrustumLOD, [[maybe_unused]] bool bClearPool)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::DrawAllShadowsOnTheScreen()
|
||||
{
|
||||
}
|
||||
@@ -1,190 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : NULL device specific implementation and extensions handling.
|
||||
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
|
||||
#include <AzCore/std/algorithm.h>
|
||||
#include <AzCore/std/string/conversions.h>
|
||||
#include <AzCore/Math/MatrixUtils.h>
|
||||
|
||||
#include <AzFramework/Scene/Scene.h>
|
||||
#include <AzFramework/Scene/SceneSystemBus.h>
|
||||
#include <AzFramework/Windowing/WindowBus.h>
|
||||
|
||||
#include <Atom/RPI.Public/RenderPipeline.h>
|
||||
#include <Atom/RPI.Public/Scene.h>
|
||||
#include <Atom/RHI/RHISystemInterface.h>
|
||||
#include <Atom/RPI.Public/WindowContext.h>
|
||||
#include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
|
||||
#include <Atom/RPI.Public/View.h>
|
||||
#include <Atom/RPI.Public/AuxGeom/AuxGeomFeatureProcessorInterface.h>
|
||||
#include <Atom/RPI.Reflect/Asset/AssetUtils.h>
|
||||
|
||||
bool CAtomShimRenderer::SetGammaDelta(const float fGamma)
|
||||
{
|
||||
m_fDeltaGamma = fGamma;
|
||||
return true;
|
||||
}
|
||||
|
||||
int CAtomShimRenderer::EnumDisplayFormats([[maybe_unused]] SDispFormat* Formats)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CAtomShimRenderer::ChangeResolution([[maybe_unused]] int nNewWidth, [[maybe_unused]] int nNewHeight, [[maybe_unused]] int nNewColDepth, [[maybe_unused]] int nNewRefreshHZ, [[maybe_unused]] bool bFullScreen, [[maybe_unused]] bool bForce)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WIN_HWND CAtomShimRenderer::Init([[maybe_unused]] int x, [[maybe_unused]] int y, int width, int height, [[maybe_unused]] unsigned int cbpp, [[maybe_unused]] int zbpp, [[maybe_unused]] int sbits, [[maybe_unused]] bool fullscreen, [[maybe_unused]] bool isEditor, [[maybe_unused]] WIN_HINSTANCE hinst, WIN_HWND Glhwnd, [[maybe_unused]] bool bReInit, [[maybe_unused]] const SCustomRenderInitArgs* pCustomArgs, [[maybe_unused]] bool bShaderCacheGen)
|
||||
{
|
||||
//=======================================
|
||||
// Add init code here
|
||||
//=======================================
|
||||
|
||||
FX_SetWireframeMode(R_SOLID_MODE);
|
||||
|
||||
m_width = width;
|
||||
m_height = height;
|
||||
m_backbufferWidth = width;
|
||||
m_backbufferHeight = height;
|
||||
m_nativeWidth = width;
|
||||
m_nativeHeight = height;
|
||||
m_Features |= RFT_HW_NVIDIA;
|
||||
|
||||
m_hWnd = (HWND)Glhwnd;
|
||||
|
||||
if (!g_shaderGeneralHeap)
|
||||
{
|
||||
g_shaderGeneralHeap = CryGetIMemoryManager()->CreateGeneralExpandingMemoryHeap(4 * 1024 * 1024, 0, "Shader General");
|
||||
}
|
||||
|
||||
iLog->Log("Init Shaders\n");
|
||||
|
||||
gRenDev->m_cEF.mfInit();
|
||||
EF_Init();
|
||||
|
||||
#if NULL_SYSTEM_TRAIT_INIT_RETURNTHIS
|
||||
return (WIN_HWND)this;//it just get checked against NULL anyway
|
||||
#else
|
||||
return (WIN_HWND)GetDesktopWindow();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
bool CAtomShimRenderer::SetCurrentContext(WIN_HWND hWnd)
|
||||
{
|
||||
auto itr = m_viewContexts.find(hWnd);
|
||||
if (itr == m_viewContexts.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_currContext = itr->second;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CAtomShimRenderer::CreateContext(WIN_HWND hWnd, bool /* bAllowMSAA */, int /* SSX */, int /* SSY */)
|
||||
{
|
||||
if (m_viewContexts.find(hWnd) != m_viewContexts.end())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
AZ::RPI::RenderPipelinePtr renderPipeline = AZ::RPI::RPISystemInterface::Get()->GetRenderPipelineForWindow(hWnd);
|
||||
if (!renderPipeline)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
AtomShimViewContext* pContext = new AtomShimViewContext;
|
||||
pContext->m_hWnd = (HWND)hWnd;
|
||||
pContext->m_width = m_width;
|
||||
pContext->m_height = m_height;
|
||||
pContext->m_isMainViewport = !gEnv->IsEditor();
|
||||
|
||||
pContext->m_renderPipeline = renderPipeline;
|
||||
pContext->m_view = renderPipeline->GetDefaultView();
|
||||
pContext->m_scene = renderPipeline->GetScene();
|
||||
|
||||
m_viewContexts[hWnd] = pContext;
|
||||
m_currContext = pContext;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CAtomShimRenderer::DeleteContext(WIN_HWND hWnd)
|
||||
{
|
||||
// Attempt to find matching context with this window handle
|
||||
auto contextToDeleteIter = m_viewContexts.find(hWnd);
|
||||
|
||||
if (contextToDeleteIter == m_viewContexts.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
AtomShimViewContext* contextToDelete = contextToDeleteIter->second;
|
||||
|
||||
// remove this context from the map of contexts
|
||||
m_viewContexts.erase(contextToDeleteIter);
|
||||
|
||||
|
||||
// If we are deleting the current context then set current context to the first one still in list (if any are left)
|
||||
if (m_currContext == contextToDelete)
|
||||
{
|
||||
if (m_viewContexts.empty())
|
||||
{
|
||||
m_currContext = nullptr;
|
||||
|
||||
m_width = 0;
|
||||
m_height = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currContext = m_viewContexts.begin()->second;
|
||||
|
||||
m_width = m_currContext->m_width;
|
||||
m_height = m_currContext->m_height;
|
||||
}
|
||||
}
|
||||
|
||||
delete contextToDelete;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::MakeMainContextActive()
|
||||
{
|
||||
if (m_viewContexts.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_currContext = m_viewContexts.begin()->second;
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::ShutDown([[maybe_unused]] bool bReInit)
|
||||
{
|
||||
iLog = nullptr;
|
||||
FreeResources(FRR_ALL);
|
||||
FX_PipelineShutdown();
|
||||
}
|
||||
|
||||
void CAtomShimRenderer::ShutDownFast()
|
||||
{
|
||||
FX_PipelineShutdown();
|
||||
}
|
||||
|
||||
@@ -1,363 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
// Description : NULL device specific texture manager implementation.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include <Atom/RHI/Factory.h>
|
||||
#include <Atom/RPI.Public/Image/ImageSystemInterface.h>
|
||||
|
||||
//=================================================================================
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
void CAtomShimRenderer::MakeSprite(IDynTexture*& rTexturePtr, [[maybe_unused]] float _fSpriteDistance, [[maybe_unused]] int nTexSize, [[maybe_unused]] float angle, [[maybe_unused]] float angle2, [[maybe_unused]] IStatObj* pStatObj, [[maybe_unused]] const float fBrightnessMultiplier, [[maybe_unused]] SRendParams& rParms)
|
||||
{
|
||||
rTexturePtr = NULL;
|
||||
}
|
||||
|
||||
int CAtomShimRenderer::GenerateAlphaGlowTexture([[maybe_unused]] float k)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CAtomShimRenderer::EF_SetLightHole([[maybe_unused]] Vec3 vPos, [[maybe_unused]] Vec3 vNormal, [[maybe_unused]] int idTex, [[maybe_unused]] float fScale, [[maybe_unused]] bool bAdditive)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CAtomShimRenderer::EF_PrecacheResource([[maybe_unused]] ITexture* pTP, [[maybe_unused]] float fDist, [[maybe_unused]] float fTimeToReady, [[maybe_unused]] int Flags, [[maybe_unused]] int nUpdateId, [[maybe_unused]] int nCounter)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CTexture::RenderEnvironmentCMHDR([[maybe_unused]] int size, [[maybe_unused]] Vec3& Pos, [[maybe_unused]] TArray<unsigned short>& vecData)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CTexture::Apply([[maybe_unused]] int nTUnit, [[maybe_unused]] int nState, [[maybe_unused]] int nTMatSlot, [[maybe_unused]] int nSUnit, [[maybe_unused]] SResourceView::KeyType nResViewKey, [[maybe_unused]] EHWShaderClass eSHClass)
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(TEXTURE_GET_SYSTEM_COPY_SUPPORT)
|
||||
byte* CTexture::Convert([[maybe_unused]] const byte* pSrc, [[maybe_unused]] int nWidth, [[maybe_unused]] int nHeight, [[maybe_unused]] int nMips, [[maybe_unused]] ETEX_Format eTFSrc, [[maybe_unused]] ETEX_Format eTFDst, [[maybe_unused]] int& nOutSize, [[maybe_unused]] bool bLinear)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
void CTexture::ReleaseDeviceTexture([[maybe_unused]] bool bKeepLastMips, [[maybe_unused]] bool bFromUnload)
|
||||
{
|
||||
}
|
||||
|
||||
bool CTexture::Clear([[maybe_unused]] const ColorF& color)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CTexture::SetTexStates()
|
||||
{
|
||||
STexState s;
|
||||
|
||||
const bool noMipFiltering = m_nMips <= 1 && !(m_nFlags & FT_FORCE_MIPS);
|
||||
s.m_nMinFilter = FILTER_LINEAR;
|
||||
s.m_nMagFilter = FILTER_LINEAR;
|
||||
s.m_nMipFilter = noMipFiltering ? FILTER_NONE : FILTER_LINEAR;
|
||||
|
||||
const int addrMode = (m_nFlags & FT_STATE_CLAMP || m_eTT == eTT_Cube) ? TADDR_CLAMP : TADDR_WRAP;
|
||||
s.SetClampMode(addrMode, addrMode, addrMode);
|
||||
|
||||
m_nDefState = (uint16)CTexture::GetTexState(s);
|
||||
}
|
||||
|
||||
bool CTexture::CreateDeviceTexture([[maybe_unused]] const byte* pData[6])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void* CTexture::CreateDeviceResourceView([[maybe_unused]] const SResourceView& rv)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ETEX_Format CTexture::ClosestFormatSupported(ETEX_Format eTFDst)
|
||||
{
|
||||
return eTFDst;
|
||||
}
|
||||
|
||||
bool CTexture::SetFilterMode(int nFilter)
|
||||
{
|
||||
return s_sDefState.SetFilterMode(nFilter);
|
||||
}
|
||||
|
||||
bool CTexture::CreateRenderTarget([[maybe_unused]] ETEX_Format eTF, [[maybe_unused]] const ColorF& cClear)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CTexture::SetClampingMode(int nAddressU, int nAddressV, int nAddressW)
|
||||
{
|
||||
return s_sDefState.SetClampMode(nAddressU, nAddressV, nAddressW);
|
||||
}
|
||||
|
||||
void CTexture::UpdateTexStates()
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::GenerateCachedShadowMaps()
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::Readback([[maybe_unused]] AZ::u32 subresourceIndex, StagingHook callback)
|
||||
{
|
||||
}
|
||||
|
||||
//======================================================================================
|
||||
|
||||
void SEnvTexture::Release()
|
||||
{
|
||||
}
|
||||
|
||||
void SEnvTexture::RT_SetMatrix(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool SDynTexture::RestoreRT([[maybe_unused]] int nRT, [[maybe_unused]] bool bPop)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture::ClearRT()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture2::ClearRT()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture::SetRT([[maybe_unused]] int nRT, [[maybe_unused]] bool bPush, [[maybe_unused]] SDepthTexture* pDepthSurf, [[maybe_unused]] bool bScreenVP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture2::SetRT([[maybe_unused]] int nRT, [[maybe_unused]] bool bPush, [[maybe_unused]] SDepthTexture* pDepthSurf, [[maybe_unused]] bool bScreenVP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture2::RestoreRT([[maybe_unused]] int nRT, [[maybe_unused]] bool bPop)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture2::SetRectStates()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//===============================================================================
|
||||
|
||||
void STexState::PostCreate()
|
||||
{
|
||||
}
|
||||
|
||||
void STexState::Destroy()
|
||||
{
|
||||
}
|
||||
|
||||
void STexState::Init(const STexState& src)
|
||||
{
|
||||
memcpy(this, &src, sizeof(src));
|
||||
}
|
||||
|
||||
void STexState::SetComparisonFilter([[maybe_unused]] bool bEnable)
|
||||
{
|
||||
}
|
||||
|
||||
bool STexState::SetClampMode(int nAddressU, int nAddressV, int nAddressW)
|
||||
{
|
||||
m_nAddressU = nAddressU;
|
||||
m_nAddressV = nAddressV;
|
||||
m_nAddressW = nAddressW;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool STexState::SetFilterMode([[maybe_unused]] int nFilter)
|
||||
{
|
||||
m_nMinFilter = 0;
|
||||
m_nMagFilter = 0;
|
||||
m_nMipFilter = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void STexState::SetBorderColor(DWORD dwColor)
|
||||
{
|
||||
m_dwBorderColor = dwColor;
|
||||
}
|
||||
|
||||
|
||||
SDepthTexture::~SDepthTexture()
|
||||
{
|
||||
}
|
||||
|
||||
void SDepthTexture::Release([[maybe_unused]] bool bReleaseTex)
|
||||
{
|
||||
}
|
||||
|
||||
ETEX_Format CTexture::TexFormatFromDeviceFormat([[maybe_unused]] D3DFormat nFormat)
|
||||
{
|
||||
return eTF_Unknown;
|
||||
}
|
||||
|
||||
bool CTexture::RT_CreateDeviceTexture([[maybe_unused]] const byte* pData[6])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CTexture::UpdateTextureRegion([[maybe_unused]] const uint8_t* data, [[maybe_unused]] int X, [[maybe_unused]] int Y, [[maybe_unused]] int Z, [[maybe_unused]] int USize, [[maybe_unused]] int VSize, [[maybe_unused]] int ZSize, [[maybe_unused]] ETEX_Format eTFSrc)
|
||||
{
|
||||
}
|
||||
void CTexture::RT_UpdateTextureRegion([[maybe_unused]] const uint8_t* data, [[maybe_unused]] int X, [[maybe_unused]] int Y, [[maybe_unused]] int Z, [[maybe_unused]] int USize, [[maybe_unused]] int VSize, [[maybe_unused]] int ZSize, [[maybe_unused]] ETEX_Format eTFSrc)
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::Unbind()
|
||||
{
|
||||
}
|
||||
|
||||
bool SDynTexture::RT_SetRT([[maybe_unused]] int nRT, [[maybe_unused]] int nWidth, [[maybe_unused]] int nHeight, [[maybe_unused]] bool bPush, [[maybe_unused]] bool bScreenVP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDynTexture::RT_Update([[maybe_unused]] int nNewWidth, [[maybe_unused]] int nNewHeight)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CTexture::ReleaseSystemTargets(void) {}
|
||||
void CTexture::ReleaseMiscTargets(void) {}
|
||||
void CTexture::CreateSystemTargets(void) {}
|
||||
|
||||
//===============================================================================
|
||||
|
||||
namespace TextureHelpers
|
||||
{
|
||||
bool VerifyTexSuffix([[maybe_unused]] EEfResTextures texSlot, [[maybe_unused]] const char* texPath)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VerifyTexSuffix([[maybe_unused]] EEfResTextures texSlot, [[maybe_unused]] const string& texPath)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* LookupTexSuffix([[maybe_unused]] EEfResTextures texSlot)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int8 LookupTexPriority([[maybe_unused]] EEfResTextures texSlot)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
CTexture* LookupTexDefault([[maybe_unused]] EEfResTextures texSlot)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CTexture* LookupTexBlank([[maybe_unused]] EEfResTextures texSlot)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool CTexture::Clear() { return true; }
|
||||
|
||||
uint32 CDeviceTexture::TextureDataSize([[maybe_unused]] uint32 nWidth, [[maybe_unused]] uint32 nHeight, [[maybe_unused]] uint32 nDepth, [[maybe_unused]] uint32 nMips, [[maybe_unused]] uint32 nSlices, [[maybe_unused]] const ETEX_Format eTF)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
AtomShimTexture::~AtomShimTexture()
|
||||
{
|
||||
if(AZ::Data::AssetBus::Handler::BusIsConnected())
|
||||
{
|
||||
AZ::Data::AssetBus::Handler::BusDisconnect();
|
||||
}
|
||||
}
|
||||
|
||||
// Hot-reloading support for the AtomShimTexture.
|
||||
// This only supports OnAssetReady, not OnAssetReloaded, because it is only intended to handle the case where a texture has not been processed or does not exist.
|
||||
// The RPI::StreamingImage will handle re-loading if the file changes after it has been loaded initially
|
||||
void AtomShimTexture::QueueForHotReload(const AZ::Data::AssetId& assetId)
|
||||
{
|
||||
AZ::Data::AssetBus::Handler::BusConnect(assetId);
|
||||
|
||||
// Lyshine may try to load a texture before the ImageSystem wasn't ready
|
||||
if (AZ::RPI::ImageSystemInterface::Get())
|
||||
{
|
||||
CreateFromImage(AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Magenta));
|
||||
}
|
||||
}
|
||||
|
||||
void AtomShimTexture::OnAssetReady(AZ::Data::Asset<AZ::Data::AssetData> asset)
|
||||
{
|
||||
AZ::Data::AssetBus::Handler::BusDisconnect(asset.GetId());
|
||||
|
||||
AZ::Data::Asset<AZ::RPI::StreamingImageAsset> imageAsset = asset;
|
||||
AZ_Assert(imageAsset, "This should be a streaming image asset");
|
||||
|
||||
CreateFromStreamingImageAsset(imageAsset);
|
||||
}
|
||||
|
||||
void AtomShimTexture::CreateFromStreamingImageAsset(const AZ::Data::Asset<AZ::RPI::StreamingImageAsset>& imageAsset)
|
||||
{
|
||||
AZ::Data::Instance<AZ::RPI::Image> image = AZ::RPI::StreamingImage::FindOrCreate(imageAsset);
|
||||
if (!image)
|
||||
{
|
||||
AZ_Error("CAtomShimRenderer", false, "Failed to find or create an image instance from image asset '%s'", imageAsset.GetHint().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
CreateFromImage(image);
|
||||
}
|
||||
|
||||
void AtomShimTexture::CreateFromImage(const AZ::Data::Instance<AZ::RPI::Image>& image)
|
||||
{
|
||||
AZ::RHI::Format rhiViewFormat = AZ::RHI::Format::Unknown;
|
||||
AZ::RHI::ImageViewDescriptor viewDesc = AZ::RHI::ImageViewDescriptor(rhiViewFormat);
|
||||
AZ::RHI::Image* rhiImage = image->GetRHIImage();
|
||||
|
||||
AZ::RHI::Ptr<AZ::RHI::ImageView> imageView = rhiImage->GetImageView(viewDesc);
|
||||
if(!imageView.get())
|
||||
{
|
||||
AZ_Assert(false, "Failed to acquire an image view");
|
||||
return;
|
||||
}
|
||||
|
||||
m_instance = image;
|
||||
m_image = rhiImage;
|
||||
m_imageView = imageView;
|
||||
|
||||
SetWidth(rhiImage->GetDescriptor().m_size.m_width);
|
||||
SetHeight(rhiImage->GetDescriptor().m_size.m_height);
|
||||
}
|
||||
|
||||
@@ -1,98 +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.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CryRenderOther_precompiled.h"
|
||||
#include "AtomShim_Renderer.h"
|
||||
#include "../Common/Textures/TextureStreamPool.h"
|
||||
|
||||
//===============================================================================
|
||||
|
||||
bool STexPoolItem::IsStillUsedByGPU([[maybe_unused]] uint32 nCurTick)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
STexPoolItem::~STexPoolItem()
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::InitStreamingDev()
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::StreamExpandMip([[maybe_unused]] const void* pRawData, [[maybe_unused]] int nMip, [[maybe_unused]] int nBaseMipOffset, [[maybe_unused]] int nSideDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::StreamCopyMipsTexToTex([[maybe_unused]] STexPoolItem* pSrcItem, [[maybe_unused]] int nMipSrc, [[maybe_unused]] STexPoolItem* pDestItem, [[maybe_unused]] int nMipDest, [[maybe_unused]] int nNumMips)
|
||||
{
|
||||
}
|
||||
|
||||
bool CTexture::StreamPrepare_Platform()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int CTexture::StreamTrim([[maybe_unused]] int nToMip)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Just remove item from the texture object and keep Item in Pool list for future use
|
||||
// This function doesn't release API texture
|
||||
void CTexture::StreamRemoveFromPool()
|
||||
{
|
||||
}
|
||||
|
||||
void CTexture::StreamCopyMipsTexToMem([[maybe_unused]] int nStartMip, [[maybe_unused]] int nEndMip, [[maybe_unused]] bool bToDevice, [[maybe_unused]] STexPoolItem* pNewPoolItem)
|
||||
{
|
||||
}
|
||||
|
||||
STexPoolItem* CTexture::StreamGetPoolItem([[maybe_unused]] int nStartMip, [[maybe_unused]] int nMips, [[maybe_unused]] bool bShouldBeCreated, [[maybe_unused]] bool bCreateFromMipData, [[maybe_unused]] bool bCanCreate, [[maybe_unused]] bool bForStreamOut)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CTexture::StreamAssignPoolItem([[maybe_unused]] STexPoolItem* pItem, [[maybe_unused]] int nMinMip)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
CTextureStreamPoolMgr::CTextureStreamPoolMgr()
|
||||
{
|
||||
}
|
||||
|
||||
CTextureStreamPoolMgr::~CTextureStreamPoolMgr()
|
||||
{
|
||||
}
|
||||
|
||||
void CTextureStreamPoolMgr::Flush()
|
||||
{
|
||||
}
|
||||
|
||||
STexPoolItem* CTextureStreamPoolMgr::GetPoolItem([[maybe_unused]] int nWidth, [[maybe_unused]] int nHeight, [[maybe_unused]] int nArraySize, [[maybe_unused]] int nMips, [[maybe_unused]] ETEX_Format eTF, [[maybe_unused]] bool bIsSRGB, [[maybe_unused]] ETEX_Type eTT, [[maybe_unused]] bool bShouldBeCreated, [[maybe_unused]] const char* sName, [[maybe_unused]] STextureInfo* pTI, [[maybe_unused]] bool bCanCreate, [[maybe_unused]] bool bWaitForIdle)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CTextureStreamPoolMgr::ReleaseItem([[maybe_unused]] STexPoolItem* pItem)
|
||||
{
|
||||
}
|
||||
|
||||
void CTextureStreamPoolMgr::GarbageCollect([[maybe_unused]] size_t* nCurTexPoolSize, [[maybe_unused]] size_t nLowerPoolLimit, [[maybe_unused]] int nMaxItemsToFree)
|
||||
{
|
||||
}
|
||||
|
||||
void CTextureStreamPoolMgr::GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer)
|
||||
{
|
||||
}
|
||||
@@ -1,45 +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.
|
||||
#
|
||||
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME})
|
||||
|
||||
include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) # For PAL_TRAIT_ATOM_CRYRENDEROTHER_SUPPORTED
|
||||
|
||||
if(NOT PAL_TRAIT_ATOM_CRYRENDEROTHER_SUPPORTED)
|
||||
return()
|
||||
endif()
|
||||
|
||||
ly_add_target(
|
||||
NAME CryRenderOther ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}
|
||||
NAMESPACE Legacy
|
||||
FILES_CMAKE
|
||||
atom_shim_renderer_files.cmake
|
||||
${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
PLATFORM_INCLUDE_FILES
|
||||
${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PRIVATE
|
||||
.
|
||||
PCH
|
||||
BUILD_DEPENDENCIES
|
||||
PUBLIC
|
||||
AZ::AzCore
|
||||
Legacy::CryCommon
|
||||
Legacy::CryRender.Headers
|
||||
Legacy::CryRenderNULL.Static
|
||||
AZ::AtomCore
|
||||
Gem::Atom_RHI.Reflect
|
||||
Gem::Atom_RPI.Public
|
||||
)
|
||||
|
||||
# Atom_AtomBridge.Static is the one that drives loading CryRenderOther, however, CryRenderOther
|
||||
# is not enabled in every platform, so we define the dependency here
|
||||
ly_add_dependencies(Atom_AtomBridge.Static CryRenderOther)
|
||||
@@ -1,111 +0,0 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Russian resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
|
||||
#pragma code_page(1251)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Russian resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// German (Germany) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "000904b0"
|
||||
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 "ProductVersion", "1, 0, 0, 1"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x9, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // German (Germany) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -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 <Common/RendererDefs.h>
|
||||
|
||||
#include <Cry_Math.h>
|
||||
#include <Cry_Geo.h>
|
||||
#include <StlUtils.h>
|
||||
#include "Common/DevBuffer.h"
|
||||
|
||||
#include "XRenderD3D9/DeviceManager/DeviceManager.h"
|
||||
|
||||
#include <VertexFormats.h>
|
||||
|
||||
#include "Common/CommonRender.h"
|
||||
#include <IRenderAuxGeom.h>
|
||||
#include "Common/Shaders/ShaderComponents.h"
|
||||
#include "Common/Shaders/Shader.h"
|
||||
#include "Common/Shaders/CShader.h"
|
||||
#include "Common/RenderMesh.h"
|
||||
#include "Common/RenderPipeline.h"
|
||||
#include "Common/RenderThread.h"
|
||||
|
||||
#include "Common/Renderer.h"
|
||||
#include "Common/Textures/Texture.h"
|
||||
|
||||
#include "Common/OcclQuery.h"
|
||||
|
||||
#include "Common/PostProcess/PostProcess.h"
|
||||
|
||||
// All handled render elements (except common ones included in "RendElement.h")
|
||||
#include "Common/RendElements/CREBeam.h"
|
||||
#include "Common/RendElements/CREClientPoly.h"
|
||||
#include "Common/RendElements/CRELensOptics.h"
|
||||
#include "Common/RendElements/CREHDRProcess.h"
|
||||
#include "Common/RendElements/CRECloud.h"
|
||||
#include "Common/RendElements/CREDeferredShading.h"
|
||||
#include "Common/RendElements/CREMeshImpl.h"
|
||||
@@ -1,12 +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.
|
||||
#
|
||||
|
||||
set(PAL_TRAIT_ATOM_CRYRENDEROTHER_SUPPORTED TRUE)
|
||||
@@ -1,11 +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.
|
||||
#
|
||||
|
||||
-14
@@ -1,14 +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.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/Unimplemented/AtomShim_Renderer_Unimplemented.cpp
|
||||
)
|
||||
@@ -1,12 +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.
|
||||
#
|
||||
|
||||
set(PAL_TRAIT_ATOM_CRYRENDEROTHER_SUPPORTED TRUE)
|
||||
@@ -1,11 +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.
|
||||
#
|
||||
|
||||
@@ -1,14 +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.
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/Unimplemented/AtomShim_Renderer_Unimplemented.cpp
|
||||
)
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or
|
||||
* a third party where indicated.
|
||||
*
|
||||
* 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 "CryRenderOther_precompiled.h"
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
bool UIDeviceIsTablet()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UIKitGetPrimaryPhysicalDisplayDimensions(int& o_widthPixels, int& o_heightPixels)
|
||||
{
|
||||
NSScreen* nativeScreen = [NSScreen mainScreen];
|
||||
CGRect screenBounds = [nativeScreen frame];
|
||||
CGFloat screenScale = [nativeScreen backingScaleFactor];
|
||||
o_widthPixels = static_cast<int>(screenBounds.size.width * screenScale);
|
||||
o_heightPixels = static_cast<int>(screenBounds.size.height * screenScale);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +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.
|
||||
#
|
||||
|
||||
set(PAL_TRAIT_ATOM_CRYRENDEROTHER_SUPPORTED TRUE)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user