2014-02-26 15:53:29 -05:00
|
|
|
uniform samplerCube tex;
|
|
|
|
uniform mat4 InvProjView;
|
|
|
|
uniform vec2 screen;
|
|
|
|
|
2014-02-28 11:29:05 -05:00
|
|
|
|
|
|
|
#if __VERSION__ >= 130
|
2014-02-26 15:53:29 -05:00
|
|
|
out vec4 FragColor;
|
2014-02-28 11:29:05 -05:00
|
|
|
#else
|
|
|
|
#define FragColor gl_FragColor
|
|
|
|
#endif
|
|
|
|
|
2014-02-26 15:53:29 -05:00
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
|
|
|
vec3 eyedir = gl_FragCoord.xyz / vec3(screen, 1.);
|
|
|
|
eyedir = 2.0 * eyedir - 1.0;
|
|
|
|
vec4 tmp = (InvProjView * vec4(eyedir, 1.));
|
|
|
|
eyedir = tmp.xyz / tmp.w;
|
|
|
|
vec4 color = texture(tex, eyedir);
|
|
|
|
FragColor = vec4(color.xyz, 1.);
|
|
|
|
}
|