โ† All examples

godot shaders

Holographic trading card foil

Stylized holographic foil for cards and stickers: rainbow bands that slide with the viewing angle, a grid of diffraction tiles each with its own grating direction, and sparkle points, over a printed base colour.

Recorded render of Holographic trading card foil

What this component contains

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

How it works

Shader type
spatial
Parameters
print_color (vec4 = 0.12, 0.14, 0.3, 1), foil_strength (float = 0.8), band_frequency (float = 4), view_shift (float = 3), tile_count (float = 14), tile_contrast (float = 0.5), sparkle_density (float = 0.15), saturation (float = 0.85)
Use it on
A mesh with UVs and tangents (a thin box or quad as a card).
Result
A dark card covered in rainbow foil that shifts and glitters as it tilts.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/holographic_foil/

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

Artistic, not a diffraction calculation. Colours depend on the view angle only, not on light positions. Tiles and sparkles are aligned to UVs and alias when the card is small on screen.