stk-code_catmod/data/shaders/objectref_pass1.frag

24 lines
495 B
GLSL
Raw Normal View History

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;
layout(bindless_sampler) uniform sampler2D glosstex;
2014-08-18 11:49:44 -04:00
#else
2014-01-18 19:32:08 -05:00
uniform sampler2D tex;
uniform sampler2D glosstex;
2014-08-18 11:49:44 -04:00
#endif
2014-01-18 19:32:08 -05:00
in vec3 nor;
2014-01-18 19:32:08 -05:00
in vec2 uv;
2014-04-06 16:19:10 -04:00
out vec3 EncodedNormal;
#stk_include "utils/encode_normal.frag"
2014-01-18 19:32:08 -05:00
void main() {
vec4 col = texture(tex, uv);
2014-01-18 19:32:08 -05:00
if (col.a < 0.5)
discard;
float glossmap = texture(glosstex, uv).x;
2014-04-06 16:19:10 -04:00
EncodedNormal.xy = 0.5 * EncodeNormal(normalize(nor)) + 0.5;
EncodedNormal.z = glossmap;
2014-01-18 19:32:08 -05:00
}