It is currently December 10th, 2018, 6:37 pm

[Fixed] Abnormal line graph behavior

Testing and discussion of the conversion of Rainmeter to D2D.
User avatar
raiguard
Posts: 493
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

[Fixed] Abnormal line graph behavior

raiguard » July 26th, 2018, 1:55 am

Line graphs now have a vastly different look to them. While at first I didn't consider it a bug (there are bound to be some small differences between GDI+ and Direct2D), when I blew up a simple line graph to a large size, it shows that the behavior between the two versions is different enough to merit a report.

Code: Select all

[Rainmeter]
MiddleMouseUpAction=[!Refresh]
AccurateText=1
Update=50

[Variables]

[MeasureCpuUsage]
Measure=CPU

[MeterBackground]
Meter=Image
SolidColor=50,50,50
W=500
H=110

[MeterTestLineGraph]
Meter=Line
LineCount=1
LineColor=255,100,100
MeasureName=MeasureCpuUsage
X=5
Y=5
W=490
H=100
LineWidth=3
Antialias=0
2018-07-25 19_54_00-.png
4.2 on the top, 4.3 on the bottom.

It appears that the line graph is doing some sort of automatic smoothing between points, to the point where it looks less like a single line and more like a radio interference graph. When the line width is 1 and the graph is smaller, you can see that it produces a "chunky" graph when compared with 4.2:
2018-07-25 19_35_56-D__Settings_Caleb_Rainmeter_Skins_ModernGadgets_CPU_CPU.ini.png
4.2 on the right, 4.3 on the left.

This is all with antialiasing turned off, though turning it on will yield similar results.
You do not have the required permissions to view the files attached to this post.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
jsmorley
Developer
Posts: 18445
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Abnormal line graph behavior

jsmorley » July 30th, 2018, 7:21 pm

Does the latest alpha do a better job?
User avatar
raiguard
Posts: 493
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Abnormal line graph behavior

raiguard » July 30th, 2018, 8:32 pm

I'll see what I can remember from when I did two minutes of testing before going to work this morning.

The "line" is now more defined (and no longer extends past the defined height of the meter), but the peaks and valleys are still exibiting different behavior. When I use the meter at linewidth 1, all of the peaks and valleys still take up two pixels of width. I'll do more testing once I get home (~5 hours) and get back to you.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
jsmorley
Developer
Posts: 18445
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Abnormal line graph behavior

jsmorley » August 9th, 2018, 10:47 am

Can you re-test and let us know if the r3224 alpha fixes the issues?
User avatar
raiguard
Posts: 493
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Abnormal line graph behavior

raiguard » August 12th, 2018, 9:29 pm

Sorry for the late response. I have been super busy at work so I have not had motivation to do Rainmeter-related stuff for a while. But I'm back now!

Anyway, I decided to expand upon my test skin to make things more consistent. Specifically, I created a little script that will consistently populate the line graph with a predefined set of data, allowing for more direct comparisons. Since it now involves multiple files, I packaged it into a .RMSKIN, that I will attach to this post.

Here is a comparison of different sizes of line graphs with different settings:
2018-08-12 15_44_27-D__Settings_Caleb_Rainmeter_Skins_LineGraphTest_LineGraphTest.ini.png
4.2 on the left, 4.3 on the right.

As you can see, there are small differences in the peaks and valleys in how the line is drawn. It's very minor, but it causes lots of visual discrepancies on line graphs with small heights and widths (see the one on the bottom of the skin).

Let me know if you need any more details from my end.

EDIT: Upon closer investigation it appears that the 4.2 and 4.3 antialiased line graphs look almost identical...

EDIT 2: Updated with an antialiased version of the small graph.
You do not have the required permissions to view the files attached to this post.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
raiguard
Posts: 493
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Abnormal line graph behavior

raiguard » August 12th, 2018, 9:45 pm

Update on the antialiased observation: The antialiased graphs between 4.2 and 4.3 are almost 100% identical. Additionally, I have noticed that the antialiased and aliased graphs on 4.3 look very similar (as in the peaks and valleys have similar shapes). On 4.2, there is a definite difference in the line shape between antialiased and aliased.

Perhaps Rainmeter is performing half of the antialiasing steps on aliased graphs (i.e. smoothing the line itself) even when antialias is turned off on the meter?
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
Brian
Developer
Posts: 1793
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Abnormal line graph behavior

Brian » August 13th, 2018, 5:42 am

This should be fixed as of r3231. Thanks for all your testing!

The problem turned out to be that D2D draws using the stroke located in the center of a pixel, so we had to add an offset of a half of pixel to the drawing coordinates. The D2D anti-aliasing might be a little clearer than the GDI+ version as well, but should look nearly identical.

I think this is as close as we are going to get. There might be a few extra pixels here and there, especially at the peaks and valleys, but nothing too drastic (hopefully :D).

Also, the HorizontalLines option was off by a little as well, which is fixed as well. And its anti-aliasing will look a lot sharper than GDI+ version, but I see that as an improvement.

-Brian
User avatar
raiguard
Posts: 493
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: [Fixed] Abnormal line graph behavior

raiguard » August 16th, 2018, 4:25 pm

I can indeed confirm that this has been fixed! Thanks for all your work. :D
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017