# Can I somehow set up a sharp low resolution?

**URL:** <https://blenderartists.org/t/can-i-somehow-set-up-a-sharp-low-resolution/1323775>\
**Category:** Game Engine Support and Discussion\
**Tags:** bge\
**Created:** [August 24, 2021, 2:53pm UTC](https://blenderartists.org/t/can-i-somehow-set-up-a-sharp-low-resolution/1323775 "2021-08-24T14:53:01Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![MattFrnndz](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/a8b319/32.png) [@MattFrnndz](https://blenderartists.org/u/MattFrnndz)\
**Post date:** [August 25, 2021, 1:37am UTC](https://blenderartists.org/t/can-i-somehow-set-up-a-sharp-low-resolution/1323775/5 "2021-08-25T01:37:53Z")

</div>

I just made this pixelate filter, it doesn’t produce the anti-aliasing effect of SL\_RU’s filter.  
For UPBGE 0.3, uncomment the 5th line: remove the double slash (//) only. Also, set the sampling to 1.

```auto
// Pixelate 2D Filter by MattFrnndz
// It produces sharp edges, without anti-aliasing effect

// on UPBGE 0.3, uncomment the following line (remove //)
//#define UPBGE3

int pixelSize = 4;

uniform sampler2D bgl_RenderedTexture;

uniform float bgl_RenderedTextureWidth;
uniform float bgl_RenderedTextureHeight;

#ifndef UPBGE3
vec2 texCoord = gl_TexCoord[0].st;
#else
in vec4 bgl_TexCoord;
vec2 texCoord = bgl_TexCoord.xy;
out vec4 fragColor;
#define gl_FragColor fragColor
#endif

void main(void)
{
    float pS = float(pixelSize);
    
    vec2 pixelRes = vec2(bgl_RenderedTextureWidth / pS,
                         bgl_RenderedTextureHeight / pS);
                         
    float offset = 1.5 / pS;
    
    vec2 pixCoords = vec2((floor(texCoord.x * pixelRes.x) + offset) / pixelRes.x,
                          (floor(texCoord.y * pixelRes.y) + offset) / pixelRes.y);
    
    gl_FragColor = texture2D(bgl_RenderedTexture, pixCoords);
}

```

 ![pixelate-filter](https://blenderartists.org/uploads/default/original/4X/1/9/9/19936e3596142530d7796f7d282e63da47df1a7b.png)

---

_[View the full topic](https://blenderartists.org/t/can-i-somehow-set-up-a-sharp-low-resolution/1323775)._
