From: Rudolf Polzer Date: Mon, 28 Jan 2013 15:27:12 +0000 (+0100) Subject: support hlsl too X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=29814f48c7bb98fe9e32212efc0aebd9f1c07102;p=xonotic%2Fdarkplaces.git support hlsl too --- diff --git a/shader_hlsl.h b/shader_hlsl.h index eca8ded7..cd770123 100644 --- a/shader_hlsl.h +++ b/shader_hlsl.h @@ -376,6 +376,47 @@ "\n" "\n" "\n" +"#ifdef MODE_GHOSTMOTIONBLUR\n" +" #ifdef VERTEX_SHADER\n" +" void main\n" +" (\n" +" float4 gl_Vertex : POSITION,\n" +" uniform float4x4 ModelViewProjectionMatrix : register(c8),\n" +" float4 gl_MultiTexCoord0 : TEXCOORD0,\n" +" out float4 gl_Position : POSITION,\n" +" out float2 TexCoord : TEXCOORD0\n" +" )\n" +" {\n" +" TexCoord = gl_MultiTexCoord0.xy;\n" +" gl_Position = mul(ModelViewProjectionMatrix, gl_Vertex);\n" +" }\n" +" #endif\n" +" #ifdef FRAGMENT_SHADER\n" +" void main\n" +" (\n" +" float2 TexCoord : TEXCOORD0,\n" +" uniform sampler Texture_First : register(s0),\n" +" uniform sampler Texture_Second : register(s1),\n" +" uniform sampler Texture_Dither : register(s2),\n" +" uniform half BitValue : register(c0),\n" +" uniform half Alpha : register(c1),\n" +" uniform float2 Rand2f : register(c2),\n" +" out float4 dp_FragColor : COLOR\n" +" )\n" +" {\n" +" int i;\n" +" float2 tc = TexCoord;\n" +" float3 tex1 = tex2D(Texture_First, tc).rgb;\n" +" float3 tex1 = tex2D(Texture_Second, tc).rgb;\n" +" float3 tex3 = tex2D(Texture_Dither, tc).rgb;\n" +" dp_FragColor = (Alpha)*tex1 + (1.0-Alpha)*tex2 + (tex3-0.5)*BitValue;\n" +" }\n" +" #endif\n" +"#else // !MODE_GHOSTMOTIONBLUR\n" +"\n" +"\n" +"\n" +"\n" "#ifdef MODE_BLOOMBLUR\n" "#ifdef VERTEX_SHADER\n" "void main\n" @@ -1620,6 +1661,7 @@ "#endif // !MODE_WATER\n" "#endif // !MODE_REFRACTION\n" "#endif // !MODE_BLOOMBLUR\n" +"#endif // !MODE_GHOSTMOTIONBLUR\n" "#endif // !MODE_GENERIC\n" "#endif // !MODE_POSTPROCESS\n" "#endif // !MODE_SHOWDEPTH\n"