Hi,
i want to use bindable uniform buffers to swap the uniform data fast within my main program logic. But this does not seems to work. My image is just black. Perhaps someone sees a problem within my code?
binding the the uniform:
GLuint loc2 = glGetUniformLocation(shaderProgram,"specColor");
float sc = 0.4f;
GLint buffersize = glGetUniformBufferSizeEXT(shaderProgram,loc2);
GLuint uniform_buffer;
glGenBuffers(1, &uniform_buffer);
glBindBuffer(GL_UNIFORM_BUFFER_EXT, uniform_buffer);
glBufferData(GL_UNIFORM_BUFFER_EXT, buffersize, &sc, GL_STATIC_READ);
glUniformBufferEXT(shaderProgram,loc2, uniform_buffer);
glUseProgram(shaderProgram);
glUniform1f(loc2,sc);
fragment shader:
And i have another question. I wonder if using texture buffer objects (tbo) via uniform 'samplerBuffer' swaps the data as fast a normal sampler which is declared as bindable would do. Are those both extensions comparable? They are both backed up by a buffer object and therefore comparable, nor?#version 120
#extension EXT_gpu_shader4 : enable
#extension GL_EXT_bindable_uniform : enable
bindable uniform float specColor;
void main() {
vec4 color2 = vec4(specColor,0.0,0.0,1.0);
gl_FragColor = color2;
}
Greetings,
Jotschi



