Res: Fix some shader woes

This commit is contained in:
Vicki Pfau 2017-06-17 18:08:44 -07:00
parent 492bfa7504
commit 9708e5bba9
4 changed files with 10 additions and 14 deletions

View File

@ -7,5 +7,5 @@ passes=1
[pass.0] [pass.0]
fragmentShader=agb001.fs fragmentShader=agb001.fs
blend=1 blend=1
width=960 width=-4
height=640 height=-4

View File

@ -7,13 +7,13 @@ passes=2
[pass.0] [pass.0]
fragmentShader=ags001.fs fragmentShader=ags001.fs
blend=1 blend=1
width=960 width=-4
height=640 height=-4
[pass.1] [pass.1]
fragmentShader=ags001-light.fs fragmentShader=ags001-light.fs
width=960 width=-4
height=640 height=-4
[pass.1.uniform.lightBrightness] [pass.1.uniform.lightBrightness]
type=float type=float

View File

@ -23,19 +23,15 @@
THE SOFTWARE. THE SOFTWARE.
*/ */
precision highp float;
varying vec2 texCoord; varying vec2 texCoord;
uniform sampler2D tex; uniform sampler2D tex;
uniform vec2 texSize; uniform vec2 texSize;
uniform float similarity_threshold; uniform float similarity_threshold;
#define screen_res 240,160
vec4 texel_fetch(sampler2D t, ivec2 c) // because GLSL TexelFetch is not supported 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) float pixel_brightness(vec4 pixel)
@ -140,7 +136,7 @@ vec4 interpolate_diagonal(vec4 a, vec4 b, vec4 c, vec4 d)
void main() void main()
{ {
ivec2 pixel_coords2 = ivec2(texCoord * vec2(screen_res) * 2); ivec2 pixel_coords2 = ivec2(texCoord * texSize * 2);
ivec2 pixel_coords = pixel_coords2 / 2; ivec2 pixel_coords = pixel_coords2 / 2;
bool x_even = mod(pixel_coords2.x,2) == 0; bool x_even = mod(pixel_coords2.x,2) == 0;

View File

@ -7,5 +7,5 @@ passes=1
[pass.0] [pass.0]
fragmentShader=wiiu.fs fragmentShader=wiiu.fs
blend=1 blend=1
width=960 width=-4
height=640 height=-4