Ver código fonte

shader chains now properly blend their alpha.

naelstrof 7 anos atrás
pai
commit
adf7329671
2 arquivos alterados com 4 adições e 1 exclusões
  1. 1
    1
      CMakeLists.txt
  2. 3
    0
      src/slop.cpp

+ 1
- 1
CMakeLists.txt Ver arquivo

@@ -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 Ver arquivo

@@ -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 {