I’ve been having some trouble with using this pixel shader for my game. The edges of objects aren’t sharp or crisp, like when I play and record my game at 240p (with no shader), vs recording it at 960p with the shader applied. Recording it at a lower resolution yields the correct result of what I’m trying to achieve. Is there a way to mitigate the blurriness of the outlines of objects at higher resolutions with the shader applied?
I have no idea how to code glsl shader but I did google for an hour just because I wanted to know if this is possible to fix. It seems it should be in an interpolation mode but I have no idea how to add it to the shader.
Ah, thank you! I cam across this as well and have reached the same wall as how to use this since I barely know how GLSL works as well.
The only other method I could find was someone recommended was to use RenderToTexture, and I tried to do that but there doesn’t seem to be a way to force blender (in this mode) to render without AA, and it seems like it’s tied to the window size. I looked through the API and the “scale” function is supposed to implement nearest neighbor scaling for video textures, but I am not sure how to implement it.
Also here’s an example of how using RenderToTexture does lowers the resolution, but it’s still blurry
I’ve been considering even making some sort of wrapper as an extension of the game exe itself to just resize the game that way and circumvent this problem, but I have no idea how to do that either.
here’s another closeup of the thing where there is a slight transparency that happens along the edges that has been driving me nuts.
So far the best way I can think of fixing this is by altering the pixelate filter in the OP to make the edges not blurry but I can’t figure it out.
Technically, I don’t think it’s possible not to get that anti aliasing effect with that filter, it samples a square containing multiples pixels and averages the values.
With the render-to-texture method, it’s not a matter of mipmapping but filtering. It is possible to change the filtering from linear to nearest using the OpenGL Wrapper module, bgl.