D3D11: Implement flat shading in shader.

This commit is contained in:
Unknown W. Brackets 2018-04-28 16:18:35 -07:00
parent 07e178a2da
commit b845278d7d
2 changed files with 4 additions and 2 deletions

View file

@ -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");
}

View file

@ -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");