2015-02-22 14:31:14 -05:00
|
|
|
uniform sampler2D ntex;
|
|
|
|
|
2016-09-12 15:39:52 -04:00
|
|
|
#ifdef GL_ES
|
|
|
|
layout (location = 0) out vec4 Diff;
|
|
|
|
layout (location = 1) out vec4 Spec;
|
|
|
|
#else
|
2015-02-22 14:31:14 -05:00
|
|
|
out vec4 Diff;
|
|
|
|
out vec4 Spec;
|
2016-09-12 15:39:52 -04:00
|
|
|
#endif
|
2015-02-22 14:31:14 -05:00
|
|
|
|
2016-06-27 07:11:27 -04:00
|
|
|
#stk_include "utils/decodeNormal.frag"
|
|
|
|
#stk_include "utils/getPosFromUVDepth.frag"
|
|
|
|
#stk_include "utils/DiffuseIBL.frag"
|
|
|
|
#stk_include "utils/SpecularIBL.frag"
|
2015-02-22 14:31:14 -05:00
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
2017-12-25 01:00:10 -05:00
|
|
|
vec2 uv = gl_FragCoord.xy / u_screen;
|
2015-02-22 14:31:14 -05:00
|
|
|
vec3 normal = normalize(DecodeNormal(2. * texture(ntex, uv).xy - 1.));
|
|
|
|
|
|
|
|
Diff = vec4(0.25 * DiffuseIBL(normal), 1.);
|
|
|
|
Spec = vec4(0., 0., 0., 1.);
|
|
|
|
}
|