anchor.diff:  #endif
   
   #if SHADOW_SAMPLING_METHOD == SHADOW_SAMPLING_PCF_HIGH
  -float ShadowSample_PCF_High(const lowp sampler2DShadow map, const vec2 size, const vec3 position) {
  +float ShadowSample_PCF_High(const lowp sampler2DShadow map, const vec2 size, vec3 position) {
       //  Castaño, 2013, "Shadow Mapping Summary Part 1"
       vec2 texelSize = vec2(1.0) / size;
  +
  +    // clamp position to avoid overflows below, which cause some GPUs to abort
  +    position.xy = clamp(position.xy, vec2(-1.0), vec2(2.0));
   
       vec2 offset = vec2(0.5);
       vec2 uv = (position.xy * size) + offset;
  
positive.code: #endif
  
  #if SHADOW_SAMPLING_METHOD == SHADOW_SAMPLING_PCF_LOW
  float ShadowSample_PCF_Low(const lowp sampler2DShadow map, const vec2 size, const vec3 position) {
      //  Castaño, 2013, "Shadow Mapping Summary Part 1"
      vec2 texelSize = vec2(1.0) / size;
  
      vec2 offset = vec2(0.5);
      vec2 uv = (position.xy * size) + offset;
  
negative.code: #endif
  
  #if SHADOW_SAMPLING_METHOD == SHADOW_SAMPLING_PCF_MEDIUM
  float ShadowSample_PCF_Medium(const lowp sampler2DShadow map, const vec2 size, vec3 position) {
      //  Castaño, 2013, "Shadow Mapping Summary Part 1"
      vec2 texelSize = vec2(1.0) / size;
  
      // clamp position to avoid overflows below, which cause some GPUs to abort
      position.xy = clamp(position.xy, vec2(-1.0), vec2(2.0));
  
      vec2 offset = vec2(0.5);
      vec2 uv = (position.xy * size) + offset;
  