VSShader Lib – Very Simple Shader Library
Shaders are the core of the rendering process. OpenGL core profile requires us to provide our own shaders, no more fixed function.
Using shaders means more flexibility, but it also implies more work. This is where this lib steps in.
VSShaderLib was designed to make our life easier. It allows to create programs, load shaders from files, associate vertex attribute names with locations, and work with uniforms, including blocks. It also provides access to the info logs.
History
Version 0.2.1
- Added more attribs, namely tangents, bitangents, and 4 custom attribs
Version 0.2.0
- Added methods to set uniforms
- Added methods to set blocks
- Renamed to VSShaderLib
Version 0.1.0
- Initial Release
Download
To download go to VSL Downloads page.

Sorry, I can not reproduce the above problem now.
When I posted the last message, I was using Nvidia Quadro 4800 and driver 304.64. One day q4800 was burnt and the driver got updated. Now I am using Nvidia GeForce GTX 570 and driver 304.88. vsShader works like charm.
Thanks for the lib. And sorry for the noise.
I use assimp.cpp as a start of one demo. It works.
But I encounter a problem with multiple sampler in frag shader. Suppose I have these lines in frag shader:
uniform sampler2D colorTex;
uniform sampler2D depthTex;
And these lines for binding texture unit:
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, g_color_tex);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, g_depth_tex);
And the following for set uniforms:
shaderQuad.init();
shaderQuad.loadShader;
shaderQuad.loadShader
shaderQuad.setProgramOutput(0,”outputF”);
shaderQuad.setVertexAttribName;
shaderQuad.prepareProgram();
shaderQuad.setUniform(“colorTex”, 0);
shaderQuad.setUniform(“depthTex”, 1);
The problem is only the texture in texture unit 0 is valid. All textures will be valid if I use glUniformi directly:
glCreateProgram, glCreateShader, glShaderSource, glAttachShader, glLinkProgram … tons of code
glUseProgram(quad_prog_id);
glUniform1i(glGetUniformLocation(quad_prog_id, “colorTex”), 0);
glUniform1i(glGetUniformLocation(quad_prog_id, “depthTex”), 1);
So please help me with multiple textures in shader and vsShaderLib.