mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0030799: Draw Harness, ViewerTest - setup uniforms via vshader command
vshaderprog command now supports setup custom uniforms
This commit is contained in:
parent
1c728f2d6d
commit
0dab581700
@ -606,13 +606,20 @@ static Standard_Integer VShaderProg (Draw_Interpretor& theDI,
|
|||||||
TCollection_AsciiString anArg (theArgVec[anArgIter]);
|
TCollection_AsciiString anArg (theArgVec[anArgIter]);
|
||||||
anArg.LowerCase();
|
anArg.LowerCase();
|
||||||
Graphic3d_TypeOfShaderObject aShaderTypeArg = Graphic3d_TypeOfShaderObject(-1);
|
Graphic3d_TypeOfShaderObject aShaderTypeArg = Graphic3d_TypeOfShaderObject(-1);
|
||||||
if (anArg == "-list"
|
if (!aProgram.IsNull()
|
||||||
|| ((anArg == "-update"
|
&& anArg == "-uniform"
|
||||||
|| anArg == "-dump"
|
&& anArgIter + 2 < theArgNb)
|
||||||
|| anArg == "-debug"
|
{
|
||||||
|| anArg == "-reload"
|
TCollection_AsciiString aName = theArgVec[++anArgIter];
|
||||||
|| anArg == "-load")
|
aProgram->PushVariableFloat (aName, float (Draw::Atof (theArgVec[++anArgIter])));
|
||||||
&& anArgIter + 1 < theArgNb))
|
}
|
||||||
|
else if (anArg == "-list"
|
||||||
|
|| ((anArg == "-update"
|
||||||
|
|| anArg == "-dump"
|
||||||
|
|| anArg == "-debug"
|
||||||
|
|| anArg == "-reload"
|
||||||
|
|| anArg == "-load")
|
||||||
|
&& anArgIter + 1 < theArgNb))
|
||||||
{
|
{
|
||||||
Handle(OpenGl_Context) aGlCtx;
|
Handle(OpenGl_Context) aGlCtx;
|
||||||
if (Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast (aCtx->CurrentViewer()->Driver()))
|
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: [-off] [-phong] [-aspect {shading|line|point|text}=shading]"
|
||||||
"\n\t\t: [-header VersionHeader]"
|
"\n\t\t: [-header VersionHeader]"
|
||||||
"\n\t\t: [-tessControl TessControlShader -tesseval TessEvaluationShader]"
|
"\n\t\t: [-tessControl TessControlShader -tesseval TessEvaluationShader]"
|
||||||
|
"\n\t\t: [-uniform Name FloatValue]"
|
||||||
"\n\t\t: Assign custom GLSL program to presentation aspects."
|
"\n\t\t: Assign custom GLSL program to presentation aspects."
|
||||||
"\nvshader [-list] [-dump] [-reload] ShaderId"
|
"\nvshader [-list] [-dump] [-reload] ShaderId"
|
||||||
"\n\t\t: -list prints the list of registered GLSL programs"
|
"\n\t\t: -list prints the list of registered GLSL programs"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user