mirror of
https://git.stillkill.net/MinecraftLeak/MinecraftLegends.git
synced 2026-10-22 21:32:19 +01:00
46 lines
1016 B
HLSL
46 lines
1016 B
HLSL
#include "ShaderConstants.fxh"
|
|
|
|
struct VS_Input
|
|
{
|
|
float3 position : POSITION;
|
|
float2 uv0 : TEXCOORD_0;
|
|
#ifdef INSTANCEDSTEREO
|
|
uint instanceID : SV_InstanceID;
|
|
#endif
|
|
};
|
|
|
|
|
|
struct PS_Input
|
|
{
|
|
float4 position : SV_Position;
|
|
float2 uv : TEXCOORD_0;
|
|
#ifdef GEOMETRY_INSTANCEDSTEREO
|
|
uint instanceID : SV_InstanceID;
|
|
#endif
|
|
#ifdef VERTEXSHADER_INSTANCEDSTEREO
|
|
uint renTarget_id : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
};
|
|
|
|
|
|
void main( in VS_Input VSInput, out PS_Input PSInput )
|
|
{
|
|
#ifdef INSTANCEDSTEREO
|
|
int i = VSInput.instanceID;
|
|
PSInput.position = mul( WORLDVIEWPROJ_STEREO[i], float4( VSInput.position, 1 ) );
|
|
#ifdef GEOMETRY_INSTANCEDSTEREO
|
|
PSInput.instanceID = i;
|
|
#endif
|
|
#ifdef VERTEXSHADER_INSTANCEDSTEREO
|
|
PSInput.renTarget_id = i;
|
|
#endif
|
|
#else
|
|
PSInput.position = mul(WORLDVIEWPROJ, float4(VSInput.position, 1));
|
|
#endif
|
|
|
|
PSInput.uv = VSInput.uv0;
|
|
|
|
//this is to make it come closer to the camera and avoid z-fighting
|
|
PSInput.position.z -= 0.0001;
|
|
}
|