1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0026969: Visualization - support custom vertex attributes in GLSL program

Graphic3d_TypeOfData - added Graphic3d_TOD_FLOAT for passing single-float vertex attributes.
Graphic3d_TOA_CUSTOM - changed value to increase the range for custom vertex attributes locations (to fit into hardware limits).
Graphic3d_ShaderProgram::SetVertexAttributes() - introduced API for defining custom vertex attributes.

For compatibility with automated wrappers:
- Graphic3d_Buffer::Init() - added prototype taking NCollection_Array1<Graphic3d_Attribute> instead of C array
- Graphic3d_IndexBuffer::InitInt32() - added typed initialization method.
- Graphic3d_ShaderProgram::PushVariableVec3() and others - added typed methods to push uniform varibales.
This commit is contained in:
kgv
2016-02-20 13:10:41 +03:00
committed by bugmaster
parent 9d55d9b0be
commit 4a535d3fd6
9 changed files with 185 additions and 6 deletions

View File

@@ -297,6 +297,16 @@ Standard_Boolean OpenGl_ShaderProgram::Initialize (const Handle(OpenGl_Context)&
SetAttributeName (theCtx, Graphic3d_TOA_UV, "occTexCoord");
SetAttributeName (theCtx, Graphic3d_TOA_COLOR, "occVertColor");
// bind custom Vertex Attributes
if (!myProxy.IsNull())
{
for (Graphic3d_ShaderAttributeList::Iterator anAttribIter (myProxy->VertexAttributes());
anAttribIter.More(); anAttribIter.Next())
{
SetAttributeName (theCtx, anAttribIter.Value()->Location(), anAttribIter.Value()->Name().ToCString());
}
}
if (!Link (theCtx))
{
TCollection_AsciiString aLog;