Skip to content

OpenGL jitter #232

Closed
Closed

Description

@processing-bugs

Original author: b...@processing.org (June 07, 2010 01:16:56)

This bug automatically added from:
http://dev.processing.org/bugs/show_bug.cgi?id=1359

Comment from sonic, 2009-10-22 11:47

Using the OpenGL renderer results in curves with occasional 'jumping'
lines. Switching to the default renderer eliminates the problem. I'm using
Processing 1.0.9 on a Mac Pro quad core tower, OS 10.5.8, ATI Radeon HD
2600 XT graphics card. (You might have to watch for a couple minutes to see
the behavior.)

import processing.opengl.*;

void setup() {
size(720, 720, OPENGL);
frameRate(40);
smooth();
}

float a = random(-1, 1);
float b = random(-1, 1);
float c = random(-1, 1);
float d = random(-1, 1);
float e = random(-1, 1);
float f = random(-1, 1);
float g = random(-1, 1);
float h = random(-1, 1);

void draw() {
background(75, 60, 85);

a = a + .002;
b = b + .0025;
c = c + .001;
d = d + .0015;
e = e + .0005;
f = f + .003;
g = g + .0035;
h = h + .0015;

noStroke();
fill(20, 220);
curve(width/2+sin(b)(width/2+100), width/2+sin(c)(width/2+100),
width/2+sin(d)(width/2+100), width/2+sin(e)(width/2+100),
width/2+sin(f)(width/2+100), width/2+sin(g)(width/2+100),
width/2+sin(h)(width/2+100), width/2+sin(a)(width/2+100));
}

Original issue: http://code.google.com/p/processing/issues/detail?id=193

Activity

  1. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 01:16:56
    Comment from fry, 2010-02-17 19:25

    what happens, exactly? i wasn't able to reproduce the problem.

  2. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 01:16:57
    Comment from sonic, 2010-02-19 01:59

    (In reply to comment #1)

          Additional Comment #1 From
          fry
          2010-02-17 19:25 
    
          <!-- 
            addReplyLink(1); //-->[reply]
    
    
    
    
    
    
      what happens, exactly? i wasn't able to reproduce the problem.       
    

    The lines, instead of flowing smoothly, jitter, briefly jumping back and
    forth between and old and new position. I'll post a version with more lines

    • maybe it will become more clear. And as I said, you may have to watch
      for a while. My colleague has the same problem and for that reason has
      stopped using OpenGL.

    import processing.opengl.*;

    void setup() {
    size(720, 720, OPENGL);
    frameRate(40);
    smooth();
    }

    float a = random(-1, 1);
    float b = random(-1, 1);
    float c = random(-1, 1);
    float d = random(-1, 1);
    float e = random(-1, 1);
    float f = random(-1, 1);
    float g = random(-1, 1);
    float h = random(-1, 1);

    void draw() {
    background(75, 60, 85);

    a = a + .002;
    b = b + .0025;
    c = c + .001;
    d = d + .0015;
    e = e + .0005;
    f = f + .003;
    g = g + .0035;
    h = h + .0015;

    noStroke();
    fill(20, 220);
    curve(width/2+sin(b)(width/2+100), width/2+sin(c)(width/2+100),
    width/2+sin(d)(width/2+100), width/2+sin(e)(width/2+100),
    width/2+sin(f)(width/2+100), width/2+sin(g)(width/2+100),
    width/2+sin(h)(width/2+100), width/2+sin(a)(width/2+100));
    curve(width/2+sin(c)(width/2+100), width/2+sin(d)(width/2+100),
    width/2+sin(e)(width/2+100), width/2+sin(f)(width/2+100),
    width/2+sin(g)(width/2+100), width/2+sin(h)(width/2+100),
    width/2+sin(a)(width/2+100), width/2+sin(b)(width/2+100));
    curve(width/2+sin(d)(width/2+100), width/2+sin(e)(width/2+100),
    width/2+sin(f)(width/2+100), width/2+sin(g)(width/2+100),
    width/2+sin(h)(width/2+100), width/2+sin(a)(width/2+100),
    width/2+sin(b)(width/2+100), width/2+sin(c)(width/2+100));
    curve(width/2+sin(e)(width/2+100), width/2+sin(f)(width/2+100),
    width/2+sin(g)(width/2+100), width/2+sin(h)(width/2+100),
    width/2+sin(a)(width/2+100), width/2+sin(b)(width/2+100),
    width/2+sin(c)(width/2+100), width/2+sin(d)(width/2+100));
    }

  3. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 01:16:57
    Comment from fry, 2010-02-19 10:18

    how about making a video of it (use saveFrame() to make an image sequence,
    then movie-ify them with quicktime 7) so you can point out where the
    problem is?

  4. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 01:16:57
    Comment from sonic, 2010-02-20 10:33

    OK, I've done that. It should be obvious from watching these two identical
    sequences, one done with OpenGL and the other with the default renderer.

    http://www.mti.dmu.ac.uk/~rherrema/graphics/OpenGL.mov

    http://www.mti.dmu.ac.uk/~rherrema/graphics/Default.mov

  5. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 01:16:58
    Comment from fry, 2010-02-20 11:04

    That looks like a clipping problem--that some of the triangles are actually
    flying past the camera and going missing. Because of their long distances
    toward you, that's why you get the flicker. In P3D, you don't see it,
    because P3D doesn't do clipping properly. OpenGL does clipping, so your
    geometry is getting chopped up (like it should, really).

    A glance at your code looks like that's probably the case, and that you
    actually need to translate backwards from z=0:
    http://processing.org/reference/environment/#Coordinates

  6. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 01:16:58
    Comment from sonic, 2010-02-20 12:59

    (In reply to comment #5)

          Additional Comment #5 From
    
              fry
          2010-02-20 11:04 
    
          <!-- 
            addReplyLink(5); //-->[reply]
    
    
    
    
    
    
      That looks like a clipping problem--that some of the triangles are
    

    actually
    flying past the camera and going missing. Because of their long distances
    toward you, that's why you get the flicker. In P3D, you don't see it,
    because P3D doesn't do clipping properly. OpenGL does clipping, so your
    geometry is getting chopped up (like it should, really).

    A glance at your code looks like that's probably the case, and that you
    actually need to translate backwards from z=0:
    http://processing.org/reference/environment/#Coordinates

    Actually, I do see the flicker when I use P3D. It's only in JAVA2D that I
    don't see it.

    I don't understand what you mean by clipping (in audio it means you've
    exceeded the dynamic range of the system), nor what you mean when you say
    'to translate backwards from z=0. Can you explain or point me in the right
    direction? Of course, my primary goal is simply to produce the smoothest
    graphics possible.

    Thanks.

  7. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 01:16:59
    Comment from fry, 2010-02-20 13:16

    Sorry--I misspoke. You're running into something else. I'll take a look
    into it.

  8. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From andres.c...@gmail.com on November 20, 2012 20:44:04
    Not longer a problem with P2D/P3D in 2.0

  9. github-actions commented on Jun 18, 2021

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  10. locked as resolved and limited conversation to collaborators on Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    highimportedlibrariesmacosx

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions