Permalink
Browse files

D3D11: Implement flat shading in shader.

  • Loading branch information...
unknownbrackets committed Apr 28, 2018
1 parent 07e178a commit b845278d7d8048d7fce1ef0b7bc1ec4a04f6a684
Showing with 4 additions and 2 deletions.
  1. +2 −1 GPU/Directx9/PixelShaderGeneratorDX9.cpp
  2. +2 −1 GPU/Directx9/VertexShaderGeneratorDX9.cpp
@@ -135,7 +135,8 @@ bool GenerateFragmentShaderHLSL(const FShaderID &id, char *buffer, ShaderLanguag
if (doTexture) {
WRITE(p, " float3 v_texcoord: TEXCOORD0;\n");
}
WRITE(p, " float4 v_color0: COLOR0;\n");
const char *colorInterpolation = doFlatShading && lang == HLSL_D3D11 ? "nointerpolation " : "";
WRITE(p, " %sfloat4 v_color0: COLOR0;\n", colorInterpolation);
if (lmode) {
WRITE(p, " float3 v_color1: COLOR1;\n");
}
@@ -231,7 +231,8 @@ void GenerateVertexShaderHLSL(const VShaderID &id, char *buffer, ShaderLanguage
if (doTexture) {
WRITE(p, " float3 v_texcoord : TEXCOORD0;\n");
}
WRITE(p, " float4 v_color0 : COLOR0;\n");
const char *colorInterpolation = doFlatShading && lang == HLSL_D3D11 ? "nointerpolation " : "";
WRITE(p, " %sfloat4 v_color0 : COLOR0;\n", colorInterpolation);
if (lmode)
WRITE(p, " float3 v_color1 : COLOR1;\n");

0 comments on commit b845278

Please sign in to comment.