Browse Source

Removes LuxCore (#306)

* Removes LuxCore

Signed-off-by: Esteban Papp <[email protected]>

* addresses PR comments

Signed-off-by: Esteban Papp <[email protected]>
Esteban Papp 3 years ago
parent
commit
b7caf4f581

+ 0 - 2
Gem/Code/Source/SampleComponentManager.cpp

@@ -87,7 +87,6 @@
 #include <MultiSceneExampleComponent.h>
 #include <ParallaxMappingExampleComponent.h>
 #include <SceneReloadSoakTestComponent.h>
-#include <ShadingExampleComponent.h>
 #include <ShadowExampleComponent.h>
 #include <ShadowedSponzaExampleComponent.h>
 #include <SkinnedMeshExampleComponent.h>
@@ -274,7 +273,6 @@ namespace AtomSampleViewer
             NewRPISample<MultiViewSingleSceneAuxGeomExampleComponent>("MultiViewSingleSceneAuxGeom"),
             NewRPISample<RootConstantsExampleComponent>("RootConstants"),
             NewRPISample<SceneReloadSoakTestComponent>("SceneReloadSoakTest"),
-            NewRPISample<ShadingExampleComponent>("Shading"),
             NewRPISample<StreamingImageExampleComponent>("StreamingImage"),
             NewRPISample<ShaderReloadTestComponent>("ShaderReloadTest"),
             NewFeaturesSample<AreaLightExampleComponent>("AreaLight"),

+ 0 - 175
Gem/Code/Source/ShadingExampleComponent.cpp

@@ -1,175 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include <ShadingExampleComponent.h>
-
-#include <Atom/Component/DebugCamera/ArcBallControllerComponent.h>
-#include <Atom/Component/DebugCamera/NoClipControllerComponent.h>
-
-#include <Atom/Feature/LuxCore/LuxCoreBus.h>
-
-#include <Atom/RPI.Public/View.h>
-#include <Atom/RPI.Public/Image/StreamingImage.h>
-
-#include <Atom/RPI.Reflect/Asset/AssetUtils.h>
-#include <Atom/RPI.Reflect/Model/ModelAsset.h>
-#include <Atom/RPI.Reflect/Material/MaterialAsset.h>
-
-#include <AzFramework/Input/Devices/Keyboard/InputDeviceKeyboard.h>
-
-#include <SampleComponentManager.h>
-#include <SampleComponentConfig.h>
-
-#include <RHI/BasicRHIComponent.h>
-
-namespace AtomSampleViewer
-{
-    const char* ShadingExampleComponent::CameraControllerNameTable[CameraControllerCount] =
-    {
-        "ArcBall",
-        "NoClip"
-    };
-
-    void ShadingExampleComponent::Reflect(AZ::ReflectContext* context)
-    {
-        if (AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
-        {
-            serializeContext->Class < ShadingExampleComponent, AZ::Component>()
-                ->Version(0)
-                ;
-        }
-    }
-
-    ShadingExampleComponent::ShadingExampleComponent()
-    {
-    }
-
-    void ShadingExampleComponent::Activate()
-    {
-        AZ::RPI::AssetUtils::TraceLevel traceLevel = AZ::RPI::AssetUtils::TraceLevel::Assert;
-        auto meshAsset = AZ::RPI::AssetUtils::GetAssetByProductPath<AZ::RPI::ModelAsset>("objects/shaderball_simple.azmodel", traceLevel);
-        auto materialAsset = AZ::RPI::AssetUtils::GetAssetByProductPath<AZ::RPI::MaterialAsset>(DefaultPbrMaterialPath, traceLevel);
-        m_meshHandle = GetMeshFeatureProcessor()->AcquireMesh(AZ::Render::MeshHandleDescriptor{ meshAsset }, AZ::RPI::Material::FindOrCreate(materialAsset));
-        GetMeshFeatureProcessor()->SetTransform(m_meshHandle, AZ::Transform::CreateIdentity());
-
-        UseArcBallCameraController();
-
-        // Add an Image based light.
-        m_defaultIbl.Init(m_scene);
-
-        // Load default IBL texture asset for LuxCore
-        // We should be able to extract this information from SkyBox in the future
-        LoadIBLImage("textures/sampleenvironment/example_iblskyboxcm.dds.streamingimage");
-
-        AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::SetCameraEntityID, GetCameraEntityId());
-        AzFramework::InputChannelEventListener::Connect();
-        AZ::TickBus::Handler::BusConnect();
-    }
-
-    void ShadingExampleComponent::Deactivate()
-    {
-        RemoveController();
-        m_defaultIbl.Reset();
-        GetMeshFeatureProcessor()->ReleaseMesh(m_meshHandle);
-
-        AzFramework::InputChannelEventListener::Disconnect();
-        AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::ClearLuxCore);
-        AZ::TickBus::Handler::BusDisconnect();
-    }
-
-    void ShadingExampleComponent::UseArcBallCameraController()
-    {
-        AZ::Debug::CameraControllerRequestBus::Event(GetCameraEntityId(), &AZ::Debug::CameraControllerRequestBus::Events::Enable,
-            azrtti_typeid<AZ::Debug::ArcBallControllerComponent>());
-    }
-
-    void ShadingExampleComponent::UseNoClipCameraController()
-    {
-        AZ::Debug::CameraControllerRequestBus::Event(GetCameraEntityId(), &AZ::Debug::CameraControllerRequestBus::Events::Enable,
-            azrtti_typeid<AZ::Debug::NoClipControllerComponent>());
-    }
-
-    void ShadingExampleComponent::LoadIBLImage(const char* imagePath)
-    {
-        auto imageAsset = AZ::RPI::AssetUtils::GetAssetByProductPath<AZ::RPI::StreamingImageAsset>
-            (imagePath, AZ::RPI::AssetUtils::TraceLevel::Assert);
-
-        // FindOrCreate will synchronously load the image if necessary.
-        IBLImage = AZ::RPI::StreamingImage::FindOrCreate(imageAsset);
-        AZ_Assert(IBLImage != nullptr, "Failed to find or create an image instance from image asset");
-    }
-
-    bool ShadingExampleComponent::OnInputChannelEventFiltered(const AzFramework::InputChannel& inputChannel)
-    {
-        const AzFramework::InputChannelId& inputChannelId = inputChannel.GetInputChannelId();
-        switch (inputChannel.GetState())
-        {
-            case AzFramework::InputChannel::State::Ended:
-            {
-                // L key pressed
-                if (inputChannelId == AzFramework::InputDeviceKeyboard::Key::AlphanumericL)
-                {
-                    if (!m_renderSent)
-                    {
-                        m_renderSent = true;
-                    }
-                }
-            }
-            default:
-            {
-                break;
-            }
-        }
-        return false;
-    }
-    
-    void ShadingExampleComponent::RemoveController()
-    {
-
-    }
-
-    void ShadingExampleComponent::SetArcBallControllerParams()
-    {
-
-    }
-
-    void ShadingExampleComponent::OnTick(float deltaTime, AZ::ScriptTimePoint time)
-    {
-        AZ_UNUSED(deltaTime);
-        AZ_UNUSED(time);
-        
-        if (m_renderSent)
-        {
-            if (!m_dataLoaded)
-            {
-                AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::ClearLuxCore);
-
-                AZ::Data::Asset<AZ::RPI::ModelAsset> modelAsset = GetMeshFeatureProcessor()->GetModel(m_meshHandle)->GetModelAsset();
-                AZ::Data::Instance<AZ::RPI::Material> materialInstance = GetMeshFeatureProcessor()->GetMaterialAssignmentMap(m_meshHandle).at(AZ::Render::DefaultMaterialAssignmentId).m_materialInstance;
-
-                AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::AddMesh, modelAsset);
-                AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::AddMaterial, materialInstance);
-                AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::AddObject, modelAsset, materialInstance->GetId());
-
-                AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::AddTexture, IBLImage, AZ::Render::LuxCoreTextureType::IBL);
-
-                m_dataLoaded = true;
-            }
-
-            // wait till texture ready
-            AZ::Render::LuxCoreRequestsBus::BroadcastResult(m_textureReady, &AZ::Render::LuxCoreRequestsBus::Events::CheckTextureStatus);
-            if (m_textureReady)
-            {
-                AZ::Render::LuxCoreRequestsBus::Broadcast(&AZ::Render::LuxCoreRequestsBus::Events::RenderInLuxCore);
-
-                m_renderSent = false;
-                m_dataLoaded = false;
-            }
-        }
-    }
-}

+ 0 - 87
Gem/Code/Source/ShadingExampleComponent.h

@@ -1,87 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#pragma once
-
-#include <CommonSampleComponentBase.h>
-
-#include <AzCore/Component/EntityBus.h>
-#include <AzCore/Component/TickBus.h>
-
-#include <AzFramework/Input/Events/InputChannelEventListener.h>
-
-#include <Utils/Utils.h>
-
-namespace AtomSampleViewer
-{
-    //!
-    //! This component creates a simple scene to test Atom's shading model.
-    //! On Windows, by pressing 'L' it will launch luxcoreui.exe for PBR validation.
-    //!
-    class ShadingExampleComponent final
-        : public CommonSampleComponentBase
-        , public AzFramework::InputChannelEventListener
-        , public AZ::TickBus::Handler
-    {
-    public:
-        AZ_COMPONENT(ShadingExampleComponent, "{91ED709C-1114-46E3-823C-C0B59FB8E4B6}", CommonSampleComponentBase);
-
-        static void Reflect(AZ::ReflectContext* context);
-
-        ShadingExampleComponent();
-        ~ShadingExampleComponent() override = default;
-
-        void Activate() override;
-        void Deactivate() override;
-
-    private:
-        
-        // AzFramework::InputChannelEventListener
-        bool OnInputChannelEventFiltered(const AzFramework::InputChannel& inputChannel) override;
-
-        // TickBus::Handler
-        void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
-
-        void UseArcBallCameraController();
-        void UseNoClipCameraController();
-        void RemoveController();
-
-        void SetArcBallControllerParams();
-
-        void LoadIBLImage(const char* imagePath);
-
-        enum class CameraControllerType : int32_t
-        {
-            ArcBall = 0,
-            NoClip,
-            Count
-        };
-
-        static const uint32_t CameraControllerCount = static_cast<uint32_t>(CameraControllerType::Count);
-        static const char* CameraControllerNameTable[CameraControllerCount];
-        CameraControllerType m_currentCameraControllerType = CameraControllerType::ArcBall;
-
-        // Owned by this sample
-        AZ::Render::MeshFeatureProcessorInterface::MeshHandle m_meshHandle;
-
-        // Not owned by this sample, we look this up
-        AZ::Component* m_cameraControlComponent = nullptr;
-        Utils::DefaultIBL m_defaultIbl;
-
-        static constexpr float m_arcballRadiusMinModifier = 0.01f;
-        static constexpr float m_arcballRadiusMaxModifier = 2.0f;
-
-        bool m_cameraControllerDisabled = false;
-
-        bool m_renderSent = false;
-        bool m_dataLoaded = false;
-        bool m_textureReady = false;
-        AZ::Data::Instance<AZ::RPI::Image> IBLImage;
-
-    };
-} // namespace AtomSampleViewer

+ 0 - 2
Gem/Code/atomsampleviewergem_private_files.cmake

@@ -149,8 +149,6 @@ set(FILES
     Source/RootConstantsExampleComponent.cpp
     Source/SceneReloadSoakTestComponent.cpp
     Source/SceneReloadSoakTestComponent.h
-    Source/ShadingExampleComponent.cpp
-    Source/ShadingExampleComponent.h
     Source/ShadowExampleComponent.cpp
     Source/ShadowExampleComponent.h
     Source/ShadowedSponzaExampleComponent.cpp

+ 0 - 4
Passes/ASV/PassTemplates.azasset

@@ -48,10 +48,6 @@
                 "Name": "ColorInvertCS",
                 "Path": "Passes/ColorInvertCS.pass"
             },
-            {
-                "Name": "LuxCoreTexturePassTemplate",
-                "Path": "Passes/LuxCoreTexture.pass"
-            },
             {
                 "Name": "RenderTextureTemplate",
                 "Path": "Passes/RenderTexture.pass"

+ 0 - 11
Passes/LuxCoreTexture.pass

@@ -1,11 +0,0 @@
-{
-    "Type": "JsonSerialization",
-    "Version": 1,
-    "ClassName": "PassAsset",
-    "ClassData": {
-        "PassTemplate": {
-            "Name": "LuxCoreTexturePassTemplate",
-            "PassClass": "LuxCoreTexturePass"
-        }
-    }
-}

+ 1 - 7
Passes/RenderTexture.pass

@@ -34,13 +34,7 @@
                         "Attachment": "RenderTargetAttachment"
                     }
                 }
-            ],
-            "PassData": {
-                "$type": "FullscreenTrianglePassData",
-                "ShaderAsset": {
-                    "FilePath": "Shaders/LuxCore/RenderTexture.shader"
-                }
-            }
+            ]
         }
     }
 }

+ 0 - 2
Scripts/_FullTestSuite_.bv.lua

@@ -62,7 +62,6 @@ tests= {
     RunScriptWrapper('scripts/multiscene.bv.luac'),
     RunScriptWrapper('scripts/shadowtest.bv.luac'),
     RunScriptWrapper('scripts/shadowedsponzatest.bv.luac'),
-    RunScriptWrapper('scripts/PassTree.bv.luac'),
 
     --Fast checking for the samples which don't have a test. Samples should be removed from this list once they have their own tests
 
@@ -95,7 +94,6 @@ tests= {
     FastCheckSample('RPI/SponzaBenchmark'),
     FastCheckSample('RPI/MultiViewSingleSceneAuxGeom'),
     FastCheckSample('RPI/RootConstants'),
-    FastCheckSample('RPI/Shading'),
 
     FastCheckSample('Features/Bloom'),
     FastCheckSample('Features/DepthOfField'),

+ 0 - 1
atomsampleviewer_asset_files.cmake

@@ -18,7 +18,6 @@ set(FILES
     Passes/ComplexPipeline.pass
     Passes/ImGuiNoInput.pass
     Passes/ImGuiOnlyPipeline.pass
-    Passes/LuxCoreTexture.pass
     Passes/Monochrome.pass
     Passes/RayTracingAmbientOcclusion.pass
     Passes/RenderTexture.pass