You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

20 lines
440 B

varying vec2 V_Texcoord;
uniform sampler2D U_MainTexture;
void main()
{
vec4 maxValue = vec4(0.0);
int coreSize = 2;
int halfCoreSize = coreSize / 2;
float texelOffset = 1/100.0;
for(int y=0; y<coreSize; y++){
for(int x=0; x<coreSize; x++){
vec4 color = texture2D(U_MainTexture, V_Texcoord+vec2((-halfCoreSize+x)*texelOffset, (-halfCoreSize+y)*texelOffset));
maxValue = max(maxValue,color);
}
}
gl_FragColor=maxValue;
}