X-Git-Url: https://gitweb.ps.run/subsurface_scattering/blobdiff_plain/36fb27a899045de24d71d55b06648abda7547268..54a47a42ce3f6f05eafd62305552ee48dc08913f:/src/main2.cpp diff --git a/src/main2.cpp b/src/main2.cpp index 38ca5f2..c30fb9e 100644 --- a/src/main2.cpp +++ b/src/main2.cpp @@ -20,18 +20,9 @@ #include #include -/* -TODO: -- Save Depth to fbo -- Stencil Buffer -- LightDist > 1 - - 1 - distanceToBackside in frag_irradiance -- ShadowMap Perspective (no projection?) -- (Implement Gaussian Blur) -- LightDir nicht immer zu 0 0 0 - -*/ +// sample positions and weights for a Gaussian kernel from +// Hable, John ; Borshukov, George ; Hejl, Jim: Fast Skin Shading. In: ShaderX7, ShaderX : Charles River Media, 2009, S. 161–173 float samplePositions[] = { 0.000000f, 0.000000f, @@ -396,7 +387,6 @@ int main() { GLuint shaderProgramIrradiance = compileShaders("shaders/ts_vert_irradiance.glsl", "shaders/ts_frag_irradiance.glsl"); GLuint shaderProgramCombine = compileShaders("shaders/ts_vert.glsl", "shaders/ts_frag.glsl"); - //model m = loadModel("models/Isotrop-upperjaw.ply"); model m = loadModel("models/african_head/african_head.obj"); arccam arcCam; @@ -483,7 +473,7 @@ int main() { prevMouse = sf::Mouse::isButtonPressed(sf::Mouse::Right); - // Render Shadowmap + // Render Shadowmap to fbo glBindFramebuffer(GL_FRAMEBUFFER, fb_irradiance.fbo); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); @@ -527,9 +517,7 @@ int main() { m.draw(); - - - // Render fbo to screen + // Render model and calculate light spread and translucency in shader glBindFramebuffer(GL_FRAMEBUFFER, 0); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); @@ -582,23 +570,15 @@ int main() { glActiveTexture(GL_TEXTURE0 + 0); glBindTexture(GL_TEXTURE_2D, fb_irradiance.renderTexture); - // glBindVertexArray(fb_irradiance.screenVAO); - // glUniform1i(glGetUniformLocation(fb_irradiance.screenShaderProgram, "shadowmapTexture"), 0); - // glActiveTexture(GL_TEXTURE0 + 0); - // glBindTexture(GL_TEXTURE_2D, fb_irradiance.renderTexture); - // glDrawArrays(GL_TRIANGLES, 0, 6); - // glBindVertexArray(0); - m.draw(); - + // menu ImGui::SFML::Update(window, deltaClock.restart()); ImGui::Begin("Options"); ImGui::Checkbox("Wireframe", &options.wireframe); ImGui::Checkbox("Free Cam", &options.freecam); - ImGui::InputInt("Render State", &options.renderState); ImGui::DragFloat3("Color", options.color, 0.01, 0, 1); ImGui::DragFloat("Transmittance Scale", &options.transmittanceScale, 0.0001f, 0, 0.3); ImGui::DragFloat("Pow Base", &options.powBase, 0.01f, 0, 4);