Files
UnrealEngineUWP/Engine/Shaders/Private/VertexFactoryDefaultInterface.ush
jamie hayes 1759d9a716 - Add the ability for specialized scene proxies to add extensible data to the payload of their instances, and change spline meshes to utilize this new mechanism.
- Some refactoring of LocalVertexFactory shader code to accommodate new spline mesh changes as well as to clean it up a little.
- Split primitive flags in the GPU Scene primitive data relating to visibility out into its own to facilitate adding another flag that wouldn't fit into a single DWORD.

#rb ola.olsson

[CL 25853575 by jamie hayes in ue5-main branch]
2023-06-07 15:16:07 -04:00

69 lines
2.1 KiB
Plaintext

// Copyright Epic Games, Inc. All Rights Reserved.
// Note: include at the end of vertex factories to provide default/dummy implementation of factory functions that are not supported OR that follow the standard pattern
// E.g., if the VF implements the three flavours of VertexFactoryGetViewIndex, it should define VF_IMPLEMENTED_GET_VIEW_INDEX
#ifndef VF_IMPLEMENTED_GET_SCENE_DATA_INTERMEDIATES
#define VF_IMPLEMENTED_GET_SCENE_DATA_INTERMEDIATES
FSceneDataIntermediates GetSceneDataIntermediates(FVertexFactoryIntermediates Intermediates)
{
return Intermediates.SceneData;
}
#endif
#ifndef VF_IMPLEMENTED_GET_VIEW_INDEX
#define VF_IMPLEMENTED_GET_VIEW_INDEX
uint VertexFactoryGetViewIndex(FVertexFactoryIntermediates Intermediates)
{
return GetSceneDataIntermediates(Intermediates).ViewIndex;
}
uint VertexFactoryGetInstanceIdLoadIndex(FVertexFactoryIntermediates Intermediates)
{
return GetSceneDataIntermediates(Intermediates).InstanceIdLoadIndex;
}
FLWCMatrix VertexFactoryGetLocalToWorld(FVertexFactoryIntermediates Intermediates)
{
return GetSceneDataIntermediates(Intermediates).InstanceData.LocalToWorld;
}
FLWCInverseMatrix VertexFactoryGetWorldToLocal(FVertexFactoryIntermediates Intermediates)
{
return GetSceneDataIntermediates(Intermediates).InstanceData.WorldToLocal;
}
#if POSITION_ONLY
uint VertexFactoryGetViewIndex(FPositionOnlyVertexFactoryInput Input)
{
FSceneDataIntermediates SceneData = VF_GPUSCENE_GET_INTERMEDIATES(Input);
return SceneData.ViewIndex;
}
uint VertexFactoryGetViewIndex(FPositionAndNormalOnlyVertexFactoryInput Input)
{
FSceneDataIntermediates SceneData = VF_GPUSCENE_GET_INTERMEDIATES(Input);
return SceneData.ViewIndex;
}
uint VertexFactoryGetInstanceIdLoadIndex(FPositionOnlyVertexFactoryInput Input)
{
FSceneDataIntermediates SceneData = VF_GPUSCENE_GET_INTERMEDIATES(Input);
return SceneData.InstanceIdLoadIndex;
}
uint VertexFactoryGetInstanceIdLoadIndex(FPositionAndNormalOnlyVertexFactoryInput Input)
{
FSceneDataIntermediates SceneData = VF_GPUSCENE_GET_INTERMEDIATES(Input);
return SceneData.InstanceIdLoadIndex;
}
#endif // POSITION_ONLY
#endif // VF_IMPLEMENTED_GET_VIEW_INDEX