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
 
21
 
22
 include_directories("${PROJECT_BINARY_DIR}")
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
 # The names have to be unique unfortunately.
26
 # The names have to be unique unfortunately.
27
 set(EXECUTABLE_NAME "slop")
27
 set(EXECUTABLE_NAME "slop")

+ 3
- 0
src/slop.cpp View File

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