Jump to content
  • Advertisement
Sign in to follow this  
zerorepent

OpenGL OpenGL shaderreflection equivalent?

This topic is 2525 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi
Does OpenGL has a similar function as DirectX shaderreflection? I've been thinking about testing opengl a bit. Or how does people usually keep track of shadervariables and such? Depending on the situation I guess one can hardcode it, but that loses a lot of flexibility another solution might be through some kind of scripting, but I'm very curious about how people usually do this kind of work.

Share this post


Link to post
Share on other sites
Advertisement
For every shader, I write a small dictionnary file that maps shader unforms names (and vertex attributes) with predefined semanctics for automatic data (such as world,view,light dir,...) and with default values for artists variables. Automatic variables are automatically binded by the engine and artist variables may be changed at runtime(they use their default values at start up).

Share this post


Link to post
Share on other sites

Hi
Does OpenGL has a similar function as DirectX shaderreflection?


From http://msdn.microsof...Layer_Interface

The shader reflection layer is the interface by which information about the shader requirements may be obtained. This is particularly useful when creating Input Assembly linkages (see below) where you may need to traverse the shader input requirements to ensure you are supplying the correct input structure to the shader. You can create an instance of the reflection layer interface at the same time as creating an instance of a compiled shader.[/quote]

I would have to say that there is no such thing in GL, however there is a function called glGetActiveUniform, perhaps it does the same thing.

Share this post


Link to post
Share on other sites

For every shader, I write a small dictionnary file that maps shader unforms names (and vertex attributes) with predefined semanctics for automatic data (such as world,view,light dir,...) and with default values for artists variables. Automatic variables are automatically binded by the engine and artist variables may be changed at runtime(they use their default values at start up).


It sounds like what I've been thinking about how to keep track of shadervariables, it should possible to write a script that analyzes shader files and outputs a dictionary file.


I would have to say that there is no such thing in GL, however there is a function called glGetActiveUniform, perhaps it does the same thing.


hmm, I see, I'll have to look into that function, it sounds like it can do atleast parts of what

DirectX shaderreflection does.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!