Equivalent to D3DReflect for OpenGL

Started by
1 comment, last by pbobzebuilder 10 years, 5 months ago

Anyone knows if there's an equivalent to D3DReflet for Opengl ?

D3dReflect allows to Query the shader needs after compilation.

Advertisement

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.

Thanks a lot !

glGetProgramResourceName, glGetActiveAttrib, glGetActiveUniform... will do the job.

This topic is closed to new replies.

Advertisement