Нужно сделать что-то типо 360 видео в ютубе.
Есть сферическая карта, которую нужно нарисовать с возможностью поворота:
Хотел сначала использовать Playcanvas + Сфера с вывернутыми нормалями, но подумал что можно плейн с шейдером и на обычной канве отрисовать.
Нашел пример:
http://z0b.kapsi.fi/webgl-sphere.html
Там такой шейдер:

uniform sampler2D tex; // sphere texture
varying mediump vec2 texCoord;
uniform mediump mat4 rotation; // sphere rotation matrix
uniform lowp vec4 lightPos; // where the light is (assume sphere is at (0, 0, 0))
uniform lowp float minLight; // minimum light level
#define PIP2 1.5707963 // PI/2
#define PI 3.1415629
#define TWOPI 6.2831853 // 2PI
void main()
{
// make us round
mediump float d = texCoord.x * texCoord.x + texCoord.y * texCoord.y;
if (d > 1.0)
discard;
// we're in, compute the exact Z
mediump float z = sqrt(1.0 - d);
// get light intensity
mediump vec4 point = vec4(texCoord.xy, -z, 1.0);
// rotate
point *= rotation;
//lowp float l = clamp(dot(point, lightPos), minLight, 1.0);
// get texture coordinates (I believe this could be replaced with a
// precomputed texture lookup, if you need more performance)
mediump float x = (atan(point.x, point.z) + PI) / TWOPI,
y = (asin(point.y) + PIP2) / PI;
// get texel and shade it
mediump vec4 texel = texture2D(tex, vec2(x, y));// * vec4(l, l, l, 1.0);
// anti-aliasing
gl_FragColor = texel * (1.0 - smoothstep(0.985, 1.0, d));
}
но не могу вкурить, как его поправить, что бы была внутренняя полусфера и что бы можно было менять FOV.
UPD:
FOV можно менять масштабируя UV (в примере UV от -1 до 1), т.е texCoord *= .5 -> FOV = 90
Но видно, что неправильно поворачивается текстура, так как сфера выпуклая