all repos — mgba @ 9708e5bba9ea413288fa76ede33c94e186b353db

mGBA Game Boy Advance Emulator

Res: Fix some shader woes
Vicki Pfau vi@endrift.com
Sat, 17 Jun 2017 18:08:44 -0700
commit

9708e5bba9ea413288fa76ede33c94e186b353db

parent

492bfa75046e0a6d2cd9092b397d94211b8c815e

M res/shaders/agb001.shader/manifest.inires/shaders/agb001.shader/manifest.ini

@@ -7,5 +7,5 @@

[pass.0] fragmentShader=agb001.fs blend=1 -width=960 -height=640 +width=-4 +height=-4
M res/shaders/ags001.shader/manifest.inires/shaders/ags001.shader/manifest.ini

@@ -7,13 +7,13 @@

[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
M res/shaders/fish.shader/fish.fsres/shaders/fish.shader/fish.fs

@@ -23,19 +23,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN

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 @@ }

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;
M res/shaders/wiiu.shader/manifest.inires/shaders/wiiu.shader/manifest.ini

@@ -7,5 +7,5 @@

[pass.0] fragmentShader=wiiu.fs blend=1 -width=960 -height=640 +width=-4 +height=-4