Created
August 9, 2013 11:30
-
-
Save obviousjim/6192938 to your computer and use it in GitHub Desktop.
ofLight/ofShader/ofMaterial custom shader potential
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
cpp | |
ofLight myLight; | |
ofEnableLight(); | |
myLight.begin(); --> registers the light with the ofGLRenderer | |
myShader.begin(); --> register the shader with ofGLRrenderer, which then passing all enabled lights to it as a uniform | |
myMaterial.begin(); --> registers | |
drawSomething() | |
myMaterial.end(); | |
myShader.end(); | |
myLight.end(); | |
shaderbegin(){ | |
glRenderer.setActiveShader(this); | |
} | |
glsl | |
#vertex | |
#of_use_lights //imports all uniforms | |
void main(){ | |
vec3 lightColor = ofLightValu(); | |
//calculate view direction based on normal | |
//constants, based | |
//sets | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment