Handling User Defined shaders in OpenGL ES 2.0 framework

55 views Asked by At

I am developing a frame-based animation framework in OpenGL ES 2.0 to develop 3D graphics applications.

I have used few pre-defined shaders (for color, texture, alpha....) whose attributes and uniform are known.

Now I want to handle user given shaders. Loading, compiling and linking these shaders are fine. But how to map the attributes and uniforms to its corresponding data.

Suppose, in the user given shader, the vertex data has to be passed to attribute "a_vertex". In some other shader, it may be "a_myVertex". Thus name of the attribute to pass vertex data will be different for different user given shaders.

My question is how to handle the mapping of shader attributes and uniforms in the user given shaders.

Please give some suggestions to do this.

Thanks...

0

There are 0 answers