From 14846184813ea626e99924bff566978b04d254da Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 16 Sep 2022 23:45:53 +0200 Subject: [PATCH] Add HLSL source version for IW4 2D shaders --- raw/iw4/shader/trivial_vertcol_simple.hlsl | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 raw/iw4/shader/trivial_vertcol_simple.hlsl diff --git a/raw/iw4/shader/trivial_vertcol_simple.hlsl b/raw/iw4/shader/trivial_vertcol_simple.hlsl new file mode 100644 index 00000000..dd6f41ba --- /dev/null +++ b/raw/iw4/shader/trivial_vertcol_simple.hlsl @@ -0,0 +1,34 @@ +struct VSInput +{ + float3 position : POSITION; + half4 color : COLOR0; + half2 texcoord : TEXCOORD0; +}; + +struct VSOutput +{ + float4 position : POSITION; + half4 color : COLOR0; + half2 texcoord : TEXCOORD0; +}; + +extern float4x4 viewProjectionMatrix; +extern float4x4 worldMatrix; + +VSOutput VSMain(VSInput vin) +{ + VSOutput vout = (VSOutput)0; + + vout.position = mul(mul(float4(vin.position, 1.0f), worldMatrix), viewProjectionMatrix); + vout.color = vin.color; + vout.texcoord = vin.texcoord; + + return vout; +} + +extern sampler2D colorMapSampler; + +half4 PSMain(VSOutput input) : SV_TARGET +{ + return half4(tex2D(colorMapSampler, input.texcoord)) * input.color; +} \ No newline at end of file