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

0030799: Draw Harness, ViewerTest - setup uniforms via vshader command

vshaderprog command now supports setup custom uniforms
This commit is contained in:
mzernova 2019-07-17 19:05:53 +03:00 committed by bugmaster
parent 1c728f2d6d
commit 0dab581700

View File

@ -606,13 +606,20 @@ static Standard_Integer VShaderProg (Draw_Interpretor& theDI,
TCollection_AsciiString anArg (theArgVec[anArgIter]);
anArg.LowerCase();
Graphic3d_TypeOfShaderObject aShaderTypeArg = Graphic3d_TypeOfShaderObject(-1);
if (anArg == "-list"
|| ((anArg == "-update"
|| anArg == "-dump"
|| anArg == "-debug"
|| anArg == "-reload"
|| anArg == "-load")
&& anArgIter + 1 < theArgNb))
if (!aProgram.IsNull()
&& anArg == "-uniform"
&& anArgIter + 2 < theArgNb)
{
TCollection_AsciiString aName = theArgVec[++anArgIter];
aProgram->PushVariableFloat (aName, float (Draw::Atof (theArgVec[++anArgIter])));
}
else if (anArg == "-list"
|| ((anArg == "-update"
|| anArg == "-dump"
|| anArg == "-debug"
|| anArg == "-reload"
|| anArg == "-load")
&& anArgIter + 1 < theArgNb))
{
Handle(OpenGl_Context) aGlCtx;
if (Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast (aCtx->CurrentViewer()->Driver()))
@ -895,6 +902,7 @@ void ViewerTest::OpenGlCommands(Draw_Interpretor& theCommands)
"\n\t\t: [-off] [-phong] [-aspect {shading|line|point|text}=shading]"
"\n\t\t: [-header VersionHeader]"
"\n\t\t: [-tessControl TessControlShader -tesseval TessEvaluationShader]"
"\n\t\t: [-uniform Name FloatValue]"
"\n\t\t: Assign custom GLSL program to presentation aspects."
"\nvshader [-list] [-dump] [-reload] ShaderId"
"\n\t\t: -list prints the list of registered GLSL programs"