Casts hard and soft shadows onto scene geometry, requiring an OpenGL 3.2 context with begin and end depth passes.
README
ofxShadow
This addon is easily to cast shadow on scene geometries. Implementation is mainly based on the following site. https://github.com/yasuhirohoshino/oF-ShadowExamples
Version
- OpenGL 3.2, GLSL 150 ~
- need to specify OpenGL version in main.cpp
int main() {
ofGLWindowSettings settings;
settings.setGLVersion(3,2);
settings.setSize(1024, 768);
ofCreateWindow(settings);
ofRunApp(new ofApp());
}Features
- hard shadow
- soft shadow
Usage
- ofApp.h
ofxShadow shadow;
ofEasyCam cam;- ofApp.cpp
void setup() {
shadow.setup();
}
void draw() {
shadow.beginDepth();
<-- RENDER SCENE -->
shadow.endDepth();
shadow.begin(cam);
<-- RENDER SCENE -->
shadow.end(cam);
}TODO:
- Multiple shadow
- Add SSAO pass]
- Enable to cast shadow to custom shaded object
ofxAddons