Setting vertex/fragment programs seperately

As far as I understand I need to attach seperate programs to a main one. I then would call LinkProgram then UseProgramObject. I would rather seperate the Vertex and Fragment Programs and set them individualy without a relink. How can I do this?

You need to create a program object for each combination of shaders you’re going to use.

Thanks!

As this is part of engine building would you advise me to store a combination for later use once it is activated, or is the link process quick enough that I can get away with doing it before each render?

is the link process quick enough that I can get away with doing it before each render?
I wish. No, I would not suggest relying on fast link times. Especially considering that nVidia drivers don’t even compile the shaders until then; they just give them a run through their parser (to catch parse errors).

what i do is to specifiy in my material (a text file parsed at load time) and the creator sets what shaders they want to use, then its simple to bind them together :slight_smile:

Originally posted by Korval:
[quote]is the link process quick enough that I can get away with doing it before each render?
I wish. No, I would not suggest relying on fast link times. Especially considering that nVidia drivers don’t even compile the shaders until then; they just give them a run through their parser (to catch parse errors).
[/QUOTE]Really? So you have to actually use the shader to render something to complete the process.

No, you misunderstood, until then referred to link process.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.