New answers tagged fragment-shader
For people who come here from Google (like me), the shader version is: fract (tex_coord.st) this will loop coordinates in range 0.0 - 1.0
You would have to render your scene into a cube map, then render a quad. The texture coordinates would then translate directly to longitude/latitude you can use to calculate the vector to use for sampling the cube map. For equirectangular projection: lon = u*2*pi lat = (v*2-1)*2*pi x = cos(lon)*cos(lat) y = sin(lon)*cos(lat) z = sin(lat) Where u/v are ...
The problem was there gl_FragColor = (1.0, 0 , 0 ,1.0);//vec4(texVal.rgb, texVal.a)*(1.0, 0 , 0 ,1.0); it miss the vec4 name gl_FragColor = vec4(1.0, 0 , 0 ,1.0);//vec4(texVal.rgb, texVal.a)*vec4(1.0, 0 , 0 ,1.0);
Top 50 recent answers are included