MSAA centroid interpolation mode for GL3 and D3D11 to prevent artifacts

this helps mostly to avoid lightmap tile leaks with MSAA
This commit is contained in:
myT 2019-12-26 16:20:41 +01:00
parent 4968bfca6d
commit a89a2e3ead
3 changed files with 7 additions and 6 deletions

View File

@ -10,6 +10,7 @@ add: r_backend <GL2|GL3|D3D11> (default: D3D11 on Windows, GL3 on Linux) selects
feature | | | |
-----------------------|--------|--------|--------------------|
MSAA | GL 3.0 | always | always |
MSAA centroid sampling | never | always | always |
depth sprites | never | always | always |
alpha to coverage AA | never | always | always |
dithering | never | always | always |

View File

@ -38,9 +38,9 @@ struct VIn
struct VOut
{
float4 position : SV_Position;
float4 color : COLOR0;
float2 texCoords : TEXCOORD0;
float2 texCoords2 : TEXCOORD1;
centroid float4 color : COLOR0;
centroid float2 texCoords : TEXCOORD0;
centroid float2 texCoords2 : TEXCOORD1;
float clipDist : SV_ClipDistance0;
};

View File

@ -312,9 +312,9 @@ static const char* generic_fs =
"#define seed gammaBrightNoiseSeed.w\n"
"#endif\n"
"\n"
"in vec2 texCoords1FS;\n"
"in vec2 texCoords2FS;\n"
"in vec4 colorFS;\n"
"centroid in vec2 texCoords1FS;\n"
"centroid in vec2 texCoords2FS;\n"
"centroid in vec4 colorFS;\n"
"\n"
"out vec4 fragColor;\n"
"\n"