[Fixed] Abnormal line graph behavior

Testing and discussion of the conversion of Rainmeter to D2D.
User avatar

[Fixed] Abnormal line graph behavior

July 26th, 2018, 1:55 am
raiguard
   [384 posts]

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



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.
User avatar

Re: Abnormal line graph behavior

July 30th, 2018, 7:21 pm
jsmorley
Developer   [17820 posts]

Does the latest alpha do a better job?
User avatar

Re: Abnormal line graph behavior

July 30th, 2018, 8:32 pm
raiguard
   [384 posts]

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.
User avatar

Re: Abnormal line graph behavior

August 9th, 2018, 10:47 am
jsmorley
Developer   [17820 posts]

Can you re-test and let us know if the r3224 alpha fixes the issues?
User avatar

Re: Abnormal line graph behavior

August 12th, 2018, 9:29 pm
raiguard
   [384 posts]

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:
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.
Attachments
LineGraphTest_1.1.0.rmskin
(3.25 KiB) Downloaded 2 times
User avatar

Re: Abnormal line graph behavior

August 12th, 2018, 9:45 pm
raiguard
   [384 posts]

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?
User avatar

Re: Abnormal line graph behavior

August 13th, 2018, 5:42 am
Brian
Developer   [1719 posts]

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

Return to “Rainmeter 4.3 Alpha Test”



Who is online

Users browsing this forum: No registered users and 1 guest