- float lod = (2-roughness)*roughness*(textureQueryLevels(environment_map)-1);
- return textureLod(environment_map, env_world_matrix*direction, lod).rgb;
-}
-
-virtual vec3 get_reflection(vec3 normal, vec3 look)
-{
- vec3 reflect_dir = reflect(look, normal);
- return get_environment_sample(reflect_dir, 0.0);
-}
-
-virtual vec3 get_irradiance_sample(vec3 normal)
-{
- return texture(irradiance_map, env_world_matrix*normal).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;