I have a 360 texture in Equirectangular Projection.
With what GLSL shader can I convert it into a azimuthal equidistant projection?
See also: http://earth.nullschool.net/#current/wind/isobaric/500hPa/azimuthal_equidistant=24.64,98.15,169
I have a 360 texture in Equirectangular Projection.
With what GLSL shader can I convert it into a azimuthal equidistant projection?
See also: http://earth.nullschool.net/#current/wind/isobaric/500hPa/azimuthal_equidistant=24.64,98.15,169
I would do it in Fragment shader.
In Vertex shader I would:
Just pass the vertex coordinates as
varying
to fragment shader (no point using matrices here you can directly use x,y coordinates in range<-1,+1>
)In fragment shader I would:
azimuth
anddistance
of interpolatedvertex
from point(0,0)
(simplelength
andatan2
call)(u,v)
coordinates of texture (just scale...)[edit1] just did bust a small example:
GL draw
Vertex:
Fragment:
Input texture:
Output render:
[notes]
The vertical line is caused by not using
GL_CLAMP_TO_EDGE
on source texture. It can be repaired by using texture coordinates range shifted by 1 pixel on booth sides or useGL_CLAMP_TO_EDGE
extension if present.Weird
atan()
operands are result of rotating left by 90 degrees to match North azimuth to be UP.