bugGNU Octave - Bugs: bug #41819, Qt plotting toolkit anti-aliasing...

 
 

bug #41819: Qt plotting toolkit anti-aliasing support lacking on some graphics cards

Submitted by:  Allan Jacobs <allanjacobs>
Submitted on:  Mon 10 Mar 2014 12:20:57 AM UTC  
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  allanjacobs Open/Closed:  Closed
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Wed 10 May 2017 04:12:21 PM UTC, comment #12: 

I'm still facing this issue, on both an AMD RX 800 and a GeForce GT 630M.


Alexander Wilms <alexanderw>
Fri 30 Jan 2015 05:59:36 AM UTC, comment #11: 

Okay, I checked in the change on the gui-release branch (http://hg.savannah.gnu.org/hgweb/octave/rev/5d1c7e967742).  Closing report.

Rik <rik5>
Project Administrator
Thu 29 Jan 2015 04:56:01 AM UTC, comment #10: 

@Rik: your patch fixes the problem for me. Comparing various plot demos between FLTK and Qt, the plot quality looks the same to me with this patch applied on the gui-release branch.

Mike Miller <mtmiller>
Project Administrator
Tue 29 Apr 2014 07:27:13 PM UTC, comment #9: 

Is there a Qt wizard who knows how to turn on GL_MULTISAMPLE?  This should be an easy argument to OR in to the list of properties when a window is created.

The corresponding lines from _init_fltk_.cc are

class OpenGL_fltk : public Fl_Gl_Window
{
public:
  OpenGL_fltk (int xx, int yy, int ww, int hh, double num)
    : Fl_Gl_Window (xx, yy, ww, hh, 0), number (num), renderer (),
      in_zoom (false), zoom_box (),  print_mode (false)
  {
    // Ask for double buffering and a depth buffer.
    mode (FL_DEPTH | FL_DOUBLE | FL_MULTISAMPLE);
  }

and

canvas->mode (FL_DEPTH | FL_DOUBLE | FL_MULTISAMPLE);

I'm attaching a changeset that I think does the right thing, but I don't have a good way to verify it.  It may be that we not only need to turn on SampleBuffers (a.ka. multisampling), but also set the SampleBuffer size to 4 or 8.  Someone who knows more than I do should look at this patch and decide.

(file #31274)

Rik <rik5>
Project Administrator
Thu 13 Mar 2014 04:38:14 PM UTC, comment #8: 

Thanks for confirming Daniel. Let's leave this bug about the Qt toolkit, since that was what the original reporter was using and and since the anti-aliasing is definitely lacking there compared to FLTK.

If you would like to open a separate bug report about further improving the appearance with the FLTK toolkit (based on your last set of screenshots), feel free to do so.

Mike Miller <mtmiller>
Project Administrator
Thu 13 Mar 2014 03:40:06 PM UTC, comment #7: 

I've upgraded to the 3.8.1 release.  It looks better, but it's still buggy.  The Xs have a different weight on each diagonal.  I'm attaching four screenshots, showing the differences between gnuplot and fltk. 

The command I used for the Xs was:

>plot(x, y, 'x', 'MarkerSize', 10);


for the sin curve it was:

> plot (x, sin (x));


The sin curve is just for reference, as it looks fine, although the antialiasing could look a bit smoother.


Daniel <ddshore>
Thu 13 Mar 2014 04:53:23 AM UTC, comment #6: 

And to clarify, anti-aliasing with the FLTK toolkit was fixed in the 3.8.1 release, not 3.8.0. The Qt toolkit is introduced on the 3.9 development branch and is the default only when using the GUI.

Mike Miller <mtmiller>
Project Administrator
Thu 13 Mar 2014 04:49:16 AM UTC, comment #5: 

I can confirm this here. This does indeed look like the bad anti-aliasing behavior on certain video drivers. We first saw this issue with the FLTK plotting backend, which was fixed with the patch that Jordi is referring to. The new Qt plotting backend does not have the equivalent patch made to it yet, and it appears to have the same effect for some of us.

As a workaround, you can use "graphics_toolkit fltk" until this is fixed for the Qt backend. Note that the Qt toolkit is new, hence this is not a regression, you simply need to use the FLTK toolkit that is the default in the 3.8 series.

I'm retitling this bug to more broadly describe the situation and solution needed.

Mike Miller <mtmiller>
Project Administrator
Thu 13 Mar 2014 04:38:00 AM UTC, comment #4: 

$ hg id
b83fca22bb4c @
$ octave -version
GNU Octave, version 4.1.0+

This is for the dev build.  Is a patch relevant?

Allan Jacobs <allanjacobs>
Wed 12 Mar 2014 02:43:50 PM UTC, comment #3: 

> Source code pulled, compiled, and installed on March 9, 2014.


It's better if your report "hg id" instead, since there are three different branches you could have built.

Other than that, I'm unable to reproduce this. Are you both already using patch #8259 ? I suspect it's another symptom of bad anti-aliasing.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Wed 12 Mar 2014 01:05:33 AM UTC, comment #2: 

Just noticed that if I select gnuplot as my graphics toolkit it works fine, if I use fltk I get the poor rendering. 

Daniel <ddshore>
Wed 12 Mar 2014 12:53:25 AM UTC, comment #1: 

I'm having the same error, on octave 3.8.0. 

The difference is that if I plot ro it'll also be rendered incorrectly.

The rendering will vary depending on the zoom level, but overall, it's pretty bad.  I've attached four examples.  I've also tried plotting with gnuplot, and it renders fine. 

Even if I try to plot a sin curve, the rendering will be choppy.


Daniel <ddshore>
Mon 10 Mar 2014 12:20:57 AM UTC, original submission:  

$ octave --version
GNU Octave, version 4.1.0+

Source code pulled, compiled, and installed on March 9, 2014.  The input data and a screenshot are attached.  I'll attach a screenshot using 3.6.4 later.

Changing the fmt from 'rx' to 'ro' yields a plot which looks correct.  The badness with 'rx' stems from drawing the back stroke of the 'X' ('') in a position different from the forward stroke ('/').

function plotData(x, y)
%PLOTDATA Plots the data points x and y into a new figure
%   PLOTDATA(x,y) plots the data points and gives the figure axes labels of
%   population and profit.
% ====================== YOUR CODE HERE ======================
% Instructions: Plot the training data into a figure using the
%               "figure" and "plot" commands. Set the axes labels using
%               the "xlabel" and "ylabel" commands. Assume the
%               population and revenue data have been passed in
%               as the x and y arguments of this function.
%
% Hint: You can use the 'rx' option with plot to have the markers
%       appear as red crosses. Furthermore, you can make the
%       markers larger by using plot(..., 'rx', 'MarkerSize', 10);
figure; % open a new figure window
plot(x, y, 'rx', 'MarkerSize', 10);         % Plot the data
ylabel('Profit in $10,000s');               % Set the y-axis label
xlabel('Population of City in 10,000s');    % Set the x-axis label
% ============================================================
end
data = load('ex1data1.txt');
X = data(:, 1); y = data(:, 2);
m = length(y); % number of training examples
plotData(X, y);

Allan Jacobs <allanjacobs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #40653:  aliasing.png added by alexanderw (36KiB - image/png)
file #31274:  qt_multisample.cset added by rik5 (823B - application/octet-stream)
file #30841:  goodx.png added by allanjacobs (7KiB - image/png - goodx.png is what the data looks like using Octave 3.6.4.)
file #30839:  ex1data1.txt added by allanjacobs (1KiB - text/plain)
file #30840:  badx.png added by allanjacobs (15KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by alexanderw (Updated the item)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by ddshore (Updated the item)
  • -email is unavailable- added by allanjacobs (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 20 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-05-10 alexanderw Attached File- => Added aliasing.png, #40653
    2015-01-30 rik5 StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2014-04-29 rik5 Attached File- => Added qt_multisample.cset, #31274
        StatusConfirmed => Ready For Test
    2014-03-13 ddshore Attached File- => Added Screenshot from 2014-03-13 09:15:17.png, #30881
        Attached File- => Added Screenshot from 2014-03-13 09:27:16.png, #30882
        Attached File- => Added Screenshot from 2014-03-13 09:16:39.png, #30883
        Attached File- => Added Screenshot from 2014-03-13 09:27:27.png, #30884
    2014-03-13 mtmiller Item GroupRegression => Feature Request
        StatusNeed Info => Confirmed
        SummaryPlot function misdraws plots given an \'x\' in plot fmt argument. => Qt plotting toolkit anti-aliasing support lacking on some graphics cards
    2014-03-12 jordigh StatusNone => Need Info
    2014-03-12 ddshore Attached File- => Added Screenshot from 2014-03-11 18:46:51.png, #30864
        Attached File- => Added Screenshot from 2014-03-11 18:47:05.png, #30865
        Attached File- => Added Screenshot from 2014-03-11 18:47:21.png, #30866
        Attached File- => Added Screenshot from 2014-03-11 18:47:45.png, #30867
    2014-03-10 allanjacobs Attached File- => Added goodx.png, #30841
    2014-03-10 allanjacobs Attached File- => Added ex1data1.txt, #30839
        Attached File- => Added badx.png, #30840

    Back to the top


    Powered by Savane 3.5