Downsampling for LOD levels wrong for first point
I have been playing around with LOD level generation on a VDS with synthetic content. My goal is to understand the LOD levels and the downsampling better.
Observation/Experiment
I wrote a Python script (test_lod_levels_sine_function.py) which generates a sine function (with specified frequency and amplitude etc) that is written to a 3D VDS. I let OpenVDS add 4 LOD levels such that I have 5 levels in total. In the current setup in the script, I have a single brick with 32 samples in each direction on level 0.
In the next step I load the VDS file and extract the data along a line. The data is plotted it against the analytical function and I compute some error norms (only printed on screen). See the following plot:
Observations and questions
From what I understand here seems to be the following:
-
If data is sampled down, I kind only keep the second, fourth etc. sample on each level is kept. This looks somewhat like this
level Samples 0 0 1 2 3 4 5 6 7 8 ... 1 0 2 4 6 8 ... 2 0 4 8 ...
Missing values indicate samples that are not available on the LOD level.
Is this understanding correct?
-
At the moment, it looks to me that down sampling simply removes/ignores values that are in between the sample that are being kept. At least for to me it looks like this to me from the plot.
Is this understanding correct or do you do any kind of elaborate downsampling that includes some kind of anti-aliasing?
-
From my experiments I expect that for my sine wave, I simply get bigger gaps between discrete points the higher go up per level. I plotted this for the all levels in my VDS:
My assumptions on how the downsampling is done, seem to hold mostly. However, for some reason the first sample on levels > 0 seems to be shifted (point at top left in the plot). The y-value here is close to 1 instead of 0.
If my interpretation of how the x-coordinate is determined, I would expect that all points also show the same offset. However, all other samples on a level of detail seem to match with a sample of level 0.
Am I doing something wrong here when determining the x-coordinate or does the downsampling have a bug here?
Platform
- Apple Arm M1 Max
- MacOS 13.2.1
- OpenVDS 3.0.3 (compiled from source)