Skip to content
Permalink
Browse files

minor

  • Loading branch information...
Shinmera committed Mar 27, 2019
1 parent d949193 commit 2db70610b9b002bc89cac753c002cf156e0cb8a4
Showing with 5 additions and 4 deletions.
  1. +2 −1 package.lisp
  2. +3 −3 shadow-map.lisp
@@ -642,7 +642,8 @@
(:export
#:skybox
#:texture
#:vertex-array)
#:vertex-array
#:skybox-pass)
;; sprite.lisp
(:export
#:sprite-entity
@@ -82,7 +82,7 @@ float shadow_factor(vec3 position, float bias){
vec4 light_space_position = light_space_matrix * vec4(position, 1);
vec3 projected = light_space_position.xyz / light_space_position.w;
projected = (projected+1)*0.5;
if(projected.z > 1) return 0;
if(projected.z > 1) return 0.0;
float closest = texture(shadow_map, projected.xy).r;
float current = projected.z;
float shadow = 0;
@@ -98,9 +98,9 @@ float shadow_factor(vec3 position, float bias){
}
}
}
return clamp(shadow, 0, 1);
return clamp(shadow, 0.0, 1.0);
}
float shadow_bias(vec3 normal, vec3 light_direction){
return clamp(0.005*tan(acos(dot(normal, light_direction))), 0, 0.001);
return clamp(0.005*tan(acos(dot(normal, light_direction))), 0.0, 0.001);
}")

0 comments on commit 2db7061

Please sign in to comment.
You can’t perform that action at this time.