LibGDX has no documented single high-level blurScreen() API. To blur a game scene, render it to a FrameBuffer, run its color texture through horizontal and vertical fragment-shader passes, then draw the processed texture before drawing your sharp UI. For a pause menu, a half-resolution, two-pass blur is usually the best starting point.
The rendering pipeline
A blur must sample neighboring pixels. A translucent color layer cannot do that, and applying a shader while drawing ordinary sprites only processes each sprite texture rather than the completed scene.
world → scene FrameBuffer → horizontal blur → vertical blur → screen → menu/UI
LibGDX framebuffers render into textures that can be used for post-processing, as documented in the official FrameBuffer guide. Pixels already sent directly to the backbuffer must therefore be rendered again through an off-screen target (or captured) before they can be blurred.
Choose the effect you actually need
- Whole-scene blur: blur everything rendered by the game before a modal screen.
- Background-only blur: blur the world, then draw text, controls and menu panels normally.
- Rectangular blur: draw the processed texture only inside a panel rectangle, with correct texture-coordinate mapping and edge handling.
- Masked blur: combine the blurred texture with a mask for an arbitrary shape; LibGDX’s framebuffer and shader masking techniques are described at the masking documentation.
- Static pause blur: render and blur once when pausing, then reuse the final texture while the menu is open.
Create the processing framebuffers
Use color-only buffers for this effect. The example uses half the physical display size, which reduces processed pixels while still giving a smooth background blur.
#1 Best Overall
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
private FrameBuffer sceneBuffer;
private FrameBuffer horizontalBuffer;
private FrameBuffer verticalBuffer;
private TextureRegion sceneRegion;
private TextureRegion horizontalRegion;
private TextureRegion verticalRegion;
private void createBlurBuffers(int width, int height) {
sceneBuffer = new FrameBuffer(Pixmap.Format.RGBA8888, width, height, false);
horizontalBuffer = new FrameBuffer(Pixmap.Format.RGBA8888, width, height, false);
verticalBuffer = new FrameBuffer(Pixmap.Format.RGBA8888, width, height, false);
sceneRegion = new TextureRegion(sceneBuffer.getColorBufferTexture());
horizontalRegion = new TextureRegion(horizontalBuffer.getColorBufferTexture());
verticalRegion = new TextureRegion(verticalBuffer.getColorBufferTexture());
// FrameBuffer textures commonly have the opposite vertical orientation.
sceneRegion.flip(false, true);
horizontalRegion.flip(false, true);
verticalRegion.flip(false, true);
sceneBuffer.getColorBufferTexture().setFilter(Texture.TextureFilter.Linear,
Texture.TextureFilter.Linear);
horizontalBuffer.getColorBufferTexture().setFilter(Texture.TextureFilter.Linear,
Texture.TextureFilter.Linear);
verticalBuffer.getColorBufferTexture().setFilter(Texture.TextureFilter.Linear,
Texture.TextureFilter.Linear);
}
For a full-resolution target, pass Gdx.graphics.getWidth() and Gdx.graphics.getHeight(). For a cheaper effect, use:
int bufferWidth = Math.max(1, Gdx.graphics.getWidth() / 2);
int bufferHeight = Math.max(1, Gdx.graphics.getHeight() / 2);
Quarter resolution (width / 4, height / 4) is useful for a very soft mobile pause background. Draw the result across the full display; enlarging the low-resolution texture increases the apparent screen-space radius.
Recreate and dispose these buffers when the backbuffer size changes. On HDPI displays, logical window dimensions may not equal physical backbuffer pixels; using the real pixel dimensions avoids clipping issues documented in the LibGDX framebuffer documentation.
Rank #2
- QHD Resolution (2560 x 1440) has 1.7 times the pixel density of Full HD for incredibly detailed pinsharp images
- HDR10 provides brighter highlights and nuanced shadow for added depth - making every scene feel more vivid and realistic
- The 180Hz refresh rate minimizes lag for gameplay with ultra-smooth action. Plus, the 1ms response time helps capture your moves in real-time, allowing you to react fast for gaming precision
- AMD FreeSync reduces choppiness, screen lag and image tearing, ensuring that your fast-paced, complex in-game action is stable with minimal stutter
- Ergonomic stand allows for tilt, pivot and height adjustments to maximize gaming comfort
@Override
public void resize(int width, int height) {
disposeBlurBuffers();
createBlurBuffers(Math.max(1, width / 2), Math.max(1, height / 2));
}
Do not nest ordinary LibGDX framebuffers casually: FrameBuffer.end() restores the backbuffer rather than reliably restoring an arbitrary previously bound framebuffer. Finish one pass before beginning another.
Compile a separable blur shader
A separable Gaussian blur performs one one-dimensional pass horizontally and one vertically. This requires far fewer samples than a two-dimensional kernel of comparable radius.
Vertex shader
#ifdef GL_ES
precision mediump float;
#endif
attribute vec4 a_position;
attribute vec4 a_color;
attribute vec2 a_texCoord0;
uniform mat4 u_projTrans;
varying vec4 v_color;
varying vec2 v_texCoords;
void main() {
v_color = a_color;
v_texCoords = a_texCoord0;
gl_Position = u_projTrans * a_position;
}
Fragment shader
#ifdef GL_ES
precision mediump float;
#endif
uniform sampler2D u_texture;
uniform vec2 u_texelSize;
uniform vec2 u_direction;
varying vec4 v_color;
varying vec2 v_texCoords;
void main() {
vec2 offset = u_texelSize * u_direction;
vec4 color = vec4(0.0);
color += texture2D(u_texture, v_texCoords - 4.0 * offset) * 0.016216;
color += texture2D(u_texture, v_texCoords - 3.0 * offset) * 0.054054;
color += texture2D(u_texture, v_texCoords - 2.0 * offset) * 0.121621;
color += texture2D(u_texture, v_texCoords - 1.0 * offset) * 0.194595;
color += texture2D(u_texture, v_texCoords) * 0.227027;
color += texture2D(u_texture, v_texCoords + 1.0 * offset) * 0.194595;
color += texture2D(u_texture, v_texCoords + 2.0 * offset) * 0.121621;
color += texture2D(u_texture, v_texCoords + 3.0 * offset) * 0.054054;
color += texture2D(u_texture, v_texCoords + 4.0 * offset) * 0.016216;
gl_FragColor = color * v_color;
}
u_texture is the framebuffer texture supplied by SpriteBatch; u_texelSize is one source texel in normalized coordinates; and u_direction is (1, 0) or (0, 1). The weights above are one practical nine-sample configuration, not a LibGDX-required constant.
Rank #3
- Smooth motion: 240Hz refresh rate and fast 0.5ms response time provide crisp visuals and fluid movement with less input lag.
- Seamless gaming: FreeSync Premium and HDMI VRR eliminate tearing for smooth, responsive PC and console gameplay.
- Fast IPS: Faster 0.5ms response with excellent color accuracy across wide IPS viewing angles.
- Rich color: 99% sRGB color coverage delivers vivid, detailed imagery with strong accuracy.
- Eye comfort: TÜV Rheinland 3‑star certified display lowers blue light while preserving color quality.
blurShader = new ShaderProgram(
Gdx.files.internal("shaders/blur.vert"),
Gdx.files.internal("shaders/blur.frag")
);
if (!blurShader.isCompiled()) {
throw new GdxRuntimeException("Blur shader failed to compile:n" + blurShader.getLog());
}
Render the scene and run both passes
1. Render the world into the source buffer
private void renderSceneToBuffer() {
sceneBuffer.begin();
Gdx.gl.glClearColor(0f, 0f, 0f, 1f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
worldViewport.apply();
worldCamera.update();
renderWorld();
sceneBuffer.end();
}
Use the same world camera and viewport that produce the normal scene. The low-resolution buffer is a processing target, not automatically a new game coordinate system.
2. Horizontal pass
private void blurHorizontal() {
horizontalBuffer.begin();
Gdx.gl.glClearColor(0f, 0f, 0f, 1f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
blurShader.bind();
blurShader.setUniformf("u_direction", 1f, 0f);
blurShader.setUniformf("u_texelSize",
1f / sceneBuffer.getWidth(),
1f / sceneBuffer.getHeight());
batch.setShader(blurShader);
batch.begin();
batch.draw(sceneRegion, 0, 0,
horizontalBuffer.getWidth(), horizontalBuffer.getHeight());
batch.end();
batch.setShader(null);
horizontalBuffer.end();
}
3. Vertical pass
private void blurVertical() {
verticalBuffer.begin();
Gdx.gl.glClearColor(0f, 0f, 0f, 1f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
blurShader.bind();
blurShader.setUniformf("u_direction", 0f, 1f);
blurShader.setUniformf("u_texelSize",
1f / horizontalBuffer.getWidth(),
1f / horizontalBuffer.getHeight());
batch.setShader(blurShader);
batch.begin();
batch.draw(horizontalRegion, 0, 0,
verticalBuffer.getWidth(), verticalBuffer.getHeight());
batch.end();
batch.setShader(null);
verticalBuffer.end();
}
4. Draw the result at screen size
private void drawBlurredScene() {
screenViewport.apply();
batch.setProjectionMatrix(screenCamera.combined);
batch.begin();
batch.draw(verticalRegion, 0, 0,
Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
batch.end();
}
If your UI uses a logical Viewport, draw with that viewport’s world dimensions instead of raw screen coordinates. Restore the intended camera and viewport whenever switching between world, post-processing and UI stages.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Draw a sharp pause menu
The complete pause render order is:
- Render the world to
sceneBuffer. - Run the horizontal and vertical blur passes.
- Draw
verticalRegionto the screen. - Optionally draw a translucent dark overlay.
- Draw the pause menu with the normal batch shader.
private void drawDimOverlay() {
batch.begin();
batch.setColor(0f, 0f, 0f, 0.35f);
batch.draw(whitePixel, 0, 0,
Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
batch.setColor(Color.WHITE);
batch.end();
}
private void drawPauseMenu() {
batch.setShader(null);
batch.setColor(Color.WHITE);
// Draw Scene2D or other UI here.
}
The overlay changes darkness and contrast; it does not blur. Always reset both shader and batch color so state does not leak into menu rendering.
Rank #4
- 27” 240Hz 1500R Curved FHD 1080P Gaming Monitor for Game Play.
- Prioritizes Gaming Performance: Up to 240Hz high refresh rate, more immersive 1500R Curvature, FreeSync, MPRT 1ms Response Time, Black Level adjustment(shadow booster), Game Modes Preset, Crosshair.
- Cinematic Color Accuracy: 130% sRGB & DCI-P3 95% color gamut, 4000:1 contrast ratio, 300nits brightness, HDR, Anti-flicker; Anti-Glare.
- Plug & Play Design: HDMI & DP1.4 & Audio Jack(No built-in speakers), durable metal stand, tilt -5°~15, VESA 100*100mm compatible.
- Warranty: Money-back and free replacement within 30 days, 1-year quality warranty and lifetime technical support. Pls contact SANSUI service support first if any product problem.
Cache a static pause blur
If the world stops while paused, recomputing two passes every frame is unnecessary.
private boolean paused;
private boolean blurReady;
public void pauseGame() {
paused = true;
blurReady = false;
}
public void render() {
if (!paused) {
renderWorldDirectlyOrToSceneBuffer();
return;
}
if (!blurReady) {
renderSceneToBuffer();
blurHorizontal();
blurVertical();
blurReady = true;
}
drawBlurredScene();
drawDimOverlay();
drawPauseMenu();
}
public void resumeGame() {
paused = false;
blurReady = false;
}
For an animated background or animated blur, rerun the pipeline each frame instead.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Performance choices
| Approach | Quality | Relative cost | Typical use |
|---|---|---|---|
| Full-resolution, two-pass | Highest | Highest | Large captures and powerful desktop GPUs |
| Half-resolution, two-pass | Very good | Moderate | Default for most pause menus |
| Quarter-resolution, two-pass | Soft/coarse | Low | Strong background blur on mobile |
| One wide two-dimensional kernel | Can be good | Expensive | Simple prototypes |
CPU Pixmap processing |
Variable | Usually poor for live use | Offline or saved images |
Downsampling reduces the number of processed pixels and often gives a smoother large-radius appearance. A practical discussion of this optimization for LibGDX Gaussian blur is available on Stack Overflow; actual speed depends on resolution, fill rate, shader precision, device GPU and the rest of your scene.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- 1800R curve monitor the curved display delivers a revolutionary visual experience with a leading 1800R screen curvature as the images appear to wrap around you for an in depth, immersive experience
- Hdmi, VGA & PC audio in ports
- High refresh rate 75Hz.Brightness (cd/m²):250 cd/m2
- Vesa wall mount ready; Lamp Life: 30,000+ Hours
- Windows 10 Sceptre Monitors are fully compatible with Windows 10, the most recent operating System available on PCs.Brightness: 220 cd/M2
The effective radius depends on sample offsets, u_texelSize, buffer resolution, filtering and the number of pass pairs. Increase samples or add another horizontal/vertical pair carefully: excessively separated samples create streaks rather than a smooth blur.
Why not capture with Pixmap?
Pixmap.createFromFrameBuffer() is useful when you need to save an image or perform a one-time offline operation. It is usually the wrong default for a live pause effect because it reads pixels from GPU memory to the CPU, can stall the pipeline, requires extra image/texture handling, and complicates mobile or HTML/GWT paths. Keeping the scene in GPU-resident framebuffers avoids that readback.
Blur only a region
For a panel-sized blur, render the scene to a framebuffer as usual, run the blur, then draw the processed texture only to the destination rectangle. The shader still samples neighboring source texels, so merely changing the destination rectangle does not solve edge sampling; map texture coordinates deliberately and clip with a scissor rectangle, mask or dedicated geometry.
For arbitrary shapes, combine the blurred result with a mask texture or stencil-like technique. Keep the unblurred scene available if the rest of the screen should remain sharp, then draw the panel and its controls over the masked result.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Image is upside down | Framebuffer texture orientation differs from SpriteBatch coordinates | Flip each framebuffer TextureRegion with flip(false, true). |
| Screen is black | Buffer was not ended, clear/draw dimensions are wrong, texture was disposed, or shader failed | Check pass order, visible destination rectangles, texture lifetime and blurShader.getLog(). |
| Shader has no visible effect | Shader is not active for the framebuffer draw, direction is zero, or texel size is zero | Set the shader before the draw, use (1,0) then (0,1), and use the source buffer dimensions. |
| Blur is weak | Buffer is full resolution or radius is small | Try half/quarter resolution, larger offsets or another pass pair. |
| Streaks or separated samples | Offsets are too large, filtering is nearest, or weights/dimensions are wrong | Reduce offsets, use linear filtering where supported, and verify dimensions. |
| Pause menu is blurred | UI was rendered into the source buffer or drawn while blur shader was active | Finish world and blur first; reset shader before drawing UI. |
| Output clips on Retina/HDPI | Logical dimensions do not match physical backbuffer pixels | Size buffers from actual backbuffer dimensions or follow the HDPI guidance in the LibGDX documentation. |
| Performance is poor on mobile | Full-resolution or repeated wide passes | Downsample, reduce samples/pairs, and cache static pause results. |
| Resize breaks the effect | Old buffers retain the previous dimensions | Dispose and recreate all buffers and regions in resize. |
Alternatives when a real blur is unnecessary
- Tint overlay: draw the scene, add a translucent black layer, then draw the menu. It is cheap and often adequate for simple pause screens, but it does not soften edges.
- Low-resolution enlargement: render to a small framebuffer and enlarge it with linear filtering for a soft or pixelated look.
- Offset copies: draw several translucent, slightly shifted copies of the scene texture. This is stylized, can create halos, and may cost more draw calls than expected.
- CPU processing: reserve for saved images or offline work.
- Post-processing library: optional; LibGDX’s framebuffer-plus-shader pipeline is sufficient when you need direct control over quality and mobile cost.
For most LibGDX pause menus, start with RGBA8888 color buffers at half display resolution, a separable horizontal/vertical shader, linear filtering, and one cached result while paused. Keep the world camera for scene rendering, use a screen or UI viewport for the final draw, and render all menu controls after the blur shader has been removed.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




