MCPcopy Create free account
hub / github.com/Kitware/VTK / SetUniformMatrix

Method SetUniformMatrix

Rendering/OpenGL2/vtkShaderProgram.cxx:774–790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

772}
773
774bool vtkShaderProgram::SetUniformMatrix(const char* name, vtkMatrix4x4* matrix)
775{
776 GLint location = static_cast<GLint>(this->FindUniform(name));
777 if (location == -1)
778 {
779 this->Error = "Could not set uniform (does not exist) ";
780 this->Error += name;
781 return false;
782 }
783 float data[16];
784 for (int i = 0; i < 16; ++i)
785 {
786 data[i] = matrix->Element[i / 4][i % 4];
787 }
788 glUniformMatrix4fv(location, 1, GL_FALSE, data);
789 return true;
790}
791
792bool vtkShaderProgram::SetUniformMatrix3x3(const char* name, float* matrix)
793{

Callers 11

UpdateUniformsMethod · 0.45
SetShaderParametersMethod · 0.45
RenderSSAOMethod · 0.45
RenderMethod · 0.45
ApplyStencilMethod · 0.45

Calls 1

FindUniformMethod · 0.95

Tested by

no test coverage detected