2014-12-18 16:09:14 -05:00
|
|
|
#ifdef Use_Bindless_Texture
|
2014-08-18 11:49:44 -04:00
|
|
|
layout(bindless_sampler) uniform sampler2D tex;
|
|
|
|
#else
|
2014-04-06 16:19:10 -04:00
|
|
|
uniform sampler2D tex;
|
2014-08-18 11:49:44 -04:00
|
|
|
#endif
|
2014-04-06 16:19:10 -04:00
|
|
|
|
2014-02-28 11:29:05 -05:00
|
|
|
in vec3 nor;
|
2014-04-06 16:19:10 -04:00
|
|
|
in vec2 uv;
|
|
|
|
out vec3 EncodedNormal;
|
2014-02-28 11:29:05 -05:00
|
|
|
|
2016-06-26 10:39:34 -04:00
|
|
|
#stk_include "utils/encode_normal.frag"
|
2014-01-15 19:08:37 -05:00
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
2014-09-20 13:28:06 -04:00
|
|
|
float glossmap = texture(tex, uv).x;
|
2014-04-06 16:19:10 -04:00
|
|
|
EncodedNormal.xy = 0.5 * EncodeNormal(normalize(nor)) + 0.5;
|
2014-12-04 18:09:15 -05:00
|
|
|
EncodedNormal.z = glossmap;
|
2014-01-15 19:08:37 -05:00
|
|
|
}
|