1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

0026672: Visualization, TKOpenGl - workaround mobile hardware with extremely low precision of mod() in GLSL

This commit is contained in:
kgv 2015-09-09 14:24:21 +03:00 committed by bugmaster
parent 464cd2fb16
commit 6e66a3fa15

View File

@ -1684,7 +1684,7 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramStereo (Handle(OpenGl_Sh
EOL"{"
EOL" vec4 aColorL = occTexture2D (uLeftSampler, TexCoord);"
EOL" vec4 aColorR = occTexture2D (uRightSampler, TexCoord);"
EOL" if (int (mod (gl_FragCoord.y + 1.5, 2.0)) == 1)"
EOL" if (int (mod (gl_FragCoord.y - 1023.5, 2.0)) != 1)"
EOL" {"
EOL" occFragColor = aColorL;"
EOL" }"
@ -1707,7 +1707,7 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramStereo (Handle(OpenGl_Sh
EOL"{"
EOL" vec4 aColorL = occTexture2D (uLeftSampler, TexCoord);"
EOL" vec4 aColorR = occTexture2D (uRightSampler, TexCoord);"
EOL" if (int (mod (gl_FragCoord.x + 1.5, 2.0)) != 1)"
EOL" if (int (mod (gl_FragCoord.x - 1023.5, 2.0)) == 1)"
EOL" {"
EOL" occFragColor = aColorL;"
EOL" }"
@ -1730,8 +1730,8 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramStereo (Handle(OpenGl_Sh
EOL"{"
EOL" vec4 aColorL = occTexture2D (uLeftSampler, TexCoord);"
EOL" vec4 aColorR = occTexture2D (uRightSampler, TexCoord);"
EOL" bool isEvenX = int(mod(floor(gl_FragCoord.x + 1.5), 2.0)) == 1;"
EOL" bool isEvenY = int(mod(floor(gl_FragCoord.y + 1.5), 2.0)) != 1;"
EOL" bool isEvenX = int(mod(floor(gl_FragCoord.x - 1023.5), 2.0)) != 1;"
EOL" bool isEvenY = int(mod(floor(gl_FragCoord.y - 1023.5), 2.0)) == 1;"
EOL" if ((isEvenX && isEvenY) || (!isEvenX && !isEvenY))"
EOL" {"
EOL" occFragColor = aColorL;"