Fixed issue in shadows15.glsllib, edge bilinear filtering was wrong when using tetxureGather

experimental
Nehon 11 years ago
parent 4d861ce90d
commit 6d9a7fbcfb
  1. 12
      jme3-core/src/main/resources/Common/ShaderLib/Shadows15.glsllib

@ -100,14 +100,14 @@ float Shadow_DoBilinear_2x2(in SHADOWMAP tex, in vec4 projCoord){
vec4 gather = SHADOWGATHER(tex, coord);
#else
vec4 gather = vec4(0.0);
gather.x = SHADOWCOMPAREOFFSET(tex, projCoord, ivec2(0, 0));
gather.y = SHADOWCOMPAREOFFSET(tex, projCoord, ivec2(1, 0));
gather.z = SHADOWCOMPAREOFFSET(tex, projCoord, ivec2(0, 1));
gather.w = SHADOWCOMPAREOFFSET(tex, projCoord, ivec2(1, 1));
gather.x = SHADOWCOMPAREOFFSET(tex, projCoord, ivec2(0, 1));
gather.y = SHADOWCOMPAREOFFSET(tex, projCoord, ivec2(1, 1));
gather.z = SHADOWCOMPAREOFFSET(tex, projCoord, ivec2(1, 0));
gather.w = SHADOWCOMPAREOFFSET(tex, projCoord, ivec2(0, 0));
#endif
vec2 f = fract( projCoord.xy * SHADOWMAP_SIZE );
vec2 mx = mix( gather.xz, gather.yw, f.x );
vec2 f = fract( projCoord.xy * SHADOWMAP_SIZE );
vec2 mx = mix( gather.wx, gather.zy, f.x );
return mix( mx.x, mx.y, f.y );
}

Loading…
Cancel
Save