utkutuzcu/tst / Engine /Shaders /SpeedTreeBranchVertexFactory.usf
utkutuzcu's picture
download
raw
2.94 kB
/*=============================================================================
Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
=============================================================================*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// struct FVertexFactoryInput
struct FVertexFactoryInput
{
float4 Position : POSITION;
half3 TangentX : TANGENT;
half3 TangentY : BINORMAL;
half3 TangentZ : NORMAL;
float4 WindInfo : BLENDINDICES;
#if NUM_MATERIAL_TEXCOORDS
float2 TexCoords[NUM_MATERIAL_TEXCOORDS] : TEXCOORD0;
#endif
float LODHint : TEXCOORD1;
#if NEEDS_VERTEX_LIGHTMAP
float4 LightMapA : TEXCOORD5;
float4 LightMapB : TEXCOORD6;
float4 LightMapC : TEXCOORD7;
#elif NEEDS_SIMPLE_VERTEX_LIGHTMAP
float4 LightMapA : TEXCOORD5;
#endif
};
#include "SpeedTreeVertexFactoryBase.usf"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CalcWorldPosition
float4 CalcWorldPosition(float4x4 Transform, FVertexFactoryInput Input)
{
return MulMatrix(Transform, WindEffect(Input.Position, Input.WindInfo));
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// VertexFactoryGetWorldPosition
float4 VertexFactoryGetWorldPosition(FVertexFactoryInput Input)
{
return CalcWorldPosition(LocalToWorld, Input);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// VertexFactoryGetInterpolants
FVertexFactoryInterpolants VertexFactoryGetInterpolants(FVertexFactoryInput Input)
{
FVertexFactoryInterpolants Interpolants;
VertexFactoryGetWorldPositionBase(Input, Interpolants);
return Interpolants;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// VertexFactoryGetPreviousWorldPosition
float4 VertexFactoryGetPreviousWorldPosition(FVertexFactoryInput Input)
{
return CalcWorldPosition(PreviousLocalToWorld, Input);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// GetWorldTangentBasis
half3x3 GetWorldTangentBasis(FVertexFactoryInput Input)
{
// WindEffect also rotates the tangent vectors into world-space.
return half3x3(
WindEffect(half4(TangentBias(Input.TangentX.xyz),0),Input.WindInfo).xyz,
WindEffect(half4(TangentBias(Input.TangentY.xyz),0),Input.WindInfo).xyz,
WindEffect(half4(TangentBias(Input.TangentZ.xyz),0),Input.WindInfo).xyz
);
}

Xet Storage Details

Size:
2.94 kB
·
Xet hash:
3d3c500a86494bd262c536c22c2aec0f8c8fe5e717bd693d726a7eb5684640fa

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.