You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
849 B
39 lines
849 B
#include "common_fog_vs_fxc.h"
|
|
// DYNAMIC: "COMPRESSED_VERTS" "0..1"
|
|
// DYNAMIC: "SKINNING" "0..1"
|
|
|
|
#include "common_vs_fxc.h"
|
|
|
|
static const int g_FogType = DOWATERFOG;
|
|
static const bool g_bSkinning = SKINNING ? true : false;
|
|
|
|
struct VS_INPUT
|
|
{
|
|
float4 vPos : POSITION;
|
|
float4 vBoneWeights : BLENDWEIGHT;
|
|
float4 vBoneIndices : BLENDINDICES;
|
|
};
|
|
|
|
struct VS_OUTPUT
|
|
{
|
|
float4 vProjPos : POSITION;
|
|
};
|
|
|
|
|
|
VS_OUTPUT main( const VS_INPUT v )
|
|
{
|
|
VS_OUTPUT o = ( VS_OUTPUT )0;
|
|
|
|
float3 worldPos;
|
|
SkinPosition( g_bSkinning, v.vPos, v.vBoneWeights, v.vBoneIndices, worldPos );
|
|
|
|
o.vProjPos = mul( float4( worldPos, 1 ), cViewProj );
|
|
|
|
#ifdef _PS3
|
|
// Account for OpenGL's flipped y coordinate and expanded z range [-1,1] instead of [0,1]
|
|
o.vProjPos.y = -o.vProjPos.y;
|
|
o.vProjPos.z = 2.0f * o.vProjPos.z - o.vProjPos.w;
|
|
#endif // _PS3
|
|
|
|
return o;
|
|
}
|