News: Support us via Flattr FLATTR Link

The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!

 Pages: [1]   Go Down
 Author Topic: "mercator" vs "power of two"  (Read 10205 times) Description: 0 Members and 1 Guest are viewing this topic.
DustyMonkey
Forums Newbie

Posts: 6

 « on: September 28, 2013, 07:50:00 PM »

Investigating the claim that the "mercator projection" zooming technique is faster than the "power of two" zooming technique...

I calculate the "ideal" logarithmic decay factor for the radii of the sampling circles as (samples per circle - pi) / (samples per circle + pi), as with this decay factor the distance (length of the arc, not straight) between the samples along the centroid between sampling circles will equal the distance between the sampling circles, under the assumption that the "ideal" factor will present a local sampling aspect ratio of approximately 1:1 (ie, locally uniform.)

Thats the pertinent math of the mercator system that I am using.

Now what is an equivalence in terms of "quality level" for the "power of two" case, so that the number of samples needed can be compared?

For arguments sake, I suppose that we are doing 256x256 keyframes in the power of two case. The middle 128x128 area need not be calculated per keyframe, as that is covered by the keyframe of the next magnification. The total number of samples per keyframe is thus (256^2 - 128^2) = 49152 samples. I choose the circle with a radius that extends to the mid-points of the blocky edges of this donut-like shape, which has a diameter of (256 + 128) / 2 = 192 pixels.

The circumference of that average circle is thusly pi * 192 = 603.1858.

Heading back to the mercator calculations, the ideal decay factor when taking 603.1858 samples per circle is (603.1858 - pi) / (603.1858 + pi) = 0.9896 and it takes ln(0.5) / ln(0.9896) = 66.3016 sampling circles to reach a doubling of the magnification. The number of pixels needed to be calculated per doubling is thusly (603 * 66.3016) = 39979.8648.

1.0 - (39979.8648 / 49152) = 0.18660757

So, the mercator method can be expected to save approximately 18.66% of the calculation time over the power-of-two method for what I am arguing is the same subjective quality level.

Does anyone see any obvious flaws in my derivation of an 18.66% savings, or have other remarks? (am I off-base with my equivalent quality level estimate?)
 « Last Edit: September 28, 2013, 07:53:01 PM by DustyMonkey » Logged
claude
Fractal Bachius

Posts: 563

 « Reply #1 on: September 28, 2013, 08:40:33 PM »

Thanks for the equation for the decay factor, I'll compare with my implementations to check whether I'm doing the right thing or if I have squashed pixels.

I'd try to measure "quality" by using statistics on the number of calculated samples used for each output pixel in every image between two keyframes.

For a consistent appearance, I'd want each pixel in subsequent frames to be based on the same number of samples as that pixel in previous frames (if the number of samples increases for some frames, that has the same effect as the number of samples decreasing for the other frames, so it's just as bad).  Essentially a non-issue with concentric circles, but concentric box donuts can lead to rhythmic strobing that gets very annoying even if it's subtle.

I'd also want to aim for a consistent number of samples across each pixel in a single frame.  Concentric circles have bigger pixels near the edge and smaller pixels near the middle, so the edges get blurry and the middle gets over-sharp (which is distracting when the eye follows a feature from the middle to the edge).  The box donuts are easier to manipulate to get this right, because they have a consistent pixel size across each donut.

Anyway, picking 192 as the diameter for your circles to compare with seems rather arbitrary, why not use 212.4709365?
 Logged
DustyMonkey
Forums Newbie

Posts: 6

 « Reply #2 on: September 28, 2013, 10:29:33 PM »

212.4709365 is the diameter that leads to the same number of samples as the power-of-two method, in which case neither is superior in efficiency with regards to samples/zoom. The problem is that this does not seem to be an equal measure of quality, and now let me show that to be the case here:

The power-of-two method suffers from discontinuities of sampling rate at all the edges of the key frames that simply dont exist in the mercator method. There are 1x sampling rates right next to 2x sampling rates, 2x sampling rates right next to 4x, and so on... all right at those discontinuous edges between the keyframes. This is clearly inferior in quality to the mercator method for an equal number of samples/zoom, because the mercator has a nice smooth continuous and constantly changing sampling rate all the way down.

Therefore I declare that the reference diameter for a comparison of equal qualities must by definition be less than 212.47...
 Logged
DustyMonkey
Forums Newbie

Posts: 6

 « Reply #3 on: September 28, 2013, 11:08:14 PM »

Also...

Quote
Concentric circles have bigger pixels near the edge and smaller pixels near the middle, so the edges get blurry and the middle gets over-sharp (which is distracting when the eye follows a feature from the middle to the edge).  The box donuts are easier to manipulate to get this right, because they have a consistent pixel size across each donut

They both actually suffer from fewer samples at the edge of the window than near the center when assembling movie frames, at least the way I understand it.
 Logged
SeryZone
Strange Attractor

Posts: 253

Contemplate...

 « Reply #4 on: December 27, 2013, 09:46:49 PM »

Hey! I use Mercator maps in Ultra Fractal with arbitrary-precision calculatings. After convert map to zoom. I wrote simply program on assembler for rendering short maps and pre-visualizing every frame. We can control iteration count on every frame!
For power of 2 write this coloring algorithm (like teamsafa) is too hard. I have learn programming for 2 years and now I'm use Kalles Fraktaler for rendering iteration data for coloring.

My advice: write your programms for Mercator-maps rendering! It reduce rendering time in several times faster!
 Logged

 Pages: [1]   Go Down