From 7514b41966145af3c628af3d6b6d40fc9a57fefc Mon Sep 17 00:00:00 2001 From: degasus Date: Tue, 19 Mar 2013 13:50:43 +0100 Subject: [PATCH] GLSL: fix msaa egdes MSAA is a optimiztion to execute the fragment shader just once per pixel instead per sample. It sounds great, but has a big issue: At edges where the center isn't in the polygon, the fragment would still be executed, but still with the center of the pixel as position. So if some calculations aren't allowed outside the polygon, the result would be invalid. But the nice one: we can give a hint to each input to be choosen from a valid pixel, so now every pixel will be calculated with valid source. --- Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp index 1bc5e1fc14..3739af5a90 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp @@ -505,8 +505,8 @@ void ProgramShaderCache::CreateHeader ( void ) "\n"// A few required defines and ones that will make our lives a lot easier "#define ATTRIN in\n" "#define ATTROUT out\n" - "#define VARYIN in\n" - "#define VARYOUT out\n" + "#define VARYIN centroid in\n" + "#define VARYOUT centroid out\n" // Silly differences "#define float2 vec2\n"