I wrote a very simple but functional Pixelation Filter. It works tip top with the 3D scene. But if I want to add it on the GuiViewPort, the 3D scene is no longer visible. As my HUD is in the GuiViewPort it looks weird if that has no pixelation.
Any ideas how I could solve it? I already tried getGuiViewPort().setClearColor(true), that solves some issues in the GUI but still makes everything black and the 3D scene is invisible.
Here are the necessary code snipplets.
uniform sampler2D Texture;
const float m_PixelSize = 0.002;
varying vec2 texCoord;
void main() {
vec2 pixelCoord = vec2(floor(texCoord.x / m_PixelSize) * m_PixelSize,
floor(texCoord.y / m_PixelSize) * m_PixelSize);
vec3 pixelColor = texture2D(Texture, pixelCoord).rgb;
gl_FragColor = vec4(pixelColor,1.0);
}
fppGui.addFilter(new PixelationFilter());
main.getGuiViewPort().setClearColor(true);
main.getGuiViewPort().addProcessor(fppGui);