Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

How to send an array to a shader frag on oF0.9.0

$
0
0

OK, still not sure where the bug comes from, but it seems to work fine if you use the underlying OpenGL commands.

void ofApp::setup(){
	float colors[] = { 1,0.5,0,0,0.5,1 };
	shader.load("test");
	GLuint program = shader.getProgram();
	GLint loc = glGetUniformLocation(program, "inColor");
	glUseProgram(program);
	glUniform3fv(loc, 2, colors);
}

Hope that helps somebody :smile:


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>