Skip to content

internal lines of shapes are visible with smooth() and P3D or OPENGL #92

Closed

Description

@processing-bugs

Original author: b...@processing.org (June 07, 2010 00:30:08)

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

Comment from fry, 2005-11-04 05:00

most basic case, with smooth turned on a rect sometimes has a diagonal line
through it.

need to keep track of what edge vertices are internal, and not smooth them.
perhaps the opengl tessellator even does this on its own?

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

Activity

  1. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 00:30:09
    Comment from fry, 2005-11-04 05:02

    this is a general problem with 3D rendering, and may be a bit difficult to fix.

  2. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 00:30:11
    Comment from Ricard, 2005-11-28 17:06

    (In reply to comment #1)

          Additional Comment #1 From 
          fry
          2005-11-04 05:02 
    
          <!-- 
            addReplyLink(1); //-->[reply]
    
    
    
    
      this is a general problem with 3D rendering, and may be a bit
    

    difficult to fix.

    Have additional information on this. Try this code and you'll see what I mean:

    import processing.opengl.*;

    float t = 0;

    void setup(){
    size(500,500,OPENGL);
    framerate(24);
    background(255);
    smooth();
    fill(0);
    stroke(0);
    }

    void draw(){
    translate(width/2,height/2);
    background(255);

    rotateX(PI/54*t); // COMMENTING REMOVES CONTOURS' FLICKERING EFFECT
    t++;

    noSmooth();
    noStroke();
    beginShape(TRIANGLE_STRIP);
    vertex(20,20);
    vertex(100,20);
    vertex(20,100);
    vertex(200,100);
    endShape();

    beginShape(TRIANGLE_STRIP);
    vertex(200,100);
    vertex(100,20);
    vertex(200,20);
    vertex(150,0);
    endShape();

    smooth(); // COMMENTING REMOVES LINES INSIDE AND BETWEEN STRIPS
    stroke(255,0,0);
    beginShape(LINE_STRIP);
    vertex(20,20);
    vertex(20,100);
    vertex(200,100);
    vertex(200,20);
    vertex(150,0);
    vertex(100,20);
    vertex(20,20);
    endShape();
    }

    I use code similar to this one in order to avoid such effect in Linux. It
    sounds weird but in Linux this effect is less visible, althought still
    there when rotating any of the axis (mostly when rotating around X and Y).

    The basic idea is to turn off smoothing when drawing meshes and turn it
    back on to draw the contour. Well, it appears to be a problem when turning
    smoothing off and back on during one same frame. The result is that only
    the last call of smooth is taken into account for everything.

    This seems normal if we don't keep any information about smoothing on the
    vertices themselves and they are not drawn until the end of the frame (in
    order to take into account Z-ordering and maybe other stuff, I don't know).

    Should the information about smoothing be kept on the vertices and
    triangles, the same way as light, colour,...? is this already done?
    (haven't dived into the code, to check myself).

    A second problem (don't know if it's a separate bug or not, so I keep it
    here just in case) is about the flickering of the contour, when rotating
    the polygon around the x axis. Has this something to do with this bug?

    Does this help or is this just a bunch of more questions?? jeje

    well, it's a quite nasty bug for my library. So I'll keep looking into it
    once I get some time (won't be before mid december, though).

  3. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 00:30:12
    Comment from fry, 2005-11-28 17:26

    This seems normal if we don't keep any information about smoothing on the
    vertices themselves and they are not drawn until the end of the frame (in
    order to take into account Z-ordering and maybe other stuff, I don't know).

    yes, generally this is how it would work, it just takes time to rework the renderer to make it
    happen.

  4. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 00:30:13
    Comment from njetti, 2005-12-01 20:34

    I think OpenGL can't even draw a rect properly:

    import processing.opengl.*;
    void setup(){
    size(400,400, OPENGL);
    for(int i=0; i < 10; i++){
    rect(random(width), random(height), random(10, 30),random(10,30));
    }
    }

  5. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 00:30:14
    Comment from fry, 2007-02-03 09:08

    this is on the list for the 1.0 release.

  6. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 00:30:15
    Comment from Eric F., 2008-08-11 13:28

    workaround: use hint(ENABLE_OPENGL_4X_SMOOTH) in conjunction with global
    noSmooth().

    although seemingly illogical, perhaps the reason it works may help track down source
    of problem? i'm not really qualified to say...

  7. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 00:30:16
    Comment from fry, 2008-08-11 18:10

    The cause of the problem is known (we need to shut off anti-aliasing on
    internal lines), it's just a good bit of work to handle the implementation
    (+ across each of the renderers). This is slated for 1.0, meaning that it
    should be done before the fall.

  8. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 00:30:17
    Comment from Cedric, 2009-03-21 16:35

    its still not solved, right ?

  9. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 00:30:18
    Comment from dlp, 2009-07-21 21:59

    Yeah, I'm still seeing this with P3D on 1.0.1, OS 1.5.7. I thought this was
    supposed to be fixed by now? Is there any workaround?

  10. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 00:30:20
    Comment from fry, 2009-07-22 14:00

    No, the bug is not fixed yet. When fixed, the status will be marked as
    "fixed", and it will be noted in the changes document with a new release.

    I've not had time to fix it, and nobody else has taken the time to do it
    themselves.

  11. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From matteosi...@gmail.com on August 10, 2011 20:32:47
    Have some progress been made regarding this issue? I don't seem to observe this issue with P3D in the rendered sketch window, but when I save to PDF with beginRaw(PDF...) I do see the triangle edges in the pdf...

    Has it perhaps been fixed on some renderers but not pdf?

  12. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From andres.c...@gmail.com on August 11, 2011 15:53:29
    Are you referring to P3D in Processing 1.5.x or older?

  13. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From evanras...@gmail.com on January 02, 2012 17:28:46
    I am seeing this issue in 2.04a on OS X - just drawing an image using the P3D renderer shows very thin white outlines around the 2 triangles that make it up, as does all textured shapes drawn with beginShape(). As said above, using noSmooth() before drawing images (simply using image() with noStroke() before it) and textured shapes (using beginShape(); texture(someImage); vertex (...); endShape(); ) gets rid of the lines.

  14. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From michael....@gmail.com on March 05, 2012 08:40:56
    Hi,

    I'd like to take a look at the issue, although I'm quite new to the internals of processing but quite experienced in Java. Could someone give me general hints on the source of the error?

    Cheers,
    Michael

  15. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From f...@processing.org on March 07, 2012 22:50:56
    The previous issue was that anti-aliasing was happening on shapes that were directly adjacent (the tessellated triangles of a polygon, for instance). In 2.0, we don't do GL anti-aliasing at all, and it's just 2x or 4x (or whatever) full-screen anti-aliasing, so it may not be an issue anymore (It should be pixel accurate b/c no AA is used, just FSAA which should be more pixel accurate because it starts aliased). Or if it is, then the reason it's still a problem at that scale needs to be determined.

  16. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From f...@processing.org on November 19, 2012 22:15:23
    Closing this bug, because it should be fixed in more recent releases (2.0 beta 6 as I write this).

    If not, please file a new bug report and include:

    • the simplest piece of code that reproduces the problem
    • what OS you're using (and what version)
    • what video card you're using
    • what drivers you're using (if on Windows or Linux)

    Thanks!

  17. 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.

  18. 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

    corecriticalimported

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions