Log inGet started
World

Procgen Effects Showcase

Branchmain
Branchesmain
Commit99ff90d12c

README.md

ground_arcs_mat

Material for the ring of energy on the ground around the shield dome in the fx_shield scene. The ShieldGroundArcs entity at (110, 0, 150) draws shield_ground_mesh with it. ShieldFx.module resolves it 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 shield_dome_mat.

Shader: ground_arcs (ground_arcs.shader). Its header describes a flat annulus lying on the ground around the dome's foot: a soft energy glow, jagged radial arcs crawling out from the base, and hot spots on the ground under whichever part of the dome was just hit. Hits low on the dome heat the ground more than hits high on it, the ring fades out between 4.5 and 9.5 m outside the dome radius, and under strain the whole ring stutters. It is an unlit fragment() shader returning alpha 1.

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

Properties

mat.yaml sets only the render block. The shader's properties, and what writes them:

  • 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.