RayTracingIntersectionShaderExampleComponent.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Component/Component.h>
  10. #include <CommonSampleComponentBase.h>
  11. #include <Utils/Utils.h>
  12. namespace AtomSampleViewer
  13. {
  14. //! This test checks the functionality of ray tracing intersection shaders for procedural geometry by generating the following scene:
  15. //! - A horizontal plane with mirror material
  16. //! - A number of sphere and box shapes (from the DebugDraw gem) with enabled ray tracing setting
  17. //! - A SpecularReflections level component with "Ray tracing" reflection method
  18. //! The DebugDraw gem supplies the intersection shaders for the sphere and box shapes and adds them to the ray tracing scene. The shapes
  19. //! are therefore visible as ray-traced reflections in the mirror plane.
  20. class RayTracingIntersectionShaderExampleComponent final : public CommonSampleComponentBase
  21. {
  22. public:
  23. AZ_COMPONENT(RayTracingIntersectionShaderExampleComponent, "{e231a794-4d77-4754-b2bd-c102e1fe51db}", AZ::Component);
  24. AZ_DISABLE_COPY_MOVE(RayTracingIntersectionShaderExampleComponent);
  25. static void Reflect(AZ::ReflectContext* context);
  26. RayTracingIntersectionShaderExampleComponent() = default;
  27. protected:
  28. // AZ::Component overrides
  29. void Activate() override;
  30. void Deactivate() override;
  31. private:
  32. AZ::Data::Asset<AZ::RPI::ModelAsset> m_mirrorplaneModelAsset;
  33. AZ::Data::Asset<AZ::RPI::MaterialAsset> m_mirrorMaterialAsset;
  34. AZ::Data::Instance<AZ::RPI::Material> m_mirrorMaterialInstance;
  35. AZ::Render::MeshFeatureProcessorInterface::MeshHandle m_mirrorplaneMeshHandle;
  36. Utils::DefaultIBL m_defaultIbl;
  37. AZStd::vector<AZ::Entity*> m_entities;
  38. };
  39. } // namespace AtomSampleViewer