| 70 | } |
| 71 | |
| 72 | void RDiffusionApp::setup() |
| 73 | { |
| 74 | mReactionU = 0.25f; |
| 75 | mReactionV = 0.04f; |
| 76 | mReactionK = 0.047f; |
| 77 | mReactionF = 0.1f; |
| 78 | |
| 79 | mMousePressed = false; |
| 80 | |
| 81 | // Setup the parameters |
| 82 | ImGui::Initialize(); |
| 83 | |
| 84 | mCurrentFBO = 0; |
| 85 | mOtherFBO = 1; |
| 86 | mFBOs[0] = gl::Fbo::create( FBO_WIDTH, FBO_HEIGHT, gl::Fbo::Format().colorTexture().disableDepth() ); |
| 87 | mFBOs[1] = gl::Fbo::create( FBO_WIDTH, FBO_HEIGHT, gl::Fbo::Format().colorTexture().disableDepth() ); |
| 88 | |
| 89 | mRDShader = gl::GlslProg::create( loadResource( RES_PASS_THRU_VERT ), loadResource( RES_GSRD_FRAG ) ); |
| 90 | mTexture = gl::Texture::create( loadImage( loadResource( RES_STARTER_IMAGE ) ), |
| 91 | gl::Texture::Format().wrap(GL_REPEAT).magFilter(GL_LINEAR).minFilter(GL_LINEAR) ); |
| 92 | gl::getStockShader( gl::ShaderDef().texture() )->bind(); |
| 93 | |
| 94 | resetFBOs(); |
| 95 | } |
| 96 | |
| 97 | void RDiffusionApp::update() |
| 98 | { |