fix oversampling

This commit is contained in:
hunterk 2017-03-02 10:35:59 -06:00
parent eedf3a8c09
commit 8243af2064

View file

@ -275,7 +275,7 @@ void main()
#ifdef OVERSAMPLE #ifdef OVERSAMPLE
//float filter = fwidth(ratio_scale.y); //float filter = fwidth(ratio_scale.y);
float filter = params.SourceSize.y / params.OutputSize.y; float os_filter = params.SourceSize.y / params.OutputSize.y;
#endif #endif
vec2 uv_ratio = fract(ratio_scale); vec2 uv_ratio = fract(ratio_scale);
@ -323,10 +323,10 @@ void main()
vec4 weights = scanlineWeights(uv_ratio.y, col); vec4 weights = scanlineWeights(uv_ratio.y, col);
vec4 weights2 = scanlineWeights(1.0 - uv_ratio.y, col2); vec4 weights2 = scanlineWeights(1.0 - uv_ratio.y, col2);
#ifdef OVERSAMPLE #ifdef OVERSAMPLE
uv_ratio.y =uv_ratio.y+1.0/3.0*filter; uv_ratio.y =uv_ratio.y+1.0/3.0*os_filter;
weights = (weights+scanlineWeights(uv_ratio.y, col))/3.0; weights = (weights+scanlineWeights(uv_ratio.y, col))/3.0;
weights2=(weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2))/3.0; weights2=(weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2))/3.0;
uv_ratio.y =uv_ratio.y-2.0/3.0*filter; uv_ratio.y =uv_ratio.y-2.0/3.0*os_filter;
weights=weights+scanlineWeights(abs(uv_ratio.y), col)/3.0; weights=weights+scanlineWeights(abs(uv_ratio.y), col)/3.0;
weights2=weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2)/3.0; weights2=weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2)/3.0;
#endif #endif