Skip to content

Instantly share code, notes, and snippets.

@joshuajnoble
Created August 13, 2013 03:50
Show Gist options
  • Save joshuajnoble/6217752 to your computer and use it in GitHub Desktop.
Save joshuajnoble/6217752 to your computer and use it in GitHub Desktop.
how ofMaterial could work
ofMaterial m;
m.setSpecular(ofColor(1, 1, 0, 1));
m.setEmissive(ofColor(0.1, 0.1, 0.1, 1));
m.setAmbient(ofColor(1, 1, 0, 1));
m.setDiffuse(ofColor(1, 1, 0, 1));
ofSpherePrimitive p;
p.scale(100);
// need to have material per vertex as an attribute to be able to set multiple materials in the
// shader, internally this will do a glEnableVertexAttribArray() to set up material props per-vert (<- ha!)
p.setMaterial(m);
@obviousjim
Copy link

can we also do:

m.begin();
p.draw();
m.end();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment