RayTracingClosestHitSolid.azsl 742 B

12345678910111213141516171819
  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. #include <Atom/Features/SrgSemantics.azsli>
  9. #include "RayTracingCommon.azsli"
  10. // hit shader that lerps between two colors
  11. [shader("closesthit")]
  12. void ClosestHitSolidShader(inout RayPayload payload, BuiltInTriangleIntersectionAttributes attr)
  13. {
  14. payload.color = smoothstep(RayTracingGlobalSrg::m_hitSolidData[InstanceID()].m_color1,
  15. RayTracingGlobalSrg::m_hitSolidData[InstanceID()].m_color2,
  16. RayTracingGlobalSrg::m_hitSolidData[InstanceID()].m_lerp);
  17. }