mirror of https://github.com/mgba-emu/mgba.git
Res: Fix some shader woes
This commit is contained in:
parent
492bfa7504
commit
9708e5bba9
|
@ -7,5 +7,5 @@ passes=1
|
|||
[pass.0]
|
||||
fragmentShader=agb001.fs
|
||||
blend=1
|
||||
width=960
|
||||
height=640
|
||||
width=-4
|
||||
height=-4
|
||||
|
|
|
@ -7,13 +7,13 @@ passes=2
|
|||
[pass.0]
|
||||
fragmentShader=ags001.fs
|
||||
blend=1
|
||||
width=960
|
||||
height=640
|
||||
width=-4
|
||||
height=-4
|
||||
|
||||
[pass.1]
|
||||
fragmentShader=ags001-light.fs
|
||||
width=960
|
||||
height=640
|
||||
width=-4
|
||||
height=-4
|
||||
|
||||
[pass.1.uniform.lightBrightness]
|
||||
type=float
|
||||
|
|
|
@ -23,19 +23,15 @@
|
|||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
precision highp float;
|
||||
|
||||
varying vec2 texCoord;
|
||||
uniform sampler2D tex;
|
||||
uniform vec2 texSize;
|
||||
|
||||
uniform float similarity_threshold;
|
||||
|
||||
#define screen_res 240,160
|
||||
|
||||
vec4 texel_fetch(sampler2D t, ivec2 c) // because GLSL TexelFetch is not supported
|
||||
{
|
||||
return texture2D(tex, (2 * vec2(c) + vec2(1,1)) / (2 * vec2(screen_res)) );
|
||||
return texture2D(tex, (2 * vec2(c) + vec2(1,1)) / (2 * texSize) );
|
||||
}
|
||||
|
||||
float pixel_brightness(vec4 pixel)
|
||||
|
@ -140,7 +136,7 @@ vec4 interpolate_diagonal(vec4 a, vec4 b, vec4 c, vec4 d)
|
|||
|
||||
void main()
|
||||
{
|
||||
ivec2 pixel_coords2 = ivec2(texCoord * vec2(screen_res) * 2);
|
||||
ivec2 pixel_coords2 = ivec2(texCoord * texSize * 2);
|
||||
ivec2 pixel_coords = pixel_coords2 / 2;
|
||||
|
||||
bool x_even = mod(pixel_coords2.x,2) == 0;
|
||||
|
|
|
@ -7,5 +7,5 @@ passes=1
|
|||
[pass.0]
|
||||
fragmentShader=wiiu.fs
|
||||
blend=1
|
||||
width=960
|
||||
height=640
|
||||
width=-4
|
||||
height=-4
|
||||
|
|
Loading…
Reference in New Issue