]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
support hlsl too
authorRudolf Polzer <divverent@xonotic.org>
Mon, 28 Jan 2013 15:27:12 +0000 (16:27 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 28 Jan 2013 15:27:12 +0000 (16:27 +0100)
shader_hlsl.h

index eca8ded73494bfa9a9f058e6564f535713af477d..cd7701238545988cd1f6aa61f94ef0e30693d19c 100644 (file)
 "\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"
 "#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"