Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Compatibility problem from version 2.1 to 3.3

$
0
0

@Alex2 wrote:

Hey guys ! I’m kinda new to openFrameworks and I’m trying to play around ! I stumbled on this addon : https://github.com/kashimAstro/ofxShaderSelect . It’s working perfectly with an openGL version of 2.1 but when I modify the GLVersion to 3.3 nothing appears !

Here’s the draw function :
void ofApp::draw()
{
ofBackgroundGradient(ofColor(200), ofColor(0, 0, 65));

	cam.begin();
	ofEnableDepthTest();
	pass.begin();

	ofMatrix4x4 camdist;

	camdist.preMultTranslate(ofVec3f(0, 0, 600));
	if (!stopRotate)
		camdist.preMultRotate(ofQuaternion(ofGetElapsedTimeMillis()*0.065, ofVec3f(0, 0, 1)));

	
	pass.setUniformMatrix4f("Modelview", cam.getModelViewMatrix()*(glm::mat4)camdist);
	pass.setUniformMatrix4f("Projection", cam.getProjectionMatrix());
	pass.setUniformMatrix3f("NormalMatrix", shader.mat4ToMat3(ofGetCurrentNormalMatrix()));
	pass.setUniform1f("TessLevelInner", levelInner);
	pass.setUniform1f("TessLevelOuter", levelOuter);
	pass.setUniform3f("LightPosition", lightpos->x, lightpos->y, lightpos->z);
	pass.setUniform3f("DiffuseMaterial", diffMat->x, diffMat->y, diffMat->z);
	pass.setUniform3f("AmbientMaterial", ambMat->x, ambMat->y, ambMat->z);



	vbo.drawElements(GL_PATCHES, vbo.getNumVertices()*vbo.getNumVertices());



	pass.end();
	ofDisableDepthTest();
	cam.end();

	gui.draw();
}

Is it possible that vbo.drawElements doesn’t work with a version of openGL 3.1 and higher ?

Anyway, thank you for your time !

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles