Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Equivalent to D3DReflect for OpenGL

4: Adsense

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   

387
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.

 



#2 N.I.B.   Members   

1452
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   

387
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.