2014-03-02 18:47:13 -05:00
|
|
|
uniform samplerCube tex;
|
|
|
|
uniform mat4 invproj;
|
|
|
|
uniform vec2 screen;
|
2013-11-30 16:33:06 -05:00
|
|
|
|
2014-02-28 11:29:05 -05:00
|
|
|
#if __VERSION__ >= 130
|
|
|
|
in vec3 nor;
|
2014-01-19 13:31:00 -05:00
|
|
|
out vec4 FragColor;
|
2014-02-28 11:29:05 -05:00
|
|
|
#else
|
|
|
|
varying vec3 nor;
|
|
|
|
#define FragColor gl_FragColor
|
|
|
|
#endif
|
|
|
|
|
2013-11-30 16:33:06 -05:00
|
|
|
|
|
|
|
void main() {
|
2014-03-02 18:47:13 -05:00
|
|
|
vec3 fpos = gl_FragCoord.xyz / vec3(screen, 1.);
|
|
|
|
vec4 xpos = 2.0 * vec4(fpos, 1.0) - 1.0;
|
|
|
|
xpos = invproj * xpos;
|
2013-11-30 16:33:06 -05:00
|
|
|
|
2014-03-02 18:47:13 -05:00
|
|
|
xpos.xyz /= xpos.w;
|
|
|
|
vec4 detail0 = texture(tex, reflect(xpos.xyz, nor));
|
2013-11-30 16:33:06 -05:00
|
|
|
|
2014-03-02 18:47:13 -05:00
|
|
|
FragColor = vec4(detail0.xyz, 1.);
|
2013-11-30 16:33:06 -05:00
|
|
|
}
|