1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 03:56:10 +08:00

Add missing files from last sync.

This commit is contained in:
Nicholas Hastings
2014-10-30 17:22:22 -04:00
parent 5c7d90ed0f
commit 2445f07be4
17 changed files with 1983 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#include "common_ps_fxc.h"
sampler TextureSampler : register( s0 );
struct PS_INPUT
{
float2 baseTexCoord : TEXCOORD0;
};
float4 main( PS_INPUT i ) : COLOR
{
float4 result = tex2D( TextureSampler, i.baseTexCoord );
return FinalOutput( result, 0, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_NONE );
}

View File

@ -0,0 +1,40 @@
#include "common_vs_fxc.h"
const float4 cLightmapTexCoordTransform[2] : register( SHADER_SPECIFIC_CONST_0 );
struct VS_INPUT
{
float3 vPos : POSITION;
float2 vBaseTexCoord : TEXCOORD0;
float2 vLightmapTexCoord : TEXCOORD1;
};
struct VS_OUTPUT
{
float4 projPos : POSITION;
float2 baseTexCoord : TEXCOORD0;
};
VS_OUTPUT main( const VS_INPUT v )
{
VS_OUTPUT o = ( VS_OUTPUT )0;
float4 projPos;
float3 worldPos;
worldPos = mul4x3( float4( v.vPos, 1 ), cModel[0] );
projPos = mul( float4( worldPos, 1 ), cViewProj );
o.projPos = projPos;
o.baseTexCoord.x = dot( v.vLightmapTexCoord, cLightmapTexCoordTransform[0].xy ) + cLightmapTexCoordTransform[0].w;
o.baseTexCoord.y = dot( v.vLightmapTexCoord, cLightmapTexCoordTransform[1].xy ) + cLightmapTexCoordTransform[1].w;
#ifdef _PS3
// Account for OpenGL's flipped y coordinate and expanded z range [-1,1] instead of [0,1]
o.projPos.y = -o.projPos.y;
o.projPos.z = 2.0f * o.projPos.z - o.projPos.w;
#endif // _PS3
return o;
}