Browse Source

shader chains now properly blend their alpha.

naelstrof 7 years ago
parent
commit
adf7329671
2 changed files with 4 additions and 1 deletions
  1. 1
    1
      CMakeLists.txt
  2. 3
    0
      src/slop.cpp

+ 1
- 1
CMakeLists.txt View File

@@ -21,7 +21,7 @@ endif()
21 21
 
22 22
 include_directories("${PROJECT_BINARY_DIR}")
23 23
 
24
-add_definitions(-DSLOP_VERSION="v6.3.41")
24
+add_definitions(-DSLOP_VERSION="v6.3.42")
25 25
 
26 26
 # The names have to be unique unfortunately.
27 27
 set(EXECUTABLE_NAME "slop")

+ 3
- 0
src/slop.cpp View File

@@ -226,6 +226,8 @@ slop::SlopSelection slop::GLSlopSelect( slop::SlopOptions* options, bool* cancel
226 226
         
227 227
         int i;
228 228
         // We have our clean buffer, now to slather it with some juicy shader chains.
229
+        glEnable( GL_BLEND );
230
+        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
229 231
         for (i=0;i<=(int)shaders.size()-2;i+=2) {
230 232
             pingpong->bind();
231 233
             glClearColor (0.0, 0.0, 0.0, 0.0);
@@ -249,6 +251,7 @@ slop::SlopSelection slop::GLSlopSelect( slop::SlopOptions* options, bool* cancel
249 251
             window->framebuffer->draw(slop::mouse->getMousePos(), elapsed.count()/1000.f, glm::vec4( options->r, options->g, options->b, options->a ) );
250 252
             pingpong->unbind();
251 253
         }
254
+        glDisable( GL_BLEND );
252 255
         if ( i%2 != 0 ) {
253 256
             window->framebuffer->draw(slop::mouse->getMousePos(), elapsed.count()/1000.f, glm::vec4( options->r, options->g, options->b, options->a ) );
254 257
         } else {