sebt3
homebrew player (P. & C.)
Hi there,
When scalling a texture up, the SGX tend to do a blurry job, so I wanted to get a "pixel restaurer" shader.
In my test, I'm using a quad with coordinate for fullscreen ((-1,-1) to (1,1)
Here is the shaders :
test.vert :
test.frag :
I'm pushing the size of a pixel in u_param.xy (aka 2/texture width for x and 2/texture height for y).
But it still doing that ugly blurry mess.
Could someone explain me what I'm missing ?
When scalling a texture up, the SGX tend to do a blurry job, so I wanted to get a "pixel restaurer" shader.
In my test, I'm using a quad with coordinate for fullscreen ((-1,-1) to (1,1)
Here is the shaders :
test.vert :
Code:
attribute vec4 a_position;
attribute vec2 a_texCoord0;
varying vec2 v_texCoord0;
uniform vec4 u_param;
void main()
{
vec2 dotPos;
dotPos.x = (floor(a_texCoord0.x/u_param.x))*u_param.x;
dotPos.y = (floor(a_texCoord0.y/u_param.y))*u_param.y;
gl_Position = a_position;
v_texCoord0 = dotPos;
}
test.frag :
Code:
precision mediump float;
varying vec2 v_texCoord0;
uniform sampler2D s_texture0;
void main()
{
gl_FragColor = texture2D(s_texture0, v_texCoord0);
}
I'm pushing the size of a pixel in u_param.xy (aka 2/texture width for x and 2/texture height for y).
But it still doing that ugly blurry mess.
Could someone explain me what I'm missing ?