โ† All examples

godot shaders

CMYK halftone print screens

Reproduce colour printing: the image is split into cyan, magenta, yellow and black, each printed as dots on its own rotated grid with dot size following the ink amount, then composited on paper.

Recorded render of CMYK halftone print screens

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • demo.tscn
  • inspect_shader.py
  • material.tres
  • post_halftone_dots.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), dot_spacing (float = 7), dot_softness (float = 0.8), paper_color (vec4 = 0.97, 0.95, 0.9, 1), ink_strength (float = 1), monochrome (bool = no)
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 printed as overlapping cyan, magenta, yellow and black dot screens on cream paper.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/post_halftone_dots/

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

Dots sample the ink at each pixel, not at the cell centre, so dot edges follow image edges slightly. The RGB to CMYK conversion is the naive formula without colour management. Dot spacing is in screen pixels. 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.