There is a working tile boundary view using vbos for standard photos. For nonlinear pano projections a fragment shader approach could be good. But using dFdx etc. has poor numerical stability across zoom levels. So an explicit analytic Jacobian approach might work.
For the tile edge shader, we want the distance from the fragment to the tile edge in screen pixels.
Because it's a distance between two points, we can compute it using Jacobians, instead of using slightly more complicated full transforms.
For example, the displacement of the fragment from the left tile edge in raw padded tile coordinates is
vec2 left_disp_ptc = (fract(ptc.x), 0)
What we want is the displacement in screen pixels
vec2 left_disp_qwn = qwn_J_ptc * left_disp_ptc
For the panorama case, qwn_J_ptc is the combination of about nine Jacobians.
qwn_J_ptc = qwn_J_ndc * ndc_J_nic * nic_J_usr * usr_J_geo * geo_J_pcm * pcm_J_otc * otc_J_rtc * rtc_J_ttc * ttc_J_ptc
nic_J_usr is the inverse display projection, and must be computed in the fragment shader because it depends on the fragment location.
pcm_J_otc is the inverse input format projection (either equirectangular or dual fisheye at the moment. It too must be computed in the fragment shader.
The rest of the Jacobians can be computed and combined on the host/cpu side as qwn_J_nic, usr_J_pcm, and otc_J_ptc
There is a working tile boundary view using vbos for standard photos. For nonlinear pano projections a fragment shader approach could be good. But using dFdx etc. has poor numerical stability across zoom levels. So an explicit analytic Jacobian approach might work.
For the tile edge shader, we want the distance from the fragment to the tile edge in screen pixels.
Because it's a distance between two points, we can compute it using Jacobians, instead of using slightly more complicated full transforms.
For example, the displacement of the fragment from the left tile edge in raw padded tile coordinates is
vec2 left_disp_ptc = (fract(ptc.x), 0)
What we want is the displacement in screen pixels
vec2 left_disp_qwn = qwn_J_ptc * left_disp_ptc
For the panorama case, qwn_J_ptc is the combination of about nine Jacobians.
qwn_J_ptc = qwn_J_ndc * ndc_J_nic * nic_J_usr * usr_J_geo * geo_J_pcm * pcm_J_otc * otc_J_rtc * rtc_J_ttc * ttc_J_ptc
nic_J_usr is the inverse display projection, and must be computed in the fragment shader because it depends on the fragment location.
pcm_J_otc is the inverse input format projection (either equirectangular or dual fisheye at the moment. It too must be computed in the fragment shader.
The rest of the Jacobians can be computed and combined on the host/cpu side as qwn_J_nic, usr_J_pcm, and otc_J_ptc