ho3/resources/shaders/Frame.fragment

27 lines
945 B
Plaintext
Raw Normal View History

2024-06-06 13:25:38 +00:00
uniform sampler2D Texture;
varying vec2 texCoord;
void main()
{
2024-06-09 07:38:02 +00:00
2024-06-06 13:25:38 +00:00
float xstep = 0.5f/800.0f;
float ystep = 0.5f/600.0f;
vec4 texColor =
vec4(texture2D(Texture,texCoord).rgb,1.0) * 0.2
+ vec4(texture2D(Texture, vec2(texCoord.x+xstep, texCoord.y+ystep)).rgb,1.0) * 0.1
+ vec4(texture2D(Texture, vec2(texCoord.x-xstep, texCoord.y+ystep)).rgb,1.0) * 0.1
+ vec4(texture2D(Texture, vec2(texCoord.x-xstep, texCoord.y-ystep)).rgb,1.0) * 0.1
+ vec4(texture2D(Texture, vec2(texCoord.x+xstep, texCoord.y-ystep)).rgb,1.0) * 0.1
+ vec4(texture2D(Texture, vec2(texCoord.x, texCoord.y+2.0*ystep)).rgb,1.0) * 0.1
+ vec4(texture2D(Texture, vec2(texCoord.x, texCoord.y-2.0*ystep)).rgb,1.0) * 0.1
+ vec4(texture2D(Texture, vec2(texCoord.x-2.0*xstep, texCoord.y)).rgb,1.0) * 0.1
+ vec4(texture2D(Texture, vec2(texCoord.x+2.0*xstep, texCoord.y)).rgb,1.0) * 0.1;
gl_FragColor = texColor;
2024-06-09 07:38:02 +00:00
//gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
2024-06-06 13:25:38 +00:00
}