mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-22 15:51:30 +11:00
fix oversampling
This commit is contained in:
parent
eedf3a8c09
commit
8243af2064
|
@ -275,7 +275,7 @@ void main()
|
|||
|
||||
#ifdef OVERSAMPLE
|
||||
//float filter = fwidth(ratio_scale.y);
|
||||
float filter = params.SourceSize.y / params.OutputSize.y;
|
||||
float os_filter = params.SourceSize.y / params.OutputSize.y;
|
||||
#endif
|
||||
vec2 uv_ratio = fract(ratio_scale);
|
||||
|
||||
|
@ -323,10 +323,10 @@ void main()
|
|||
vec4 weights = scanlineWeights(uv_ratio.y, col);
|
||||
vec4 weights2 = scanlineWeights(1.0 - uv_ratio.y, col2);
|
||||
#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;
|
||||
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;
|
||||
weights2=weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2)/3.0;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue