sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    View.draw2d and AA - precision

    Scheduled Pinned Locked Moved Developers' Forum
    12 Posts 2 Posters 489 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • thomthomT Offline
      thomthom
      last edited by

      While experimenting with view.draw2d I noticed a couple of things:

      GL Draw.png
      When drawing lines of odd width one must offset the X and Y coords by 0.5 in order to maintain a sharp line. The coords must be on the centre of the line, even if the pixel coords contains half a pixel.

      For even width one must use whole values.

      Notice that the corner never is sharp when drawing with GL_LINE_LOOP.
      GL_LINE_LOOP - 9px width

      Then you have the drawing of points:
      When AA is on - the points become drawn fuzzy. Even if you offset. There does not appear to be a way by using the SU Ruby API to draw sharp 1px points. (Using GL_POINTS)

      No offset - Integer co-ord values

      Co-ords offset by .5

      When AA is off, then the 1px points appear sharp and in exactly the colour one specify.
      No AA

      I really wish there was a way I could draw 1px points - sharp - without the AA fuzzing it up. I'd appreciate if anyone has any ideas. Or even some insight to how OpenGL treats screen coordinates.

      Thomas Thomassen β€” SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        pixel paint.png

        See how the pixel is blurred no matter what? 😞

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          I just noticed that ATI cars, while they don't draw points where the X and Y is whole numbers, they do draw the pixel sharply.

          The first set of icons are drawn with GL_POINTS - same method the turned blurred on nVidia.

          The second set is pixels drawn with GL_LINES - which is slower, but draws sharply on both nVidia and ATI.

          If only I could detect the make and AA settings of SU from Ruby...


          GL_POINTS vs GL_LINES - ATI Radeon HD 4870 X2

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • Chris FullmerC Offline
            Chris Fullmer
            last edited by

            I can confirm that the ATI machine I am on draws sharp edges always. On some stuff I've been working on, my nVidia card draws fuzzy edges, but this ATI mcahine is drawing those same edges as sharp.

            Chris

            Lately you've been tan, suspicious for the winter.
            All my Plugins I've written

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              All edges?

              Thomas Thomassen β€” SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • Chris FullmerC Offline
                Chris Fullmer
                last edited by

                It is the edges around my gradient boxes that are coming out as sharp on this machine. I am not drawing any single pixels anymore at this point. So yeah, just edges. But they definietly come out different than they do on my nvidia card at home.

                Chris

                Lately you've been tan, suspicious for the winter.
                All my Plugins I've written

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  @chris fullmer said:

                  It is the edges around my gradient boxes that are coming out as sharp on this machine. I am not drawing any single pixels anymore at this point. So yeah, just edges. But they definietly come out different than they do on my nvidia card at home.

                  Chris

                  Even if they are not offset 0.5?

                  See my last screenshot - the top rectangle is 1px with whole number values. It's fuzzy. (not as fuzzy as on nVidia - but the colour is fainter.) The next one, is offset 0.5.

                  What cards have you tried? And what OS?

                  Thomas Thomassen β€” SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

                  1 Reply Last reply Reply Quote 0
                  • Chris FullmerC Offline
                    Chris Fullmer
                    last edited by

                    it is an 128mb ATI Radeon X600 SE on Win XP.

                    It appears to be drawing a solid single pixel line. But I have no screen capture utility or anything like photoshop to magnify and inspect the line work. After work tonight I'll install jing and get a good screen capture shoing what it looks like, then you can decide what it really is doing.

                    Chris

                    Lately you've been tan, suspicious for the winter.
                    All my Plugins I've written

                    1 Reply Last reply Reply Quote 0
                    • Chris FullmerC Offline
                      Chris Fullmer
                      last edited by

                      And I see that there is no AA turned on in SU (or when I got to the Preference > OPEN_GL tab is says aa=0x)

                      Lately you've been tan, suspicious for the winter.
                      All my Plugins I've written

                      1 Reply Last reply Reply Quote 0
                      • thomthomT Offline
                        thomthom
                        last edited by

                        Ah! No AA. Does it not have any AA option?

                        @chris fullmer said:

                        After work tonight I'll install jing and get a good screen capture shoing what it looks like, then you can decide what it really is doing.
                        video? is it not easier to just PrntScrn?

                        Thomas Thomassen β€” SketchUp Monkey & Coding addict
                        List of my plugins and link to the CookieWare fund

                        1 Reply Last reply Reply Quote 0
                        • Chris FullmerC Offline
                          Chris Fullmer
                          last edited by

                          Jimg makes great .png screen captures and saves them to the desktop. Lets you specify a window size, etc. Add comments, arrows and lines on it afterwards.

                          For prntscrn, I don't have any app I can paste it into and edit it on this computer. Its like the stone age of computers in this house I'm staying at πŸ˜„

                          No, there was no option avaiable to turn on aa. Maybe I can do it through the video card first? And then it might be available in SU? This is an area I never get into because I have never really cared about how smooth the detail is on my games πŸ˜„ But maybe I should figure it out since it also pertains to SketchUp.

                          Chris

                          Lately you've been tan, suspicious for the winter.
                          All my Plugins I've written

                          1 Reply Last reply Reply Quote 0
                          • thomthomT Offline
                            thomthom
                            last edited by

                            hmm... I can use the SU preferences to detect the AA settings of SU. On Windows it's under GLConfig > Display. Then I need to locate that on OSX.

                            Only thing is that reading registry requires more files and makes for more complicated dependabilities.
                            And I don't get the make of the card from SU's prefs... πŸ˜•

                            Thomas Thomassen β€” SketchUp Monkey & Coding addict
                            List of my plugins and link to the CookieWare fund

                            1 Reply Last reply Reply Quote 0
                            • 1 / 1
                            • First post
                              Last post
                            Buy SketchPlus
                            Buy SUbD
                            Buy WrapR
                            Buy eBook
                            Buy Modelur
                            Buy Vertex Tools
                            Buy SketchCuisine
                            Buy FormFonts

                            Advertisement