Analytical texture mapping demonstrator.
A demonstration and visual assessment OpenGL-GPU application for Windows

--- Description ---
This OpenGL-shader based GPU application demonstrates analytical texture mapping (ATM) using a selectable prefilter. It can be used to assess the visual differences for moving pictures and still pictures of different filters. For reference purposes it includes hardware supported anisotropic texture filtering.

Size: 6 MB
Platform: x86 CPU + GPU with OpenGL 4.3 support
Environment: Executable for Windows (tested on Windows 10).

--- Detailed setup instructions  ---
Unzip the file. A directory "atm-GPU-demo-onWindows" will be created that contains 4 executable and their required resource files.

--- Detailed run instructions:  ---
There are 4 executable in the created "atm-GPU-Windows-demo" directory. Start by running the first one (e.g. double click). The application opens with a self-explanatory menu screen that explains the key for controlling the application.

When all shader filters would be enabled in a single executable a big GPU is needed otherwise an error is obtained indicating that the number of ALU instructions is to high (higher than 65635). Hence 4 versions of the executable have been made with a large overlap in functionality (all, except 3, have been successfully tested on a NVIDIA RTX 3060 Laptop GPU):
1_atmDemo_withAllSimplifiedCubics.exe
    - This is the most interesting one and if the reviewer has limited time the others could be skipped.
      It allows to select all prefilter functions except the B-C-parameterizable cubic one.
2_atmDemo_withParameterizableCubic.exe
    - This version enables the the B-C-parameterizable cubic prefilter and only a few other filters.
3_atmDemo_withAllCubics_NeedsBigGPU.exe
    - This version enables all shader filters that have been implemented.
      It has been successfully tested on a NVIDIA RTX 3090 GPU
4_atmDemo_withBiLinearReconstuction_onlyOneCubic.exe
    - This version enables only a minimum set of filters but does allow selecting bilinear filtering
     as reconstruction filter in the ATM algorithm.

To avoid any scaling/blurring of the Windows operating system this application disables the "scale" option of Windows that (in Windows 10) can be set in the "Scale and layout" option in "Display settings". This is implemented for the monitor where this application opens (the "main display"). Warning: when moving the application to another monitor make sure the percentage in the "Scale and layout" setting is the same for both monitors.


--- Notes for visual inspection ---
- The application contains two side-by-side viewports with the same view but a different applied prefilter. Resizing of the viewports (by resizing the application window) is deliberately not implemented, however the demo supports pixel replicated zoom-in to assist visual assessment.
- The input texture, a Siemens star, does not contain (visible) aliasing (as can be viewed in the assets directory), and hence any visible aliasing is introduced by the rendering process.
The application allows to focus on a spacial and temporal location:
- It is possible to zoom-in (pixel-replication) and translate the viewport for close inspection.
- A (small) temporal range of the animation can be selected to restrict the animation to ('ping-pong').
- For still picture comparison the animation can be paused and single-frame stepped through.


--- Details about the shader code ---
The shader source code is available in subdirector subdirectory "shaders".
A good starting point for having a look would be the main() function in atmInvTexture.frag:
The innerloops (lines 483 and 487) traverse the texels within a conservative preimage (in 
normalized texture space) of the prefilter footprint. Here line 525 computes the four 
edge-weights (by calling WtEdgeAB() ) of each traversed texel.

Note: the shaders use a different naming scheme than the paper does; the mapping from variable names in the paper to shader code is as follows:

- The (final) H_{t,p}(k) antiderivative as used in Eq. 8 is a function called Hygx_XXX(x, t, y0) (for instance in atmInvTexture_cubicB0C1.frag).
Where XXX the name of the select filter function (e.g. "cubic_B0C1").
Here: p --> y0 and k --> x.

To obtain above H_{t,p}(k) we use two other (antiderivative) functions, as explained in the end of Section IV.A:
- H^tilde_{t,p}(k) for cell 01 is in the code called i2cell01_YYY(x, t, y0).
- D_{t,p} for cell 23 is in the code called HygxBorder23_YYY(t, y0).
With YYY the name of the select filter function (e.g. "B0C1").
And again also here: p --> y0 and k --> x.