Log inGet started
World

Procgen Effects Showcase

Branchmain
Branchesmain
Commit99ff90d12c

README.md

shield_dome_mat

Material for the energy-shield dome in the fx_shield scene. The ShieldDome entity at (110, 0, 150) draws shield_dome_mesh with it and carries the ShieldFxDriver component (radius 9, impact lights named ImpactLight). ShieldFx.module resolves the material by name in M.start and writes its center once; every frame it writes the twelve hit slots and strain in one Material.setProperties call, the same values it writes to ground_arcs_mat.

Shader: shield_dome (shield_dome.shader). Its header: an energy shield dome whose hits arrive as 12 float4 material properties, with the hex lattice, ripples, flares, strain flicker and base arcs all evaluated per pixel. A conformal projection of the sphere onto a plane keeps the hex cells hexagonal. Each hit sends a ring and a hex-quantised wave across the dome and blooms at the impact point; the rim brightens with a fresnel term; strain makes cells strobe, the whole shield stutter and the colour drift toward magenta-white; back faces draw at 55% brightness. The vertex stage dents the surface at each impact and pushes a travelling swell outward from it.

Render state: blend: additive, cull: none, depth_write: false.

Properties

  • hex_scale: 12.0: density of the hex lattice on the projected dome (default 9, range 2 to 30); a larger value makes more, smaller cells.
  • tint (default (0.08, 0.55, 1.0, 1.0)): base glow colour.
  • hot (default (0.75, 0.95, 1.0, 1.0)): colour mixed in for arcs and hit heat.
  • center (default (0, 0, 0, 9)): xyz is the dome centre in world space and w the dome radius. ShieldFx writes the ShieldDome entity's position (110, 0, 150) and the driver's radius, 9.
  • strain (default 0, range 0 to 3): overload level; the shader divides it by 2.5 and clamps it to 1. ShieldFx raises it with every hit, more when the hit lands near recent ones, caps it at 3 and lets it decay over time.
  • hit0 to hit11 (default (0, 1, 0, -1)): one slot per recent hit. xyz is the unit direction of the hit from the dome centre times its strength, w its age in seconds; an age below 0 or above 3.5 leaves the slot idle.