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
uint8_t Binary2Gray(uint8_t data) | |
{ | |
int n_data=(data>>1); | |
n_data=(data ^ n_data); | |
return n_data; | |
} | |
uint8_t Gray2Binary(uint8_t data) | |
{ | |
byte b[8]={0,0,0,0,0,0,0,0}; |
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
void stestingApp::setup() | |
{ | |
mCam.lookAt(vec3(3, 2, 4), vec3(0)); | |
try { | |
mGlsl = gl::GlslProg::create(gl::GlslProg::Format().vertex(loadAsset("sh.vert")).fragment(loadAsset("sh.frag"))); | |
} | |
catch (gl::GlslProgCompileExc ex) { | |
console() <<"Shader Creation failed: "<< ex.what() << endl; | |
quit(); |
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
#version 150 | |
in vec3 v3LightDirection; | |
in vec3 v3Direction; | |
in vec3 c0; | |
in vec3 c1; | |
out vec4 color; | |
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
#version 150 | |
uniform mat4 ciModelViewProjection; | |
uniform mat4 ciProjectionMatrix; | |
uniform mat4 ciModelViewMatrix; | |
in vec4 ciPosition; | |
uniform vec3 v3LightPosition; // The direction vector to the light source |
NewerOlder