Giter VIP home page Giter VIP logo

Comments (3)

cansik avatar cansik commented on June 6, 2024

Thank you for reporting. Would it be possible to share a minimal sketch which recreates this bug so I can test it?

from processing-postfx.

DankMatterCH avatar DankMatterCH commented on June 6, 2024

Hey, thanks for the quick reply!
I think I have located the cause in the image feedback loop to get afterimages - When this is enabled, the issue occurs.

import ch.bildspur.postfx.builder.*;
import ch.bildspur.postfx.pass.*;
import ch.bildspur.postfx.*;

PostFX fx;

PImage c;

int firstcycle;

//afterimage settings
float tracerScaling = 0.97;
float trOffsetX = 6;
float trOffsetY = -6;

  void setup() {
    
      size(1024, 1024, P2D);
      fx = new PostFX(this,1024,1024);
      
      firstcycle = 1;
  
  }   //end setup
  
  
  void draw() {
    
      background(0,0,0,0);
      frameRate(30);
      stroke(255);
      
      //draw a white rectangle
      rect(312,312,400,400);
          
      //this seeems to be causing trouble V
            
            //disable image pull on 1st cycle to avoid null pointer
            if(firstcycle == 1){
              firstcycle = 0;
            }
            else{
             //do scaling and translation of image, then display it
             c.resize(round(width*tracerScaling),round(height*tracerScaling));
              imageMode(CENTER);
              image(c,height/2+trOffsetX,width/2+trOffsetY);
            }
            
            c = get(); // make a screenshot
      
      // add bloom filter 
      fx.render()
        .sobel()
        .bloom(0.5 , 20 , 30)
        .compose();    
        
  } // draw end

from processing-postfx.

cansik avatar cansik commented on June 6, 2024

The problem is the imageMode(CENTER);, which is then also used in compose to draw the buffer to the screen. I would suggest to add the following line:

...
    c.resize(round(width*tracerScaling), round(height*tracerScaling));
    imageMode(CENTER);
    image(c, height/2+trOffsetX, width/2+trOffsetY);
    // set image mode back to corner
    imageMode(CORNER);
  }
...

This should already fix it.

from processing-postfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.