- return texture(environment_map, direction);
-}
-
-virtual vec3 get_reflection(vec3 normal, vec3 look)
-{
- vec3 reflect_dir = reflect(look, normal);
- if(use_normal_map)
- reflect_dir = eye_tbn_matrix*reflect_dir;
-
- return get_environment_sample(env_eye_matrix*reflect_dir).rgb;
+ if(use_alpha_cutoff)
+ {
+ if(alpha<params.cutoff)
+ discard;
+ float limit = min(params.cutoff+params.feather*fwidth(alpha), 1.0);
+ return smoothstep(params.cutoff, limit, alpha);
+ }
+ else
+ return alpha;