2014-02-26 15:53:29 -05:00
|
|
|
uniform samplerCube tex;
|
2014-02-28 11:29:05 -05:00
|
|
|
|
2014-02-26 15:53:29 -05:00
|
|
|
out vec4 FragColor;
|
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
2017-12-25 01:00:10 -05:00
|
|
|
vec3 eyedir = vec3(mod(gl_FragCoord.xy, u_screen) / u_screen, 1.);
|
2014-02-26 15:53:29 -05:00
|
|
|
eyedir = 2.0 * eyedir - 1.0;
|
2017-12-25 01:00:10 -05:00
|
|
|
vec4 tmp = (u_inverse_projection_matrix * vec4(eyedir, 1.));
|
2014-10-01 20:53:31 -04:00
|
|
|
tmp /= tmp.w;
|
2017-12-25 01:00:10 -05:00
|
|
|
eyedir = (u_inverse_view_matrix * vec4(tmp.xyz, 0.)).xyz;
|
2014-02-26 15:53:29 -05:00
|
|
|
vec4 color = texture(tex, eyedir);
|
2014-04-21 18:44:08 -04:00
|
|
|
FragColor = vec4(color.xyz, 1.);
|
2014-02-26 15:53:29 -05:00
|
|
|
}
|