Results 1 to 5 of 5

Thread: Rendering quality of graphics primitives

  1. #1
    Member Newbie
    Join Date
    Apr 2009
    Posts
    35

    Rendering quality of graphics primitives

    I come from a Java background and I am curious as to why the rendering of primitives like lines, ellipses and curves in OpenGL results in a much coarser appearance than with a CPU-based graphics toolkit like Java2D. Even when using multisampling and with the maximum antialiasing settings configured in the graphics card driver, Java2D consistently renders these primitives much smoother.

    Is there some inherent reason why rendering of basic graphics is of poorer visual quality in OpenGL? I don't quite understand because surely both are addressing the same frame buffer and manipulating the same pixels?

  2. #2
    Senior Member OpenGL Lord
    Join Date
    Mar 2015
    Posts
    6,674

    Re: Rendering quality of graphics primitives

    First, this has nothing to do with OpenGL per-se. You'd get the same results from D3D. This has to do with graphics cards.

    Second, graphics cards do not specialize in rendering lines, curves, and ellipses. They specialize in rendering triangles that use programs run locally on the GPU to generate the vertex data and pixel data of those triangles. I'm guessing that Java2D isn't very good at doing that.

    What matters to graphics cards is that particular situation: triangle rendering with programs that determine what the output is like. Drawing a line with a particular color is not something they spend a lot of silicon on.

    Third, graphics card makers care about performance first and foremost. Can you render a complex Java2D scene at 75fps, where you're pulling from hundreds of megabytes of image data per frame? I rather doubt it.

    Graphics card makers simply do not care about high-quality line antialiasing. That kind of specialized scan conversion is simply not an important case for cards that are primarily meant to play games on.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,651

    Re: Rendering quality of graphics primitives

    Quote Originally Posted by Qu0ll
    I come from a Java background and I am curious as to why the rendering of primitives like lines, ellipses and curves in OpenGL results in a much coarser appearance than with a CPU-based graphics toolkit like Java2D.
    Have you tried:

    Code :
    glEnable (GL_LINE_SMOOTH);
    glEnable (GL_BLEND);
    glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glHint (GL_LINE_SMOOTH_HINT, GL_NICEST);
    glLineWidth (1.5);

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,651

    Re: Rendering quality of graphics primitives

    Quote Originally Posted by Alfonse Reinheart
    Graphics card makers simply do not care about high-quality line antialiasing. That kind of specialized scan conversion is simply not an important case for cards that are primarily meant to play games on.
    Alfonse, this is just flat false. The entire world isn't games. You forget (or don't realize) that CAD/DCC is a big market for GPU vendors. Since the early days of high-end graphics cards, line AA has been supported. I believe this has been pushed down to the low end as well. There's nothing super hard about it.

  5. #5
    Senior Member OpenGL Lord
    Join Date
    Mar 2015
    Posts
    6,674

    Re: Rendering quality of graphics primitives

    Since the early days of high-end graphics cards, line AA has been supported. I believe this has been pushed down to the low end as well.
    You will note that I said "high-quality line antialiasing." What you get with GL_LINE_SMOOTH is not high-quality compared to any decent software 2D rasterizer.

    Hardware line scan conversion is functional, not good.

Similar Threads

  1. Question about rendering quality
    By Omar Bsoul in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-25-2018, 06:04 AM
  2. How does WebGL achieve such high quality rendering?
    By Qu0ll in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-02-2013, 01:30 PM
  3. Poor rendering quality with FBOs
    By Luhtor in forum OpenGL: Advanced Coding
    Replies: 13
    Last Post: 12-12-2007, 11:36 AM
  4. Changing Window Bounds; Quality Volume Rendering SDK
    By ericgorr in forum OpenGL: macOS
    Replies: 1
    Last Post: 05-21-2006, 01:57 PM
  5. Quality and Speed on Font rendering
    By lsdi in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 11-20-2002, 04:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean