sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    View.draw2d(GL_POINTS, pts) on ATI with AA

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 308 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

      I just came across something odd. I'd been working on a tool - using my home computer with an nVidia card. Everything working fine. Drawing a series of points on screen.
      But when I tested it at work - nothing appeared. Cut a long story short, when using view.draw2d(GL_POINTS, pts) on an ATI card with AA on, the X and Y co-ords must be in the centre of the pixel.

      So instead of [20, 30, 0], one must add half a pixel: [20.5, 30.5, 0] to ensure it's drawn on all cards.

      My computer at work had an ATI Radeon 2X something something - latest drivers etc. Windows7 64bit. I tried with my old computer at home, Vista 32bit, ATI Radeon 9800 - older drivers - same issue.
      When I turned AA off the points where drawn fine - but it's only when AA was on.

      nVidia cards I tested draw the points no matter what.

      Seeing how this appear ATI cards in general, not just one model or driver version - is it ATI's implementation that's bugged, or could it be something in SketchUp?

      Test code:

      
      class PointTest
        
        def onLButtonUp(flags, x, y, view)
          view.invalidate
        end
        
        def draw(view)
          t = Time.now
          32.times { |j|
            32.times { |i|
              view.draw2d(GL_POINTS, [100+i,100+j,0])     # This is not drawn with ATI and AA.
              view.draw2d(GL_POINTS, [100.5+i,200.5+j,0]) # This works in all cases.
            }
          }
          puts "Point Fill Test; #{Time.now - t}"
        end
        
        def deactivate(view)
          view.invalidate
        end
        
      end # class
      
      

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

      1 Reply Last reply Reply Quote 0
      • D Offline
        dacastror
        last edited by

        This happens with other constants? would it happen the same with GL_QUADS or GL_LINE_LOOP?

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

          Yea, think so.

          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