โ† All examples

godot shaders

Tilt-shift miniature effect

Make a scene look like a miniature model: a horizontal band stays sharp while blur grows above and below it, with boosted saturation and contrast as in tilt-shift photographs.

Recorded render of Tilt-shift miniature effect

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • demo.tscn
  • inspect_shader.py
  • material.tres
  • post_tilt_shift.gdshader
  • preview.png
  • test_package.py
  • verification/native.json

How it works

Shader type
spatial
Render modes
unshaded, cull_disabled, depth_test_disabled, depth_draw_never, skip_vertex_transform, fog_disabled
Parameters
screen_texture (sampler2D), focus_center (float = 0.55), focus_width (float = 0.12), blur_ramp (float = 0.3), max_blur_pixels (float = 8), saturation (float = 1.35), contrast (float = 1.1)
Use it on
A MeshInstance3D with a 2 x 2 QuadMesh, `material.tres` as its material override and a large extra cull margin, as in `demo.tscn`.
Result
The scene with a sharp middle band and blurred top and bottom, colours boosted like a toy model.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/post_tilt_shift/

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • contract_static
  • engine_run
  • engine_log_clean
  • shader_in_scene
  • capture_written
  • render_not_uniform
  • shader_changes_pixels

Limits to consider

Blur ignores depth, so foreground objects crossing the sharp band stay sharp where they should not. Works best with high, tilted camera angles. The pass reads Godot's screen texture after opaque geometry, so transparent objects drawn after it are not processed and its order among other transparent passes is not controlled.