Anyone knows if there's an equivalent to D3DReflet for Opengl ?
D3dReflect allows to Query the shader needs after compilation.
Anyone knows if there's an equivalent to D3DReflet for Opengl ?
D3dReflect allows to Query the shader needs after compilation.
OpenGL is built around the concept of program reflection. There are a bunch of functions, some of them are:
glGetUniformLocation(), glGetUniformBlockIndex(), glGetFragDataLocation(), glGetFragDataIndex(), glGetAttribLocation(), glGetProgramResourceIndex(), glGetProgramResourceLocation(), glGetUniform().
glGetProgram() allows you to query a program for its properties, such as number of uniforms, attributes and GS and TF properties.
Note that reflection is not done on shaders, but on linked programs.