Hello Everyone,
I have been going over a number of books and examples that deal with GLSL. It's common after viewing the source code to have something like this...
class Model{
public:
Model();
void render();
private:
GLSL glsl_program;
};
////// .cpp
Model::Model(){
glsl_program.compileAndLinkShaders()
}
void Model::render(){
glsl_program.use()
//render something
glsl_program.unUse();
}
Is this how a shader program should be used in real time applications? For example, if I have a particle class, for every particle that's created, do I want to compiling and linking a vertex, frag shader? It seems to a noob such as myself this might not be the best approach to real time applications.
If I am correct, what is the best work around?
Thanks so much for all the help,
Mike