1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0029337: Visualization, TKOpenGl - visual artifacts on Intel Broadwell GPU

Enable multiple draw buffers in shader program only if its required by specific application.

occSetFragColor() - a new GLSL function has been introduced
as an alternative to setting occFragColor/occFragCoverage variables.
This commit is contained in:
apl
2017-11-27 15:16:21 +03:00
committed by apn
parent 12d71ad6a5
commit b17e5bae1a
12 changed files with 201 additions and 75 deletions

View File

@@ -736,7 +736,8 @@ static Standard_Integer VShaderProg (Draw_Interpretor& /*theDI*/,
const TCollection_AsciiString& aShaderSrc = aShader->Source();
const bool hasVertPos = aShaderSrc.Search ("gl_Position") != -1;
const bool hasFragColor = aShaderSrc.Search ("occFragColor") != -1
const bool hasFragColor = aShaderSrc.Search ("occSetFragColor") != -1
|| aShaderSrc.Search ("occFragColor") != -1
|| aShaderSrc.Search ("gl_FragColor") != -1
|| aShaderSrc.Search ("gl_FragData") != -1;
Graphic3d_TypeOfShaderObject aShaderType = aShaderTypeArg;
@@ -768,6 +769,13 @@ static Standard_Integer VShaderProg (Draw_Interpretor& /*theDI*/,
}
}
if (!aProgram.IsNull()
&& ViewerTest::CurrentView()->RenderingParams().TransparencyMethod == Graphic3d_RTM_BLEND_OIT)
{
aProgram->SetNbFragmentOutputs (2);
aProgram->SetWeightOitOutput (true);
}
ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName aGlobalPrsIter (GetMapOfAIS());
NCollection_Sequence<Handle(AIS_InteractiveObject)>::Iterator aPrsIter (aPrsList);
const bool isGlobalList = aPrsList.IsEmpty();