Put the 3D scene inside a SubViewportContainer with stretch on, set its texture_filter to Nearest, and pick stretch_shrink as a whole number. In our Godot 4.7 test on a 960x540 window, the same container left at the default filter turned 99.4% of a pattern of 1-pixel black and white rows into grey. The script showed it as clean 2x2 blocks. A 320x240 picture stretched to fill the window stayed sharp but its rows came out 2 and 3 pixels tall.
The code
Add a SubViewportContainer with this script, give it a SubViewport child, and move your 3D level, camera and lights under the SubViewport. Keep the HUD outside the container so text stays at full resolution. target_height 240 is close to the PS1's 240 lines.
extends SubViewportContainer
## Draws the game at a low, PS1-style resolution and scales it up sharp, every low-res pixel the same size.
## Put your 3D scene inside this container's SubViewport. UI outside the container stays at full resolution.
@export var target_height := 240 # about this many rows in the low-res picture
func _ready() -> void:
stretch = true # the SubViewport takes the container's size divided by stretch_shrink
texture_filter = CanvasItem.TEXTURE_FILTER_NEAREST # hard blocks: the default Linear blurs them
set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) # fill the window
get_viewport().size_changed.connect(_fit)
_fit()
func _fit() -> void:
var h := get_viewport().get_visible_rect().size.y
stretch_shrink = maxi(1, roundi(h / target_height)) # a whole number, so no row is taller than another
What we measured
A 960x540 window. Inside the SubViewport, rows of 1 pixel, white and black in turn, the sharpest thing a low-res picture can show. We counted grey pixels on screen and how many screen rows each low-res row took. Two runs gave the same results.
- The script:
stretch_shrink2, a 480x270 picture, 0% grey, every row exactly 2 screen rows tall. - The same container with
stretch_shrink2 but the default filter: 99.4% grey. Not one white or black row was left. - A 320x240 SubViewport scaled to 960x540 with Nearest: 0% grey, but 178 rows were 2 pixels tall and 60 were 3. It was also stretched 3 times across and 2.25 times down, so shapes got wider.
Why low-res pictures blur or wobble
The default texture filter is Linear, which blends neighbouring pixels when a picture is scaled up. That is what keeps photos smooth, and it melts a deliberate low-res look into mush. Nearest copies each low-res pixel into a solid block.
Blocks are only all the same size when the scale is a whole number. At 2.25 times, some low-res rows have to take 2 screen rows and some 3, which shows as uneven stripes. stretch_shrink only takes whole numbers, and with stretch on the container keeps the window's shape, so neither problem can happen.
What to change
target_height: fewer rows for chunkier pixels. The script picks the nearest whole-number shrink, so a window 540 pixels tall gives 270 rows for 240.- Textures on your models still need Nearest filtering of their own for the same hard texels: blurry pixel textures.
- 3D objects in the SubViewport that ignore the mouse: turn on
physics_object_picking, see hover inside a SubViewport.
Effects made for this look: PSX Retro VFX Collection for Godot 4 has 291 PS1-style effects in one project, explosions, magic, gunfire, horror, weather and rewards, all with low-res pixel textures, and a browser to find them.
Tested in Godot 4.7 with the Compatibility renderer.
Ready-made: PSX Retro VFX Collection for Godot 4 has 291 PS1-style effects in one project, all with low-res pixel textures: explosions, magic, gunfire, horror, weather and rewards.
More how-tos for PSX Retro VFX Collection for Godot 4: Play animations in 12 steps a second, at the right speed on any screen
More how-tos: Shaders, materials and lights
- A 3D outline that stays the same width on screen
- Find and fix the seam in a repeating texture
- PS1 vertex wobble that is the same near and far
- Snow that stays on the roofs
- Packed ORM maps on a StandardMaterial3D
- Neon signs that share a material but not a colour
- A MatCap that stays the right way up from every side
- Scroll or tile a 2D texture without stretched edge lines
- Keep floors, roads and roofs sharp when the camera looks along them
- Make WorldEnvironment color grading apply to a 2D game
- Get a hard cel-shaded light edge from StandardMaterial3D's Toon mode
- Make metallic materials stop looking black or flat
- Make a glowing sign or screen actually light the wall around it
- Use a LUT strip for color grading in Godot 4
- Tiling textures that keep their size on any mesh
- Only 8 lights show on a long wall in Compatibility
- Hit flash shader for 2D sprites
- Flash a 3D enemy white when it takes a hit
- Dissolve shader for 3D models
- 2D outline shader that is not cut off
- 3D outline shader without gaps at the corners
- A force field shield with a hit ripple
- Normal map inverted: DirectX vs OpenGL
- Full-screen post-process shader in 3D
- Scroll a shader texture for hours without the once-an-hour jump