I recently tried to get a regular image (with normal fov) out of a equirectangular one. My rudimentary approach to simply put the image on a sphere and then position a camera on the inside failed because the rectangular image wouldn't seamlessly wrap around the sphere. Now I tried using a shader to directly undistort the panorama onto a rectangle.
Here is my current shader for that: (I used the Unity Shader Graph)
I'm not that good with maths an tried to follow this blog post. It provides the following equations:
I tried to replicate them in Shader Graph to determine the point at which the panorama should be sampled. However, when I try it out it seems like something is working, but the image is distorted, rotated and I can't zoom in properly.
I'm using uv coordinates for the latitude and longitude. Could that be the problem?
question from:
https://stackoverflow.com/questions/65601816/mapping-equirectangular-image-on-to-rectangle-in-shader-not-working 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…