Can I somehow set up a sharp low resolution?

I’d like to make a low res game with pixel art in Blender and utilize the 3D environment.
So far what I have tried, the low resolution made the game look blurry.
Any tips for the exported game to look sharp even in low res?

UPBGE has a texture setting called “LOD Bias” with allows customization of mipmap values:
https://github.com/UPBGE/upbge/wiki/0.0.6#material-texture-lod-bias

Any value < 0.0 like -1000 will result in crispy, pixel graphics.

Or perhaps you would be more comfortable with using a pixelate shader to produce pixel graphics as a post-process.
https://blenderartists.org/t/pixelate-shader-filter2d-bge/593719

Thank you for your suggestion.
The pixelate shader is working great but it keeps making artifacts and smearing some parts.

I’m using a plain BGE not UPGE so the filter you have suggested at the end doesn’t work for me.
Maybe I should learn how to use UPBGE.

The original shader script from the bottom link still works in BGE. :slightly_smiling_face:

1 Like

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.

// 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);
}

3 Likes

Thanks, the filter works great.
But since I’m using low res pixel art tiles, it kind of shows them stretched in some parts.
Works great with 3D models.

There’s no need for filters like this. You can easily render hard pixels in Cycles by changing the pixel filter width to zero.
The setting is in the properties panel. Render->Film->Pixel Filter->Width.

I’m confused. The tag for this thread says “BGE”, but is UPBGE also a possible solution for you the thread owner?

Could be if I’d use UPBGE.

I don’t think you can do that in the game engine.

Right, game engine. I didn’t notice the post category. Sorry.

Hey, do you know how to make this filter work in UPBGE version 0.3? When I use it, it looks like this.

I modified the filter, you have to uncomment the 5th line, so it is #define UPBGE3. I haven’t tested it, but I think it should work. Try it and tell me.

Hey thank you for reply! I tested the modified filter and uncomment the 5th line but doesn’t worked. Please check if i made correct.

ps: I sent the wrong image. But I tested with the #define UPBGE3 and doesn’t work too

Sorry, it had an error. Now it’s fixed, just uncomment the same line.

1 Like

Now its working perfectly. Thank you for the help!

Is there a way for this to effect only one object?

  • I’m desperate for this feature… its needed for my game :sob: