Created
August 13, 2013 03:50
-
-
Save joshuajnoble/6217752 to your computer and use it in GitHub Desktop.
how ofMaterial could work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can we also do:
m.begin();
p.draw();
m.end();