2014-12-18 22:09:14 +01:00
|
|
|
#ifndef Use_Bindless_Texture
|
2014-09-17 23:50:16 +02:00
|
|
|
uniform sampler2D glosstex;
|
2014-08-23 00:18:14 +02:00
|
|
|
#endif
|
|
|
|
|
2014-12-18 22:09:14 +01:00
|
|
|
#ifdef Use_Bindless_Texture
|
2014-09-17 23:50:16 +02:00
|
|
|
flat in sampler2D secondhandle;
|
2014-08-23 00:18:14 +02:00
|
|
|
#endif
|
|
|
|
in vec3 nor;
|
|
|
|
in vec2 uv;
|
|
|
|
out vec3 EncodedNormal;
|
|
|
|
|
2016-06-27 13:11:27 +02:00
|
|
|
#stk_include "utils/encode_normal.frag"
|
2014-08-23 00:18:14 +02:00
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
2014-12-18 22:09:14 +01:00
|
|
|
#ifdef Use_Bindless_Texture
|
2014-09-17 23:50:16 +02:00
|
|
|
float glossmap = texture(secondhandle, uv).x;
|
2014-08-23 00:18:14 +02:00
|
|
|
#else
|
2014-09-17 23:50:16 +02:00
|
|
|
float glossmap = texture(glosstex, uv).x;
|
2014-08-23 00:18:14 +02:00
|
|
|
#endif
|
|
|
|
EncodedNormal.xy = 0.5 * EncodeNormal(normalize(nor)) + 0.5;
|
2014-12-05 00:09:15 +01:00
|
|
|
EncodedNormal.z = glossmap;
|
2014-08-23 00:18:14 +02:00
|
|
|
}
|