This repository has been archived on 2024-03-22. You can view files and clone it, but cannot push or open issues or pull requests.
DX11Starter/SkyboxVertexShader.hlsl
2022-04-03 17:26:55 -04:00

25 lines
550 B
HLSL

#include "SkyboxDefines.hlsli"
cbuffer ExternalData : register(b0)
{
matrix view;
matrix projection;
}
matrix RemoveTranslation(matrix m)
{
m._14 = 0;
m._24 = 0;
m._34 = 0;
return m;
}
SkyboxVertexToPixel main(SkyboxVertexShaderInput input)
{
SkyboxVertexToPixel output;
matrix worldViewProjection = mul(projection, RemoveTranslation(view));
output.screenPosition = mul(worldViewProjection, float4(input.localPosition, 1.0f));
output.screenPosition.z = output.screenPosition.w;
output.sampleDir = input.localPosition;
return output;
}