Hi.
Is there a way to convert a CubeMap to a panorama in Tooll?
I found some code about how it's done on the internet but don't know how to implement this into a shader.
const float pi = 3.1415926536;
void mainImage( out vec4 fragColor, in vec2 fragCoord ) {
vec2 P = fragCoord.xy / iResolution.xy;
float theta = (1.0 - P.y) * pi;
float phi = P.x * pi * 2.0;
vec3 dir = vec3(sin(theta) * sin(phi), cos(theta), sin(theta) * cos(phi));
fragColor = sqrt(textureCube(iChannel0, dir));
}
Can someone help?