mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
graphics: Fix screen filter calculation
This commit is contained in:
parent
ed80286431
commit
b036cac616
@ -162,7 +162,7 @@ void main(void) {
|
||||
vec4 c3 = texture2D(texture, p1);
|
||||
// Texels must be in the source rect, so it is not necessary to check that like linear filter.
|
||||
|
||||
vec2 rate = min(max(1.0 - ((1.0 - fract(pos * source_size)) * scale), 0.0), 1.0);
|
||||
vec2 rate = min(max((fract(pos * source_size) - 0.5) * scale, 0.0), 1.0);
|
||||
vec4 color = mix(mix(c0, c1, rate.x), mix(c2, c3, rate.x), rate.y);
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user