Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

The Pass Interpolants can use :

TEXCOORD6 - TEXCOORD9.
It is responsible for things such as :
- Static lighting colors and coordinates
- WorldPosition, ScreenPosition
PassVertexShader
{
FVertexFactoryIntermediates VFIntermediates = GetVertexFactoryIntermedia
tes(Input);
FMaterialVertexParameters VertexParameters = GetMaterialVertexParameters(Inp
ut, VFIntermediates);
FactoryInterpolants = VertexFactoryGetInterpolants( Input, VFIntermediat
es, VertexParameters);
float4 WorldPosition = VertexParameters.TranslatedWorldPosition;
ISOLATE
{
WorldPosition.xyz += GetMaterialWorldPositionOffset(VertexParameters
);
}
Position = MulMatrix(ViewProjectionMatrix,WorldPosition);
// ...
}
//******************************************************************************
*****************************
//*********************************************** CONSTANTS & UTILITIES ********
*****************************
//******************************************************************************
*****************************
//******************************************************************************
*****************************
//*********************************************** VERTEX SHADER INPUTS *********
*****************************
//******************************************************************************
*****************************
struct FVertexFactoryInput;
//******************************************************************************
*****************************
//*********************************************** VERTEX SHADER INTERMEDIATES **
*****************************
//******************************************************************************
*****************************
struct FVertexFactoryIntermediates;
FVertexFactoryIntermediates GetVertexFactoryIntermediates(FVertexFactoryInput In
put);
//******************************************************************************
*****************************
//*********************************************** VERTEX SHADER PARAMETERS *****
*****************************
//******************************************************************************
*****************************

FMaterialVertexParameters GetMaterialVertexParameters(FVertexFactoryInput Input,


FVertexFactoryIntermediates Intermediates);
// Optional!!!
float4 VertexFactoryGetWorldPosition(FPositionOnlyVertexFactoryInput Input);
#if NEEDS_TANGENT_COORDS // This is used when computing lighting in tangent spac
e.
float3 VertexFactoryWorldToTangentSpace(FVertexFactoryInput Input, FVertexFactor
yIntermediates Intermediates, float3 WorldVector);
#endif
// This is used to get data from the previous position.
FMaterialVertexParameters GetMaterialPreviousVertexParameters(FVertexFactoryInpu
t Input, FVertexFactoryIntermediates Intermediates, FMaterialVertexParameters Ve
rtexParameters );
//******************************************************************************
*****************************
//*********************************************** INTERPOLANTS *****************
*****************************
//******************************************************************************
*****************************
struct FVertexFactoryInterpolants
{
#if NEEDS_TANGENT_COORDS
// This is required in order to better share the interpolants between the re
nder pass and the vertex factory.
// NEEDS_TANGENT_COORDS will not be defined with NEEDS_WORLD_COORDS (which m
ay requires to store the tangent basis instead).
// The setup is made so that we only have to compute the WorldToTangent matr
ix per pixel or per vertex, but not both.
float3 TangentCameraVector;
#endif
}
FVertexFactoryInterpolants VertexFactoryGetInterpolants(FVertexFactoryInput Inpu
t, FVertexFactoryIntermediates Intermediates, FMaterialVertexParameters VertexPa
rameters)
//******************************************************************************
*****************************
//*********************************************** PIXEL SHADER PARAMETERS ******
*****************************
//******************************************************************************
*****************************
FMaterialPixelParameters GetMaterialPixelParameters(Interpolants);

You might also like