6 #ifndef MATERIALX_GLSLPROGRAM_H
7 #define MATERIALX_GLSLPROGRAM_H
54 void addStage(
const string& stage,
const string& sourceCode);
58 const string& getStageSourceCode(
const string& stage)
const;
81 void clearBuiltData();
116 Input(
int inputLocation,
int inputType,
int inputSize,
const string& inputPath) :
127 using InputMap = std::unordered_map<string, InputPtr>;
139 const InputMap& getAttributesList();
146 void findInputs(
const string& variable,
160 bool hasActiveAttributes()
const;
163 bool hasUniform(
const string&
name);
182 void unbindGeometry();
191 void bindViewInformation(
CameraPtr camera);
194 void bindTimeAndFrame(
float time = 1.0
f,
float frame = 1.0
f);
204 void printUniforms(std::ostream& outputStream);
207 void printAttributes(std::ostream& outputStream);
219 const InputMap& updateUniformsList();
222 const InputMap& updateAttributesList();
229 ImagePtr bindTexture(
unsigned int uniformType,
int uniformLocation,
const FilePath& filePath,
244 unsigned int _programId;
256 std::unordered_map<string, unsigned int> _attributeBufferIds;
259 std::map<MeshPartitionPtr, unsigned int> _indexBufferIds;
262 unsigned int _vertexArray;
268 std::unordered_map<string, unsigned int> _programTextures;
271 std::set<int> _enabledStreamLocations;
shared_ptr< class Mesh > MeshPtr
Shared pointer to a mesh.
std::shared_ptr< class Camera > CameraPtr
Shared pointer to a Camera.
void partition(I begin, I middle, I end, const Pred &pred, I *out_eqbeg, I *out_eqend)
#define MATERIALX_NAMESPACE_BEGIN
shared_ptr< class MeshPartition > MeshPartitionPtr
Shared pointer to a mesh partition.
GT_API const UT_StringHolder time
shared_ptr< const Value > ConstValuePtr
A shared pointer to a const Value.
static GlslProgramPtr create()
Create a GLSL program instance.
GLsizei const GLchar *const * path
std::unordered_map< string, InputPtr > InputMap
Program input shaded pointer map type.
std::shared_ptr< class LightHandler > LightHandlerPtr
Shared pointer to a LightHandler.
std::shared_ptr< class GlslProgram > GlslProgramPtr
std::shared_ptr< ImageHandler > ImageHandlerPtr
Shared pointer to an ImageHandler.
GLuint const GLchar * name
#define MX_RENDERGLSL_API
std::unordered_map< string, string > StringMap
An unordered map with strings as both keys and values.
static unsigned int UNDEFINED_OPENGL_RESOURCE_ID
std::shared_ptr< Input > InputPtr
Program input structure shared pointer type.
shared_ptr< Shader > ShaderPtr
Shared pointer to a Shader.
#define MATERIALX_NAMESPACE_END
ShaderPtr getShader() const
Return the shader, if any, used to generate this program.
shared_ptr< Image > ImagePtr
A shared pointer to an image.
shared_ptr< Value > ValuePtr
A shared pointer to a Value.
static int UNDEFINED_OPENGL_PROGRAM_LOCATION
GLuint GLsizei GLsizei GLchar * uniformName