Pretty simple question
I want to use the custom 2D filter to render in pixels - by Matías Fernández---->Found here
I need it to only affect ONE object in my shot.
I’m guessing this could work by separating the object within the filter code, then rendering the image and subtracting the “mask” from it? Sort of like a bias?
I’m more on the art side, not much a programmer
All and any ideas would be a lifesaver <3
// 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);
}
(Example Rendered in UpBge with filter)