/* * 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 #include #include namespace AtomSampleViewer { void StacksShaderInputFunctorSourceData::Reflect(AZ::ReflectContext* context) { if (auto* serializeContext = azrtti_cast(context)) { serializeContext->Class() ->Version(2) ; } } AZ::RPI::MaterialFunctorSourceData::FunctorResult StacksShaderInputFunctorSourceData::CreateFunctor(const RuntimeContext& context) const { AZ::RPI::Ptr functor = aznew StacksShaderInputFunctor; functor->m_azimuthDegreesIndex = context.FindMaterialPropertyIndex(AZ::Name{ "light.azimuthDegrees" }); functor->m_elevationDegreesIndex = context.FindMaterialPropertyIndex(AZ::Name{ "light.elevationDegrees" }); AddMaterialPropertyDependency(functor, functor->m_azimuthDegreesIndex); AddMaterialPropertyDependency(functor, functor->m_elevationDegreesIndex); functor->m_lightDirectionIndex = context.GetShaderResourceGroupLayout()->FindShaderInputConstantIndex(AZ::Name{ "m_lightDir" }); return AZ::Success(AZ::RPI::Ptr(functor)); } }