Jump to content

  • Log In with Google      Sign In   
  • Create Account

Equivalent to D3DReflect for OpenGL


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 pbobzebuilder   Members   -  Reputation: 311

Like
0Likes
Like

Posted 19 November 2013 - 03:27 AM

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

 

D3dReflect allows to Query the shader needs after compilation.

 



Sponsor:

#2 N.I.B.   Members   -  Reputation: 1194

Like
2Likes
Like

Posted 19 November 2013 - 04:14 AM

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.


Edited by N.I.B., 19 November 2013 - 04:17 AM.


#3 pbobzebuilder   Members   -  Reputation: 311

Like
0Likes
Like

Posted 19 November 2013 - 05:50 AM

Thanks a lot !

 

glGetProgramResourceNameglGetActiveAttribglGetActiveUniform... will do the job. 


Edited by pbobzebuilder, 19 November 2013 - 05:51 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS